chore: big bang migration on Git
Kourou is a (most) simpler static website generator.
No dark magic:
kourou
: it generates your webpages!I was looking for a static website generator, for my personal website. My requirements: nothing complicated. All I wanted was:
However, I found that the popular open source generators were much more advanced than I needed, and that their developers had made decisions that went against my requirements.
Therefore, I developped that little piece of software. :-)
kourou
Simply use go install
:
go install git.sr.ht/~arjca/kourou/cmd/kourou@latest
No init
command here. In the current folder, kourou
expects two directories:
layouts/
;contents/
.See the samples directory for examples.
The contents/
folder contains all your website documents.
Markdown documents may be translated to HTML. To do this, you need to declare a YAML front matter with the layout
field.
For instance, if the layout for index.md
is main-layout
, then the content index.md
can be:
---
layout: main-layout
---
My awesome page!
kourou
will then generate the appropriate index.html
, using both the layout and the content of index.md
.
Layouts are .html files used as templates by the template/html package of the Go standard library. Consequently, anything you can do with this package, you can do here.
Two variables are available in templates:
{{ .Content }}
is the content of a Markdown file, translated into HTML;{{ .Metadata }}
is a map containing all the fields in the Markdown document's front matter. You are free to add as many field as you like. For instance, to print the layout's name in the page, you would write {{ index .Metadata "layout" }}
.Once your files are ready, simply type (in your terminal, in the directory containing layouts/
and contents/
):
kourou [--contents contents/ --layouts layouts/ --output _site/ --layout-field layout]
All generated files can be found in _site/
.
The options (between [...]
) can be used to change the name of the directories and the field checked in Markdown front matters for selecting a layout.