2020-11-11 00:35:56 +00:00
|
|
|
kiln(1)
|
|
|
|
|
|
|
|
# NAME
|
|
|
|
|
2021-04-12 04:23:27 +00:00
|
|
|
kiln - a simple static site generator
|
2020-11-11 00:35:56 +00:00
|
|
|
|
|
|
|
# SYNOPSIS
|
|
|
|
|
2021-04-12 04:23:27 +00:00
|
|
|
_kiln_ [-c <config>] [-t <task>]
|
2020-11-20 17:07:38 +00:00
|
|
|
|
|
|
|
# OPTIONS
|
|
|
|
|
2021-04-12 04:23:27 +00:00
|
|
|
\-c <config>
|
|
|
|
Specifies the configuration file to use. Defaults to "config.toml".
|
2020-11-11 00:35:56 +00:00
|
|
|
|
2021-04-12 04:23:27 +00:00
|
|
|
\-t <task>
|
|
|
|
Specifies the task to run. Defaults to "all", which runs all tasks.
|
2020-11-11 00:35:56 +00:00
|
|
|
|
2021-04-12 04:23:27 +00:00
|
|
|
# OVERVIEW
|
|
|
|
|
|
|
|
A kiln site is built in one or more steps called _tasks_.
|
|
|
|
|
|
|
|
There is only one default task called "gemini" which builds a Gemini site.
|
|
|
|
|
|
|
|
The following directories are used by default:
|
2020-11-11 00:35:56 +00:00
|
|
|
|
2020-11-20 17:07:38 +00:00
|
|
|
[[ *Directory*
|
2020-11-11 00:35:56 +00:00
|
|
|
:[ *Description*
|
2021-02-28 17:17:10 +00:00
|
|
|
| content/
|
2021-04-12 04:23:27 +00:00
|
|
|
: Content directory
|
|
|
|
| static/
|
|
|
|
: Static content directory
|
2021-03-20 06:18:15 +00:00
|
|
|
| templates/
|
2021-04-12 04:23:27 +00:00
|
|
|
: Template directory
|
2021-02-28 17:17:10 +00:00
|
|
|
| public/
|
2021-04-12 04:23:27 +00:00
|
|
|
: Output directory
|
|
|
|
|
|
|
|
Tasks can be configured to use different static content and output directories.
|
|
|
|
The content and template directories are shared between tasks.
|
|
|
|
|
|
|
|
# CONFIGURATION
|
2020-11-11 00:35:56 +00:00
|
|
|
|
2021-04-12 04:23:27 +00:00
|
|
|
The configuration file uses the _TOML_ configuration file format. For more
|
|
|
|
information on TOML, see https://toml.io/en/v0.4.0.
|
2020-11-22 20:51:07 +00:00
|
|
|
|
2021-04-12 04:23:27 +00:00
|
|
|
The following keys are supported:
|
|
|
|
|
|
|
|
[[ *Key*
|
|
|
|
:[ *Description*
|
|
|
|
| title
|
|
|
|
: Site title
|
|
|
|
| urls
|
|
|
|
: A list of site URLs
|
2020-11-11 00:35:56 +00:00
|
|
|
|
2021-04-12 04:23:27 +00:00
|
|
|
Site URLs may contain paths, but should not end with a trailing slash. Multiple
|
|
|
|
site URLs may be specified for sites that are available at multiple locations.
|
|
|
|
|
|
|
|
## CONTENT DIRECTORY
|
|
|
|
|
|
|
|
The content directory contains content that should be processed before
|
|
|
|
being published. Any file or directory whose name begins with "\_" will be
|
|
|
|
ignored.
|
|
|
|
|
|
|
|
Files in the content directory may be preprocessed, run through templates, and
|
|
|
|
postprocessed (in that order). Each operation takes the output of the last
|
|
|
|
operation as input.
|
|
|
|
|
|
|
|
## STATIC CONTENT DIRECTORY
|
|
|
|
|
|
|
|
All files in the static content directory will be copied to the output
|
|
|
|
directory without modification. Static assets like images should be stored in
|
|
|
|
this directory.
|
|
|
|
|
|
|
|
## TEMPLATE DIRECTORY
|
|
|
|
|
|
|
|
The template directory contains templates for use when building the site.
|
|
|
|
Templates use the Go templating language. The following templates are supported:
|
2020-11-11 00:35:56 +00:00
|
|
|
|
2020-11-20 17:07:38 +00:00
|
|
|
[[ *Template*
|
2020-11-11 00:35:56 +00:00
|
|
|
:[ *Description*
|
|
|
|
| page.gmi
|
|
|
|
: Page template
|
|
|
|
| index.gmi
|
|
|
|
: Directory index template
|
2020-11-22 20:51:07 +00:00
|
|
|
| atom.xml
|
|
|
|
: Atom feed template
|
2020-11-20 17:07:38 +00:00
|
|
|
|
2021-04-12 04:23:27 +00:00
|
|
|
The scope of a template is limited to the directory it is placed in. For
|
|
|
|
example, the template templates/blog/page.gmi will only apply to pages in
|
|
|
|
content/blog.
|
|
|
|
|
|
|
|
kiln has default templates built-in. To override the default templates, put
|
|
|
|
templates in the templates/\_default directory. These templates will apply to
|
|
|
|
any directory which does not have its own templates specified.
|
2020-11-22 20:51:07 +00:00
|
|
|
|
2021-04-12 04:23:27 +00:00
|
|
|
For more information on the Go templating language, see
|
|
|
|
https://golang.org/pkg/text/template/.
|
2020-11-20 17:07:38 +00:00
|
|
|
|
|
|
|
## FUNCTIONS
|
|
|
|
|
|
|
|
All templates have the following functions available to them:
|
|
|
|
|
|
|
|
[[ *Function*
|
|
|
|
:[ *Description*
|
|
|
|
| site
|
|
|
|
: Returns site metadata
|
|
|
|
|
|
|
|
## SITE METADATA
|
|
|
|
|
2021-04-12 04:23:27 +00:00
|
|
|
Site metadata contains the following data:
|
2020-11-20 17:07:38 +00:00
|
|
|
|
|
|
|
[[ *Variable*
|
|
|
|
:[ *Description*
|
|
|
|
| Title
|
2020-11-22 20:51:07 +00:00
|
|
|
: The title of the site.
|
2020-12-21 21:41:05 +00:00
|
|
|
| URLs
|
|
|
|
: The URLs of the site.
|
2020-11-22 20:51:07 +00:00
|
|
|
|
|
|
|
To configure these variables, see *CONFIGURATION*.
|
2020-11-11 00:35:56 +00:00
|
|
|
|
|
|
|
## PAGE TEMPLATES
|
|
|
|
|
2021-04-12 04:23:27 +00:00
|
|
|
Page templates are provided with the following data:
|
2020-11-11 00:35:56 +00:00
|
|
|
|
2020-11-20 17:07:38 +00:00
|
|
|
[[ *Variable*
|
2020-11-11 00:35:56 +00:00
|
|
|
:[ *Description*
|
|
|
|
| Title
|
|
|
|
: The title of the page
|
|
|
|
| Date
|
|
|
|
: The date of the page
|
2020-11-20 17:07:38 +00:00
|
|
|
| Path
|
|
|
|
: Path to the page
|
2020-11-11 00:35:56 +00:00
|
|
|
| Content
|
|
|
|
: The contents of the page
|
|
|
|
|
2021-04-12 04:23:27 +00:00
|
|
|
Pages can specify dates in their filenames. For example, the file
|
|
|
|
content/2020-11-20-Hello-world.gmi will have a path of /Hello-world/ and a date
|
|
|
|
of November 20, 2020.
|
2020-11-11 00:35:56 +00:00
|
|
|
|
2021-04-12 04:23:27 +00: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 00:35:56 +00:00
|
|
|
|
|
|
|
## INDEX TEMPLATES
|
|
|
|
|
2021-04-12 04:23:27 +00:00
|
|
|
Index templates are provided with the following data:
|
2020-11-11 00:35:56 +00:00
|
|
|
|
2020-11-20 17:07:38 +00:00
|
|
|
[[ *Variable*
|
2020-11-11 00:35:56 +00:00
|
|
|
:[ *Description*
|
2020-11-20 20:03:41 +00:00
|
|
|
| Title
|
|
|
|
: Title of the directory
|
|
|
|
| Content
|
|
|
|
: The contents of the directory index file
|
2020-11-20 17:07:38 +00:00
|
|
|
| Path
|
|
|
|
: Path to the directory
|
2020-11-11 00:35:56 +00:00
|
|
|
| Pages
|
|
|
|
: List of pages in this directory
|
2020-11-20 17:07:38 +00:00
|
|
|
| Dirs
|
2020-11-11 00:35:56 +00:00
|
|
|
: List of subdirectories
|
|
|
|
|
2021-04-12 04:23:27 +00:00
|
|
|
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.
|
|
|
|
|
|
|
|
The default index template implements the lightweight subscription specification
|
|
|
|
found at gemini://gemini.circumlunar.space/docs/companion/subscription.gmi.
|
2020-11-20 20:03:41 +00:00
|
|
|
|
2021-04-12 04:23:27 +00:00
|
|
|
## FEEDS
|
|
|
|
|
|
|
|
Feeds can optionally be specified in the *feeds* table of the configuration file.
|
|
|
|
Keys denote the path to the feed input directory and values denote the title of
|
|
|
|
the feed.
|
|
|
|
|
|
|
|
Feeds are written to the directory path plus "atom.xml".
|
2020-11-22 20:51:07 +00:00
|
|
|
|
2020-11-20 17:07:38 +00:00
|
|
|
## FEED TEMPLATES
|
2020-11-11 00:35:56 +00:00
|
|
|
|
2021-04-12 04:23:27 +00:00
|
|
|
Feed templates are provided with the following data:
|
2020-11-11 00:35:56 +00:00
|
|
|
|
2020-11-20 17:07:38 +00:00
|
|
|
[[ *Variable*
|
|
|
|
:[ *Description*
|
|
|
|
| Title
|
|
|
|
: Title of the feed
|
|
|
|
| Path
|
|
|
|
: Path to the feed directory
|
|
|
|
| Entries
|
2020-11-22 20:51:07 +00:00
|
|
|
: List of pages in this feed
|
2020-11-11 00:35:56 +00:00
|
|
|
|
2021-04-12 04:23:27 +00:00
|
|
|
The default feed template uses the site URLs, if any, to turn relative links
|
|
|
|
into absolute URLs.
|