docs: Document permalinks

This commit is contained in:
Adnan Maolood 2021-05-14 00:28:41 -04:00
parent 8a9cff4c2e
commit 89ee78c678

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.