mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-13 18:15:09 +00:00
fix: use absolute path in cookie_consent.html (#2804)
Adding `site.GetPage /privacy.md` to reflect the absolute path to `privacy.md`, as per the Hugo documentation for GetPage. This should force Hugo to only link to a `/privacy.md` page at the root of the site and prevent Hugo searching for unrelated pages with `privacy` in the name (as it currently does, if for example you also have a /tags/privacy/ page). Note that currently there's a Hugo bug where Hugo does not respect absolute paths in `site.GetPage`. Hence, Hugo can still return other unrelated pages (for example any other pages that have `privacy....` in the filename) until this bug is fixed: https://github.com/gohugoio/hugo/issues/10243
This commit is contained in:
1 parent
71f51091fb
commit
c85924ba3e
1 file changed
+1
-1
@@ -24,7 +24,7 @@
|
||||
"message": {{ i18n "cookie_message" | default "This website uses cookies to ensure you get the best experience on our website." }},
|
||||
"dismiss": {{ i18n "cookie_dismiss" | default "Got it!" }},
|
||||
"link": {{ i18n "cookie_learn" | default "Learn more" }},
|
||||
"href": {{ with site.GetPage "privacy.md" }}{{ printf "%s" .RelPermalink }}{{ else }}"https://www.cookiesandyou.com"{{ end }}
|
||||
"href": {{ with site.GetPage "/privacy.md" }}{{ printf "%s" .RelPermalink }}{{ else }}"https://www.cookiesandyou.com"{{ end }}
|
||||
}
|
||||
})});
|
||||
</script>
|
||||
|
||||
Reference in new issue
Block a user