This project is designed to generate YouTube thumbnails for the channel "WeData" using Typst, a powerful static document language. The process involves merging a template with provided title and subtitle text along with an image to create visually appealing thumbnails.
To use it, simply clone this repository.
- Template: A predefined template named
miniature.typin the/template/directory is used as a base. - Input Data:
- Title (titre): The main title of the YouTube video, which can include Typst markup for styling.
- Subtitle (sous_titre): A brief description or subtitle that accompanies the title.
- Image (figure): An image file path relative to the template root directory (
/template).
- Customization:
- Color (couleur): The color of the text, specified in hexadecimal format like
ff0000. - Font Family (police): Allows users to specify a font family.
- Subtitle Size (taille_sous_titre): Custom sizes for the subtitle which is defined relative to text size (ex. 4em = 4 times the size of the text).
- Title Size (taille_titre): Custom sizes for the title which is defined relative to the subtitle size (ex. 1em = 1 time the size of the text)
- Horizontal space (espace_horizontal): Custom sizes for the space between the title and the subtitle.
- Color (couleur): The color of the text, specified in hexadecimal format like
To generate a thumbnail using this project:
- Bring you own image and adapt the figure field in the typst file (e.g.
model.typ). - Set up the parameters as demonstrated in the example below:
#import "template/miniature.typ": miniature
#show: miniature.with(
titre: [
RMARKDOWN document
], // typst markup allowed
sous_titre: [
en bref
], // typst markup allowed
figure: "../rmarkdown.png", // image path relative to template root directory
couleur: "ff0000",
police: "Arial",
taille_sous_titre: 4em,
taille_titre: 1em,
espace_horizontal: 0pt
)- Compile the Typst file into an image using the command-line:
typst compile model.typ file_name.pngThis command will generate a thumbnail in PNG format named file_name.png.
/template/miniature.typ: Contains the Typst template for thumbnails./model.typ: Main script file where you set parameters and import templates.
Feel free to modify the settings according to your needs.