Update documentation

This commit is contained in:
Adnan Maolood 2021-05-10 12:47:38 -04:00
parent 4e47940307
commit d7929490ed

View file

@ -167,14 +167,14 @@ The following keys are supported per task:
[[ *Key*
:[ *Description*
| input_ext
: Input file extension
| output_ext
| input
: Input file extensions
| output
: Output file extension
| template_ext
| template
: Template file extension
| preprocess
: Preprocess command
: Preprocess commands
| postprocess
: Postprocess command
| static_dir
@ -191,7 +191,7 @@ the output directory.
The template file extension specifies the extension of the templates that will
be used in the templates directory. If unset, no templates will be used.
The preprocess command specifies a command which will run before content is
The preprocess commands specify commands which will run before content is
passed to a template. It will be provided the content as standard input and
should write the processed content to standard output.
@ -214,17 +214,17 @@ command to convert Gemini text to HTML.
```
# Build the site
[tasks.gemini]
input_ext = ".gmi"
output_ext = ".gmi"
template_ext = ".gmi"
input = [".gmi"]
output = ".gmi"
template = ".gmi"
static_dir = "static"
output_dir = "public"
# Export an HTML version of the site
[tasks.exporthtml]
input_ext = ".gmi"
output_ext = ".html"
template_ext = ".gmi"
input = [".gmi"]
output = ".html"
template = ".gmi"
postprocess = "gmnitohtml"
static_dir = "static"
output_dir = "public.html"
@ -236,10 +236,10 @@ configuration makes use of the *markdown*(1) comand to convert Markdown to HTML.
```
[tasks.markdowntohtml]
input_ext = ".md"
input_ext = [".md"]
output_ext = ".html"
template_ext = ".html"
preprocess = "markdown"
preprocess.md = "markdown"
static_dir = "static"
output_dir = "public"
```
@ -252,10 +252,38 @@ Templates have certain data and functions available to them.
All templates have the following functions available to them:
[[ *Function*
:[ *Description*
| site
: Returns site metadata
*site*
Returns site metadata
*path.Base* _path_
Returns the last element of path.
*path.Clean* _path_
Returns the shortest path name equivalent to path.
*path.Dir* _path_
Returns all but the last element of path, typically the path's directory.
*path.Ext* _path_
Returns the filename extension used by path.
*path.Join* _elem..._
Joins any number of path elements into a single path.
*safeHTML* _html_
Encapsulates a known safe HTML document fragment.
*safeHTMLAttr* _attr_
Encapsulates an HTML attribute from a trusted source.
*safeCSS* _css_
Encapsulates known safe CSS content.
*safeJS* _js_
Encapsulates a known safe JavaScript expression.
*safeURL* _url_
Encapsulates a known safe URL or URL substring.
## SITE METADATA