summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorNicolas Paul <n@nc0.fr>2023-05-01 13:03:03 +0200
committerNicolas Paul <n@nc0.fr>2023-05-01 13:03:03 +0200
commitf57c0d15c931563a55abdc9cea72d189a24f7456 (patch)
tree97a7cd740da179b0a2f160a92bf2ec9da9ed6cd9 /doc
parent314db62804a5696aa81ebf0a680cc8f9e2e46ede (diff)
Add slug to HTML templates
Diffstat (limited to 'doc')
-rw-r--r--doc/src/doc/template.md2
1 files changed, 2 insertions, 0 deletions
diff --git a/doc/src/doc/template.md b/doc/src/doc/template.md
index bf0e387..ab209b9 100644
--- a/doc/src/doc/template.md
+++ b/doc/src/doc/template.md
@@ -41,6 +41,7 @@ The following variables are available:
- `.Content`: The content of the document, as HTML.
- `.Site`: The URL of the site.
- `.Generator`: A string containing the name and version of the generator.
+- `.Slug`: The slug of the document.
> **Note:** The `.Content` variable is already HTML, so it does not need to be
> escaped.
@@ -58,6 +59,7 @@ Here is a sample template:
<meta name="author" content="{{ .Author }}">
<meta name="generator" content="{{ .Generator }}">
<meta name="viewport" content="width=device-width, initial-scale=1">
+ <link href="{{ .Site }}{{ .Slug }}.html" rel="canonical">
</head>
<body>
<header>