From c22d653c43149f911101ea3d2bb0fb30853e355e Mon Sep 17 00:00:00 2001 From: George Cushen Date: Sat, 21 Apr 2018 12:07:57 +0100 Subject: [PATCH] Add Privacy Pack - To enable, set `privacy_pack = true` in `config.toml` - Show a cookie consent message to visitors - Anonymize IP in Google Analytics (if enabled) See #507 --- exampleSite/config.toml | 5 +++++ i18n/en.yaml | 11 +++++++++++ layouts/partials/cookie_consent.html | 22 ++++++++++++++++++++++ layouts/partials/header.html | 2 ++ 4 files changed, 40 insertions(+) create mode 100644 layouts/partials/cookie_consent.html diff --git a/exampleSite/config.toml b/exampleSite/config.toml index e2ff5a70..0bd45bb5 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -151,6 +151,11 @@ defaultContentLanguageInSubdir = false # Enable native social sharing buttons? sharing = true + # Privacy pack + # Show a cookie consent message to visitors + # Anonymize IP in Google Analytics (if enabled) + privacy_pack = false + # Link custom CSS and JS assets # (relative to /static/css and /static/js respectively) custom_css = [] diff --git a/i18n/en.yaml b/i18n/en.yaml index 59aeafe8..eaddb05b 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -147,3 +147,14 @@ - id: 404_recommendations translation: Perhaps you were looking for one of these? + +# Cookie consent + +- id: cookie_message + translation: This website uses cookies to ensure you get the best experience on our website. + +- id: cookie_dismiss + translation: Got it! + +- id: cookie_learn + translation: Learn more diff --git a/layouts/partials/cookie_consent.html b/layouts/partials/cookie_consent.html new file mode 100644 index 00000000..71bac06b --- /dev/null +++ b/layouts/partials/cookie_consent.html @@ -0,0 +1,22 @@ +{{ if .Site.Params.privacy_pack }} + + + +{{ end }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 9aec6947..70593290 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -81,6 +81,7 @@