| Crates.io | site |
| lib.rs | site |
| version | 1.1.0 |
| created_at | 2018-12-13 13:31:41.109895+00 |
| updated_at | 2025-09-23 12:53:59.09169+00 |
| description | A simple, fast, opinionated static site generator |
| homepage | |
| repository | https://github.com/hayatoito/site |
| max_upload_size | |
| id | 101749 |
| size | 60,491 |
Site is a fast, simple, and opinionated static site generator written in Rust. Its main features are:
cargo install site
There is no documentation yet.
In the meantime, you can use the hayatoito/hayatoito.github.io repository as a starter template. The author's site, hayatoito.github.io, is built from this repository.
root_dir/
- src/
- (Your markdown files go here)
- template/
- (Your template files go here)
src/: This directory contains all your Markdown files. They are converted to
HTML using Jinja2 templates and placed in the output directory. Any other
files in this directory are also copied to the output directory.
template/: This directory holds your Jinja2 template files.
Site uses Markdown with TOML front matter for metadata.
# Article title
<!--
date = "2021-12-01"
-->
# Section
Hello Article!
- hello
- world
| Name | Description | Default Value |
|---|---|---|
page |
If true, the file is treated as a page. |
false |
date |
The publication date of the article. | (mandatory for articles) |
update_date |
The date the article was last updated. | (none) |
author |
The author of the article. | (none) |
slug |
The URL slug for the page. | (derived from the file path) |
math |
If true, enables MathJax for the page. |
false |
draft |
If true, the article will not be published. |
false |
template |
The template file to use from the template dir. |
article or page |
If a Markdown file's metadata contains page = true, Site treats it as a
page instead of an article.
# Page title
<!--
page = true
-->
# Section
Hello Page!
- hello
- world
The main differences between an article and a page are:
articles or articles_by_year template
variables.date in its metadata.| Name | Available On | Description |
|---|---|---|
entry |
Pages & Articles | The current article or page object. |
site |
Pages & Articles | Site configuration from the --config parameter. |
articles |
Pages only | A list of all articles. |
articles_by_year |
Pages only | A list of articles grouped by year. |
An article template does not have access to other articles.
entryThe entry object contains all the metadata fields, plus the following:
| Name | Description |
|---|---|
entry.title |
The title. |
entry.content |
The rendered HTML body. |
site build --root . --out out --config=config.toml
The root directory must contain src and template directories. For more
examples, see the
Make.zsh
file in the starter template.
You can use GitHub Actions to automatically build and deploy your site to GitHub Pages. See the example build.yml workflow file.