From bf01c80d0869d088c636ef5725fc76a102651f4d Mon Sep 17 00:00:00 2001 From: George Cushen Date: Fri, 29 Jun 2018 10:36:07 +0100 Subject: [PATCH] Link cookie consent "learn more" to privacy policy To enable, create `privacy.md` in `content/` and add your privacy policy. Close #537 --- exampleSite/content/privacy.md | 12 ++++++++++++ layouts/partials/cookie_consent.html | 5 +++-- 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 exampleSite/content/privacy.md diff --git a/exampleSite/content/privacy.md b/exampleSite/content/privacy.md new file mode 100644 index 00000000..4faa7e2a --- /dev/null +++ b/exampleSite/content/privacy.md @@ -0,0 +1,12 @@ ++++ +title = "Privacy Policy" + +date = 2018-06-28T00:00:00 +draft = false + +# [header] +# image = "" +# caption = "" ++++ + +... diff --git a/layouts/partials/cookie_consent.html b/layouts/partials/cookie_consent.html index 1dd0a2dc..333d3e49 100644 --- a/layouts/partials/cookie_consent.html +++ b/layouts/partials/cookie_consent.html @@ -19,8 +19,9 @@ "content": { "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" }} + "link": {{ i18n "cookie_learn" | default "Learn more" }}, + "href": {{ with .Site.GetPage "page" "privacy.md" }}{{ printf "%s" .Permalink }}{{ else }}"https://cookies.insites.com"{{ end }} } })}); -{{ end }} \ No newline at end of file +{{ end }}