From cab08f29df1ebcc6aea9fc113e07037373aa3f6c Mon Sep 17 00:00:00 2001 From: Ihor Aleksandrychiev Date: Thu, 25 Jan 2024 15:17:56 +0200 Subject: [PATCH 1/2] Revert "Set base url config" This reverts commit f4f9ec3ef4ac6035479a9a8828df1e72bdfd99ea. --- config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.toml b/config.toml index f3c53cb..0dfeb05 100644 --- a/config.toml +++ b/config.toml @@ -1,4 +1,4 @@ -baseurl = "https://build.cfengine.com/" +baseurl = "/" languageCode = "en" title = "CFEngine Build" theme = "cfbs-theme" From 41816124de5cbd66f397df31cb2a63a2cf021ac7 Mon Sep 17 00:00:00 2001 From: Ihor Aleksandrychiev Date: Thu, 25 Jan 2024 15:19:42 +0200 Subject: [PATCH 2/2] Fixed sitemap using relative urls Signed-off-by: Ihor Aleksandrychiev --- config.toml | 3 +++ layouts/sitemap.xml | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 layouts/sitemap.xml diff --git a/config.toml b/config.toml index 0dfeb05..772377d 100644 --- a/config.toml +++ b/config.toml @@ -17,3 +17,6 @@ modules = ['packages-allowlist-snapshot', 'delete-files', 'promise-type-docker-c [taxonomies] tag = "tags" author = "author" + +[params.sitemap] +baseUrl = "https://build.cfengine.com" diff --git a/layouts/sitemap.xml b/layouts/sitemap.xml new file mode 100644 index 0000000..c8b006d --- /dev/null +++ b/layouts/sitemap.xml @@ -0,0 +1,24 @@ +{{ printf "" | safeHTML }} + + {{ range .Data.Pages }} + {{- if .Permalink -}} + + {{ .Site.Params.Sitemap.BaseUrl }}{{ .Permalink }}{{ if not .Lastmod.IsZero }} + {{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}{{ end }}{{ with .Sitemap.ChangeFreq }} + {{ . }}{{ end }}{{ if ge .Sitemap.Priority 0.0 }} + {{ .Sitemap.Priority }}{{ end }}{{ if .IsTranslated }}{{ range .Translations }} + {{ end }} + {{ end }} + + {{- end -}} + {{ end }} +