docs: Document permalinks

This commit is contained in:
adnano 2021-05-14 00:28:41 -04:00
parent 0e54f9eec5
commit 758d821b3f

View file

@ -153,6 +153,26 @@ Example feed configuration:
"/blog/" = "My blog"
```
## PERMALINKS
Permalinks can be used to rewrite page paths. Permalinks are specified in the
[permalinks] table of the configuration file. Keys denote a path to a directory,
and values use the Go templating language to rewrite the final path of pages in
that directory. The templates have the same data that page templates have
available to them (see *PAGE TEMPLATES*).
The following configuration will rewrite the paths of pages in the content/blog
directory to /YYYY/MM/DD/slug. For example, the file
content/blog/2021-05-12-hello-world.gmi will have a path of
/2021/05/12/hello-world/.
```
[permalinks]
"/blog/" = "/{{ .Date.Format `2006/01/02` }}/{{ path.Base .Path }}"
```
For more information on templates, see *TEMPLATES*.
## TASKS
Tasks can be specified in the [tasks] table. Each task must have a unique name.