Revise description of privacy settings

This commit is contained in:
Joe Mooring 2025-01-25 10:01:54 -08:00 committed by GitHub
parent 152a92d80a
commit 92f03a3509
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 84 additions and 126 deletions

View File

@ -32,7 +32,7 @@ toc: true
: Reduce development time and cost by creating or importing packaged combinations of archetypes, assets, content, data, templates, translation tables, static files, or configuration settings. A module may serve as the basis for a new site, or to augment an existing site.
[Privacy]
: Configure the behavior of Hugo's embedded templates and shortcodes to facilitate compliance with regional privacy regulations, including the [GDPR] and [CCPA].
: Configure your site to help comply with regional privacy regulations.
[Security]
: Hugo's security model is based on the premise that template and configuration authors are trusted, but content authors are not. This model enables generation of HTML output safe against code injection. Other protections prevent "shelling out" to arbitrary applications, limit access to specific environment variables, prevent connections to arbitrary remote data sources, and more.
@ -105,35 +105,37 @@ toc: true
[Minification]
: Minify HTML, CSS, and JavaScript to reduce file size, bandwidth consumption, and loading times.
[CCPA]: https://en.wikipedia.org/wiki/California_Consumer_Privacy_Act
[Sass processing]: /functions/css/Sass/
[Caching]: /functions/partials/includecached/
[CommonMark]: https://spec.commonmark.org/current/
[Content adapters]: /content-management/content-adapters/
[Content formats]: /content-management/formats/
[Data]: /content-management/data-sources/
[Diagrams]: /content-management/diagrams/
[GDPR]: https://en.wikipedia.org/wiki/General_Data_Protection_Regulation
[GitHub Flavored Markdown]: https://github.github.com/gfm/
[Image processing]: /content-management/image-processing/
[JavaScript bundling]: /functions/js/build/
[Markdown attributes]: /content-management/markdown-attributes/
[Markdown extensions]: /getting-started/configuration-markup/#goldmark-extensions
[Markdown render hooks]: /render-hooks/introduction/
[Mathematics]: /content-management/mathematics/
[Menus]: /content-management/menus/
[Minification]: /getting-started/configuration/#configure-minify
[Modules]: /hugo-modules/
[Multilingual]: /content-management/multilingual/
[Multiplatform]: /installation/
[Output formats]: /templates/output-formats/
[Privacy]: /about/privacy/
[Security]: /about/security/
[Segmentation]: /getting-started/configuration/#configure-segments
[Shortcodes]: /content-management/shortcodes/
[Syntax highlighting]: /content-management/syntax-highlighting/
[Tailwind CSS processing]: /functions/css/tailwindcss/
[Taxonomies]: /content-management/taxonomies/
[Templates]: /templates/introduction/
[Themes]: https://themes.gohugo.io/
[Modules]: /hugo-modules/
[Privacy]: /about/privacy/
[Security]: /about/security/
[Content formats]: /content-management/formats/
[CommonMark]: https://spec.commonmark.org/current/
[GitHub Flavored Markdown]: https://github.github.com/gfm/
[Markdown attributes]: /content-management/markdown-attributes/
[Markdown extensions]: /getting-started/configuration-markup/#goldmark-extensions
[Markdown render hooks]: /render-hooks/introduction/
[Diagrams]: /content-management/diagrams/
[Mathematics]: /content-management/mathematics/
[Syntax highlighting]: /content-management/syntax-highlighting/
[Shortcodes]: /content-management/shortcodes/
[Content adapters]: /content-management/content-adapters/
[Taxonomies]: /content-management/taxonomies/
[Data]: /content-management/data-sources/
[Menus]: /content-management/menus/
[URL management]: /content-management/urls/
[Image processing]: /content-management/image-processing/
[JavaScript bundling]: /functions/js/build/
[Sass processing]: /functions/css/Sass/
[Tailwind CSS processing]: /functions/css/tailwindcss/
[Caching]: /functions/partials/includecached/
[Segmentation]: /getting-started/configuration/#configure-segments
[Minification]: /getting-started/configuration/#configure-minify

View File

@ -1,7 +1,7 @@
---
title: Privacy
linkTitle: Privacy
description: Configure your site to facilitate compliance with regional privacy regulations.
description: Configure your site to help comply with regional privacy regulations.
categories: [about]
keywords: ["GDPR", "Privacy", "Data Protection"]
menu:
@ -11,112 +11,42 @@ menu:
weight: 40
toc: true
aliases: [/gdpr/,/about/hugo-and-gdpr/]
toc: true
---
General Data Protection Regulation ([GDPR](https://en.wikipedia.org/wiki/General_Data_Protection_Regulation)) is a regulation in EU law on data protection and privacy for all individuals within the European Union and the European Economic Area. It became enforceable on 25 May 2018.
## Responsibility
**Hugo is a static site generator. By using Hugo you are already standing on very solid ground. Static HTML files on disk are much easier to reason about compared to server and database driven websites.**
Site authors are responsible for ensuring compliance with regional privacy regulations, including but not limited to:
But even static websites can integrate with external services, so from version `0.41`, Hugo provides a **privacy configuration** that covers the relevant built-in templates.
- GDPR (General Data Protection Regulation): Applies to individuals within the European Union and the European Economic Area.
- CCPA (California Consumer Privacy Act): Applies to California residents.
- CPRA (California Privacy Rights Act): Expands upon the CCPA with stronger consumer privacy protections.
- Virginia Consumer Data Protection Act (CDPA): Applies to businesses that collect, process, or sell the personal data of Virginia residents.
Note that:
Hugo's privacy settings can assist in compliance efforts.
* These settings have their defaults setting set to _off_, i.e. how it worked before Hugo `0.41`. You must do your own evaluation of your site and apply the appropriate settings.
* These settings work with the [embedded templates](/templates/embedded/). Some theme may contain custom templates for embedding services like Google Analytics. In that case these options have no effect.
* We will continue this work and improve this further in future Hugo versions.
## Embedded templates
## All privacy settings
Hugo provides [embedded templates](g) to simplify site and content creation. Some of these templates interact with external services. For example, the `youtube` shortcode connects with YouTube's servers to embed videos on your site.
Below are all privacy settings and their default value. These settings need to be put in your site configuration (e.g. `hugo.toml`).
Some of these templates include settings to enhance privacy.
{{< code-toggle file=hugo >}}
[privacy]
[privacy.disqus]
disable = false
[privacy.googleAnalytics]
disable = false
respectDoNotTrack = false
[privacy.instagram]
disable = false
simple = false
[privacy.vimeo]
disable = false
enableDNT = false
simple = false
[privacy.x]
disable = false
enableDNT = false
simple = false
[privacy.youtube]
disable = false
privacyEnhanced = false
{{< /code-toggle >}}
## Disable all services
## Configuration
An example privacy configuration that disables all the relevant services in Hugo. With this configuration, the other settings will not matter.
{{% note %}}
These settings affect the behavior of some of Hugo's embedded templates. These settings may or may not affect the behavior of templates provided by third parties in their modules or themes.
{{% /note %}}
{{< code-toggle file=hugo >}}
[privacy]
[privacy.disqus]
disable = true
[privacy.googleAnalytics]
disable = true
[privacy.instagram]
disable = true
[privacy.vimeo]
disable = true
[privacy.x]
disable = true
[privacy.youtube]
disable = true
{{< /code-toggle >}}
These are the default privacy settings for Hugo's embedded templates:
## The privacy settings explained
{{< code-toggle config=privacy />}}
### GoogleAnalytics
See each template's documentation for a description of its privacy settings:
respectDoNotTrack
: Enabling this will make the GA templates respect the "Do Not Track" HTTP header.
### Instagram
simple
: If simple mode is enabled, a static and no-JS version of the Instagram image card will be built. Note that this only supports image cards and the image itself will be fetched from Instagram's servers.
**Note:** If you use the _simple mode_ for Instagram and a site styled with Bootstrap 4, you may want to disable the inline styles provided by Hugo:
{{< code-toggle file=hugo >}}
[services]
[services.instagram]
disableInlineCSS = true
{{< /code-toggle >}}
### X
enableDNT
: Enabling this for the x shortcode, the post and its embedded page on your site are not used for purposes that include personalized suggestions and personalized ads.
simple
: If simple mode is enabled, a static and no-JS version of a post will be built.
**Note:** If you use the _simple mode_ for X, you may want to disable the inline styles provided by Hugo:
{{< code-toggle file=hugo >}}
[services]
[services.x]
disableInlineCSS = true
{{< /code-toggle >}}
### YouTube
privacyEnhanced
: When you turn on privacy-enhanced mode, YouTube wont store information about visitors on your website unless the user plays the embedded video.
### Vimeo
enableDNT
: Enabling this for the vimeo shortcode, the Vimeo player will be blocked from tracking any session data, including all cookies and stats.
simple
: If simple mode is enabled, the video thumbnail is fetched from Vimeo's servers and it is overlaid with a play button. If the user clicks to play the video, it will open in a new tab directly on Vimeo's website.
- [Disqus partial](/templates/embedded/#privacy-disqus)
- [Google Analytics partial](/templates/embedded/#privacy-google-analytics)
- [Instagram shortcode](/shortcodes/instagram/#privacy)
- [Vimeo shortcode](/shortcodes/vimeo/#privacy)
- [X shortcode](/shortcodes/x/#privacy)
- [YouTube shortcode](/shortcodes/youtube/#privacy)

View File

@ -0,0 +1,5 @@
---
title: embedded template
---
An _embedded template_ is a built-in component within the Hugo application. This includes features like [partials](g), [shortcodes](g), and [render hooks](g) that provide pre-defined structures or functionalities for creating website content.

View File

@ -34,7 +34,7 @@ To include the embedded template:
{{ template "_internal/disqus.html" . }}
```
### Configure Disqus
### Configuration {#configuration-disqus}
To use Hugo's Disqus template, first set up a single configuration value:
@ -55,6 +55,15 @@ You can also set the following in the front matter for a given piece of content:
- `disqus_title`
- `disqus_url`
### Privacy {#privacy-disqus}
Adjust the relevant privacy settings in your site configuration.
{{< code-toggle config=privacy.disqus />}}
disable
: (`bool`) Whether to disable the template. Default is `false`.
## Google Analytics
{{% note %}}
@ -76,7 +85,7 @@ To include the embedded template:
{{ template "_internal/google_analytics.html" . }}
```
### Configure Google Analytics
### Configuration {#configuration-google-analytics}
Provide your tracking ID in your configuration file:
@ -87,6 +96,18 @@ id = "G-MEASUREMENT_ID"
To use this value in your own template, access the configured ID with `{{ site.Config.Services.GoogleAnalytics.ID }}`.
### Privacy {#privacy-google-analytics}
Adjust the relevant privacy settings in your site configuration.
{{< code-toggle config=privacy.googleAnalytics />}}
disable
: (`bool`) Whether to disable the template. Default is `false`.
respectDoNotTrack
: (`bool`) Whether to respect the brower's "do not track" setting. Default is `false`.
## Open Graph
{{% note %}}
@ -107,7 +128,7 @@ To include the embedded template:
{{ template "_internal/opengraph.html" . }}
```
### Configure Open Graph
### Configuration {#configuration-open-graph}
Hugo's Open Graph template is configured using a mix of configuration settings and [front matter](/content-management/front-matter/) on individual pages.
@ -187,7 +208,7 @@ To include the embedded template:
{{ template "_internal/twitter_cards.html" . }}
```
### Configure X (Twitter) Cards
### Configuration {#configuration-x-cards}
Hugo's X (Twitter) Card template is configured using a mix of configuration settings and [front-matter](/content-management/front-matter/) values on individual pages.