From d3617237bbb2d852d4e64e1a7e08bceb4302ee18 Mon Sep 17 00:00:00 2001 From: Frank Tegtmeyer Date: Thu, 3 Nov 2016 10:05:00 +0100 Subject: [PATCH] Optional use of cookie consent. Setting the url in the configuration enables cookie consent. --- exampleSite/config.toml | 7 ++++++ exampleSite/content/info/cookieinformation.md | 22 +++++++++++++++++++ layouts/_default/baseof.html | 8 +++++-- 3 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 exampleSite/content/info/cookieinformation.md diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 0bad3bb..4122a4e 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -43,6 +43,13 @@ paginate = 5 # verification string for Yandex Webmaster Tools #yandex_verify_meta = "66b077430f35f04a" + # Cookie consent (my be required for your site in the European Union) + # Set the "more info" URL in this parameter. You have to + # provide a document page for this URL - see the example website + # To avoid a menu entry for this information page add it to + # conten/info instead of content/page or content. + # cookie_consent_info_url = "/cookie-information/" + [params.sidebar] # Optional about block for sidebar (can be Markdown) about = "A simple Hugo theme based on the [Bootstrap v4 blog example](http://v4-alpha.getbootstrap.com/examples/blog/)." diff --git a/exampleSite/content/info/cookieinformation.md b/exampleSite/content/info/cookieinformation.md new file mode 100644 index 0000000..a09e0d0 --- /dev/null +++ b/exampleSite/content/info/cookieinformation.md @@ -0,0 +1,22 @@ ++++ +date = "2014-11-20T13:49:43+01:00" +title = "Cookie information" +draft = false +description = "Information about use of cookies on this site." +url = "/cookie-information/" + ++++ + +This site uses cookies - small text files that are placed on your machine. + +To be able to optimize the site and to measure it's success +the site uses third party cookies by Google Analytics. + +You may prefer to disable cookies on this site and on others. +The most effective way to do this is to disable cookies in your browser. +I suggest consulting the Help section of your browser or taking a +look at the About Cookies website +which offers guidance for all modern browsers. + +Google also provides a browser plugin which disables tracking through +Google Analytics. diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index cdd77d0..81494aa 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -16,7 +16,11 @@ {{ template "_internal/google_analytics_async.html" . }} - + + {{ if .Site.Params.cookie_consent_info_url }} + {{ partial "cookie_consent.html" . }} + {{ end }} + @@ -24,7 +28,7 @@