ssg08-0.2.6 is not a library.
ssg08
A static site generator, configured via templates.
Installation
cargo install ssg08
See ssg08 --help
for usage information.
Overview
Each file of the input tree is copied to a file in the same position of the
output tree. Markdown files are converted to HTML, and files with a like-named
folder (ex. posts.md
and posts/
) will have a feed of the folder's Markdown
files appended to their contents.
Markdown
The parsed dialect of Markdown is CommonMark, with the following extensions.
- Tables
- Footnotes
- Strikethrough
- Tasklists
- Smart punctuation
- Math (LaTeX will be tagged, but is not expanded)
- Superscript
- Subscript
See the pulldown_cmark
documentation
for more information.
Templates
ssg08
takes three template parameters to base HTML generation upon. The
following expansions are parsed.
Expansion | Function |
---|---|
{{title}} |
The page's file basename, with hyphens and the extension stripped. |
{{date}} |
The last-modified date of the page file. |
{{navigation}} |
A navigation bar generated from the site's top-level pages. |
{{content}} |
The HTML content of the page, excluding feeds. |
{{feed}} |
Post feeds generated from like-named subtrees. |
{{link}} |
An absolute link to the page. |
- The page layout template (
--page
) accepts all expansions. - The post layout template (
--post
) accepts{{title}}
,{{date}}
, and{{link}}
. - The navbar layout template (
--nav
) accepts{{title}}
and{{date}}
.
A page layout example:
{{title}}
{{nav}}
{{title}}
{{content}}
{{feed}}
A post layout example:
{{title}} {{date}}
A navbar layout example:
{{title}}
Limitations
- As titles are determined via filename, the index page must have
index
as its title.