feat: generate sitemap.xml
feat: generate HTML from Markdown
docs: initialize README.md
Mastaba is a (very (very)) simple static website generator.
No dark magic:
mastaba
: your webpages are (already) readyTo use mastaba
, you need two elements: a layout and a content directory.
A layout is a templated HTML file.
It will be processed by the template/html package of the Go standard library. Consequently, you should use the adequate templating language. Also, anything you can do with this package, you can do it in the layout.
mastaba
inject two values in the layout:
{{ .Content }}
is the content of a Markdown file which has been translated into HTML{{ .Metadata }}
is a map containing all the fields in the front matter of the Markdown document. You can add as many field as you like. To use these values, you will write: {{ index .Metadata "name_of_my_key" }}
This folder contains all the content of your website. Everything will be copied as-is, except for the Markdown files that will be translated to HTML.
This translation includes:
[link](./file.md)
will be translated to <a href="./file.html">link</a>
go install git.sr.ht/~arjca/mastaba/cmd/mastaba@latest
mastaba
has several arguments:
--layout
(optional): the path to the HTML template (default is layout.html
)--input
(optional): the path to the content directory (default is content/
)--output
(optional): the path to the site directory (default is _site
)--host
(required): the base URL of the website