Crates.io | ssg08 |
lib.rs | ssg08 |
version | 0.2.7 |
created_at | 2025-05-07 01:35:50.241067+00 |
updated_at | 2025-05-11 15:22:14.988052+00 |
description | A simple static site generator. |
homepage | https://git.sr.ht/~orchid/ssg08 |
repository | https://git.sr.ht/~orchid/ssg08 |
max_upload_size | |
id | 1663295 |
size | 33,594 |
A static site generator, configured via templates.
cargo install ssg08
See ssg08 --help
for usage information.
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.
The parsed dialect of Markdown is CommonMark, with the following extensions.
See the pulldown_cmark
documentation
for more information.
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. |
--page
) accepts all expansions.--post
) accepts {{title}}
, {{date}}
, and {{link}}
.--nav
) accepts {{title}}
and {{date}}
.A page layout example:
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="date" content="{{date}}">
<link href="/main.css" rel="stylesheet" type="text/css" media="all">
<title>{{title}}</title>
</head>
<body>
<nav>{{nav}}</nav>
<h2>{{title}}</h2>
<div class="content">{{content}}</div>
<div class="feed">{{feed}}</div>
</body>
</html>
A post layout example:
<a href="/{{link}}">{{title}}</a>{{date}}
A navbar layout example:
<a href="/{{link}}">{{title}}</a>
index
as
its title.