about summary refs log tree commit diff stats
path: root/cmd/build
diff options
context:
space:
mode:
authorAlan Pearce2024-04-24 18:36:39 +0200
committerAlan Pearce2024-04-24 18:36:39 +0200
commitb1d749290849dad602d2710ea9fd7833fca5e372 (patch)
tree894b0176dfc0ea39c336af77e7f90b9ad45d0491 /cmd/build
parentd1a3c7ba0d3aa1644d526d69b6c22f7d0b55028d (diff)
downloadwebsite-b1d749290849dad602d2710ea9fd7833fca5e372.tar.lz
website-b1d749290849dad602d2710ea9fd7833fca5e372.tar.zst
website-b1d749290849dad602d2710ea9fd7833fca5e372.zip
Set canonical links
Diffstat (limited to 'cmd/build')
-rw-r--r--cmd/build/template.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/cmd/build/template.go b/cmd/build/template.go
index 32f408f..4f7552c 100644
--- a/cmd/build/template.go
+++ b/cmd/build/template.go
@@ -122,6 +122,7 @@ func layout(filename string, config config.Config, pageTitle string, pageURL str
 	}
 	doc.Find("html").SetAttr("lang", config.DefaultLanguage)
 	doc.Find("head > link[rel=alternate]").SetAttr("title", config.Title)
+	doc.Find("head > link[rel=canonical]").SetAttr("href", pageURL)
 	doc.Find(".title").SetText(config.Title)
 	doc.Find("title").Add(".p-name").SetText(pageTitle)
 	doc.Find("head > style").SetHtml("\n" + string(css))