rust-ssg/README.md

62 lines
1.4 KiB
Markdown
Raw Normal View History

2023-10-15 03:23:58 +00:00
# Tyrel's Rust Static Site Generator
## Links
Configuration
* `config.yaml`
2023-10-15 04:46:06 +00:00
* `links.yaml`
* `template` html
* `static` directory
2023-10-15 03:23:58 +00:00
### example: `config.yaml`
```yaml
2023-10-15 03:32:49 +00:00
output_dir: public
2023-10-15 03:23:58 +00:00
links:
source: data/links/links.yaml
template: templates/links/links.html
static_dir: static/
```
### example: `links.yaml`
```yaml
config:
title: Where to find Tyrel Souza
name: Tyrel Souza
description: Software Engineer, gamer, tech-enthusiast, ham, pilot, father
avatar: loupe.jpg
background: moroccan-flower-dark.png
background_opacity: 0.7
links:
- title: Sites
links:
- text: Blog
icon: fa fa-blog
href: https://tyrel.dev
- title: Social
- text: Mastodon
rels: me
icon: fa fa-mastodon
href: https://mastodon.social/@tyrel
- title: Gaming
- text: Switch Friendcode
icon: fa-solid fa-gamepad
copy: "SW-1711-7753-4091"
```
### example `template.html`
2023-10-15 03:26:45 +00:00
This is a jinja template (uses the rust crate minijinja) that has any variable in the `links.yaml` available as context variables.
Docs will come some day. TODO: Docs
2023-10-15 03:23:58 +00:00
[Example code Here](./templates/links/links.html)
### static dir
2023-10-15 03:26:45 +00:00
This is optional, but everything inside will be copied directly next to the `index.html` in the `links` directory, put things like css or avatar images here.
Debating on manually needing to specify a list of files in `config:` but not sold on that yet.
2023-10-15 03:32:49 +00:00
## Blog - Coming Soon