1
0
mirror of https://git.sr.ht/~adnano/kiln synced 2024-09-20 02:32:58 +02:00
kiln/doc/kiln.1.scd

155 lines
3.1 KiB
Plaintext
Raw Normal View History

2020-11-11 01:35:56 +01:00
kiln(1)
# NAME
kiln - a simple static site generator for Gemini sites
# SYNOPSIS
2020-11-20 18:07:38 +01:00
_kiln_ [--html]
# OPTIONS
\--html
If this flag is present, kiln will output HTML as well as Gemini text.
2020-11-11 01:35:56 +01:00
# SITE STRUCTURE
2020-11-20 18:07:38 +01:00
A kiln site is structured in the following way:
2020-11-11 01:35:56 +01:00
2020-11-20 18:07:38 +01:00
[[ *Directory*
2020-11-11 01:35:56 +01:00
:[ *Description*
| src/
: Site source
| templates/
2020-11-20 18:07:38 +01:00
: Site templates
2020-11-11 01:35:56 +01:00
| dst/
: Site destination
2020-11-20 18:07:38 +01:00
| html/
2020-11-11 01:35:56 +01:00
: Site HTML destination
# TEMPLATES
2020-11-20 18:07:38 +01:00
kiln looks for templates in the *templates* directory.
The following templates are supported:
2020-11-11 01:35:56 +01:00
2020-11-20 18:07:38 +01:00
[[ *Template*
2020-11-11 01:35:56 +01:00
:[ *Description*
| page.gmi
: Page template
| index.gmi
: Directory index template
2020-11-20 18:07:38 +01:00
| feed.gmi
: Gemini feed template
2020-11-11 01:35:56 +01:00
| output.html
2020-11-20 18:07:38 +01:00
: HTML output template
The scope of templates can be limited by placing them in subdirectories of the templates directory.
For example, the template templates/blog/page.gmi will apply to all pages in src/blog.
## FUNCTIONS
All templates have the following functions available to them:
[[ *Function*
:[ *Description*
| site
: Returns site metadata
## SITE METADATA
Site metadata contains the following information:
[[ *Variable*
:[ *Description*
| Title
: The title of the site, which can be specified in the site configuration.
2020-11-11 01:35:56 +01:00
## PAGE TEMPLATES
Page templates are provided with the following information:
2020-11-20 18:07:38 +01:00
[[ *Variable*
2020-11-11 01:35:56 +01:00
:[ *Description*
| Title
: The title of the page
| Date
: The date of the page
2020-11-20 18:07:38 +01:00
| Path
: Path to the page
2020-11-11 01:35:56 +01:00
| Content
: The contents of the page
Pages can specify dates in their filenames.
2020-11-20 18:07:38 +01:00
For example, src/2020-11-20-Hello-world.gmi will have a path of /Hello-world and a date of November 20, 2020.
2020-11-11 01:35:56 +01:00
2020-11-20 18:07:38 +01:00
Pages can specify a title in a top-level heading line.
The heading must be the first line in the page, and can optionally be followed by a blank line.
Both lines will be removed from the page content.
2020-11-11 01:35:56 +01:00
## INDEX TEMPLATES
Index templates are provided with the following information:
2020-11-20 18:07:38 +01:00
[[ *Variable*
2020-11-11 01:35:56 +01:00
:[ *Description*
| Title
: Title of the directory
| Content
: The contents of the directory index file
2020-11-20 18:07:38 +01:00
| Path
: Path to the directory
2020-11-11 01:35:56 +01:00
| Pages
: List of pages in this directory
2020-11-20 18:07:38 +01:00
| Dirs
2020-11-11 01:35:56 +01:00
: List of subdirectories
The title and content are taken from the index.gmi file in the directory.
If no index.gmi file exists, then the index template will not be rendered.
2020-11-20 18:07:38 +01:00
## FEED TEMPLATES
2020-11-11 01:35:56 +01:00
2020-11-20 18:07:38 +01:00
Feed templates are provided with the following information:
2020-11-11 01:35:56 +01:00
2020-11-20 18:07:38 +01:00
[[ *Variable*
:[ *Description*
| Title
: Title of the feed
| Path
: Path to the feed directory
| Entries
: List of feed entries
2020-11-11 01:35:56 +01:00
2020-11-20 18:07:38 +01:00
Feeds are written to the directory path plus "feed".
2020-11-11 01:35:56 +01:00
2020-11-20 18:07:38 +01:00
## HTML TEMPLATES
HTML output templates are provided with the following information:
[[ *Variable*
2020-11-11 01:35:56 +01:00
:[ *Description*
2020-11-20 18:07:38 +01:00
| Title
: Title of the page
| Content
: HTML contents of the page
2020-11-11 01:35:56 +01:00
# CONFIGURATION
kiln looks for a configuration file named "config.ini".
The configuration file uses the _ini_ format.
The following keys are supported:
2020-11-20 18:07:38 +01:00
[[ *Key*
2020-11-11 01:35:56 +01:00
:[ *Description*
| title
: Site title
2020-11-20 18:07:38 +01:00
The following sections are supported:
[[ *Section*
:[ *Description*
| feeds
: A list of feeds. Each key denotes a path to a directory, and each value
denotes the title of the feed.
2020-11-11 01:35:56 +01:00