Crates.io | site |
lib.rs | site |
version | 0.9.0 |
source | src |
created_at | 2018-12-13 13:31:41.109895 |
updated_at | 2024-10-24 13:38:58.470147 |
description | A simple, fast, opinioned static site generator |
homepage | |
repository | https://github.com/hayatoito/site |
max_upload_size | |
id | 101749 |
size | 57,431 |
Site is a fast, simple, and opinioned static site generator, written in Rust. Highlights include:
cargo install site
No documentations yet.
Meanwhile, as a living document, use hayatoito/hayatoito.github.io as your starter boilerplate. https://hayatoito.github.io/ is built from that repository.
root_dir/
- src/
- (Put your markdown files here)
- template/
- (Put your template files here)
src/
is a
folder where your all markdown files live. They are converted into HTML files,
using Jinja2 template, and are copied into the output directory.
Any other resources in src
directory are also copied to the output
directory.
template/
is a folder where jinja2's template files live.
Site
uses markdown.
# Article title
<!--
date = "2021-12-01"
-->
# Section
Hello Article!
- hello
- world
Nothing special except for:
date
, follows.TODO: Explain
Name | Description | Default value |
---|---|---|
page |
false | |
date |
(date is mandatory unless page: true ) |
|
update_date |
NA | |
author |
NA | |
slug |
The page's URL | Calculated by a relative PATH to src |
draft |
Skip this markdown | false |
template |
Template file to use in template folder |
article or page |
If a markdown's metadata contains page: true
, Site consider that the
markdown represents a page, instead of an article.
# Page title
<!--
page = true
-->
# Section
Hello Page!
- hello
- world
The differences between article and page are:
articles
template variable. Neither in
articles_by_year
.date
metadata.TODO: Explain
Name | page | article | Description |
---|---|---|---|
entry |
x | x | Represents an article or a page (its metadata and content) |
site |
x | x | Site configuration given by --config parameter |
articles |
x | The list of the articles | |
articles_by_year |
x | The list of { year, articles} |
articles
and articles_by_year
are only available in a page. In other
words, an article can't know other articles.entry
In addition to its metadata, entry
contains the following fields:
Name | Description |
---|---|
entry.title |
Title |
entry.content |
Generated HTML |
entry.toc_html |
Generated TOC (if toc: true ) |
site build --root-dir . --config=config.toml --out-dir out
root-dir
should contain src
and template
folders.
See Make.zsh for the example CLI usages for various tasks.
You can also use GitHub Action to build and deploy automatically if you are using GitHub Pages. See build.yml as an example.