Crates.io | yoctolio |
lib.rs | yoctolio |
version | 0.4.0 |
source | src |
created_at | 2021-11-05 17:22:05.978176 |
updated_at | 2023-04-13 22:25:39.143906 |
description | A tiny video portfolio generator |
homepage | |
repository | https://gitlab.com/girflo/yoctolio |
max_upload_size | |
id | 477444 |
size | 43,981 |
A strip down static site generator, the idea is to generate a simple single page portfolio using information collected in csv files.
Using Cargo : cargo install yoctolio
Once yoctolio installed you can run yoctolio init
to initialize a new project.
After configurating everything to your liking you can simple run yoctolio build
to compile your website.
The first step needed to add content on your portifolio is to create a file at the following path :
config/config.txt
As well as the config/tags.txt
file with the following content :
1, directing
2, editing
The words directing
and editing
can be changed and any tag can be added as long as their id (the number in front of the name) is uniq.
Inside this file you can now add one line per section on the index page of the portfolio :
Name of the section, file_name_of_the_section.txt
Yoctolio will now generate a section called Name of the section
, the videos you wish to include in this section need to be listed in the file you defined. In this case config/file_name_of_the_section.txt
To add a video you need to follow this pattern :
Name of the video, youtube_url, tag_number, year, description
Where :
Name of the video
is self explenatoryyoutube_url
is the full youtube url example : https://www.youtube.com/watch?v=79T8c0vW0ik
tag
the id of the tag of the video, to use multiple tags add -
between two tags example 1-3
year
the year of the production example : 2021
description
a small explanation, the one is optional and can be left outThe default templates are visible in the project repository, to create your own you can simply create a templates
folder with an index.html
inside and it will be used by default.
If you want another page you can create a folder at the following path templates/pages
containing any html page that will be included in you portfolio.
Whenever you want to include css, js, images or any asset to you projects you can simply create a folder at the following path templates/assets
, the content of this folder will be copied to public/assets
during compilation.
A partial is a small html snippet that can be easilly reused in different pages and template, it can be useful for header, footer, navigation...
To add partials to your porfolio you need to create the folder templates/partials
, then inside create any html file. To call a partial from a page of the index.html you just have to include the following snippet : {{!partial_name}}
.
So if you create templates/partials/footer.html
it is called by using {{!footer}}
in any template.
When working on your templates you probably want to regenerate automatically the website as doing it manually can be quickly become annoying.
To do so I usually use entr like that :
ls templates/* | entr yoctolio build