If you like my work, please consider supporting its development.

Midnight currently supports two methods of including privacy policies (and other website policy documents) as links in the footer of the site.

Custom Files

The first method is to create the documents privacy-policy, cookie-policy, and/or terms-of-use in the root of the content directory (i.e. content/privacy-policy/index.md or content/privacy-policy.md). They will be detected and have links in the footer.

Iubenda Integration

The second is an integration with Iubenda, a service that allows users to select how they collect user information - comment systems, analytics, forms, etc. - and generates a privacy policy that can be viewed at the click of a button. A free account with Iubenda does not allow for modification of this button, however, aside from whether it is white or black.

Base Iubenda configuration

To use the Iubenda integration, set id - and, optionally, others - under params.iubenda in the site's configuration file.

Option NameDescription

The special identification number for your website. To get it, log in to Iubenda and go to the “Integration” tab for the policy you want to include. In the embedding code under “Integrate the policy”, there will be a bit of code looking something like <a href="//www.iubenda.com/privacy-policy/1234567" - the numbers after “//www.iubenda.com/privacy-policy/” are the id.


Whether the privacy policy button should be "black" or "white" - these are the only two valid values. Leaving color blank will cause Midnight to try to determine which button will look best against the footer background.


Whether, upon clicking the button, the user should see the full legalese of the policy (true) or first see a friendly summary of the policy's contents (false).


Enable the cookie policy button in the footer, alongside the privacy policy button. Defaults to false because the option must be enabled on the Iubenda dashboard first.

    id = "1234567"
    color = "black"
    legal_only = true
        id: 1234567
        color: black
        legal_only: true
    "params": {
        "iubenda": {
            "id": "1234567",
            "color": "black",
            "legal_only": true

Configuration for Iubenda Pro Accounts

These options are only for Iubenda Pro users and will not work with a free account! The enable_pro parameter must be set to true to be able to use any of these Pro features. Pro features also require the above id parameter to be set.

Option NameDescription

Must be set to true to enable Iubenda's Pro features - you must also have a Pro account to use the below features! Attempts to do so with a free account will lead to errors.


Enable the cookie policy banner, which will disappear when the user scrolls or dismisses the banner.


Iubenda stores separate IDs for a site's privacy policy and its cookie banner. This is the id for the cookie banner. See below for how to find this ID.


Disable the Iubenda button in the footer, e.g. if you are using the below shortcode on a dedicated privacy policy page.


Recommended: Set to true to require user consent before loading JavaScript files that track users.


Remove Iubenda branding from the policy buttons and related dialog windows.


Remove all styles from the Iubenda policy buttons. The buttons will look like normal links but will still open the policy window on the page.

  enable_pro = true
  enable_cookie_banner = true
  site_id = "908104"
  disable_footer_link = true
  prior_consent = true
        # The stuff in the previous example
            enable_pro: true
            enable_cookie_banner: true
            site_id: 908104
            disable_footer_link: true
            prior_consent: true
    "params": {
        "iubenda": {
            "pro": {
                "enable_pro": true,
                "enable_cookie_banner": true,
                "site_id": "908104",
                "disable_footer_link": true,
                "prior_consent": true

Iubenda Pro accounts have access to a feature that displays a cookie consent banner when someone first visits the site. To enable this feature, set enable_cookie_policy to true and site_id to the site ID displayed in the consent banner embed code.

The &lsquo;siteId&rsquo; parameter corresponds with BluestNight's &lsquo;site_id&rsquo;, while &lsquo;cookiePolicyId&rsquo; corrsponds with BluestNight's &lsquo;id&rsquo; parameter.

Consent Banner Embed Code

The ‘siteId’ parameter corresponds with BluestNight's ‘site_id’, while ‘cookiePolicyId’ corrsponds with BluestNight's ‘id’ parameter.

Iubenda Pro offers the ability to prevent tracking scripts from loading until the user accepts the cookie policy, free up to 25,000 monthly page views. It also, however, offers a “light” cookie solution that does not prevent tracking scripts from loading and is always free. Note that Iubenda warns that prior consent - blocking tracking until the user consents - is required by “most EU legislations” and thus the “full” solution is recommended.

To choose between the two solutions, change the prior_consent parameter. A value of true enables the “full” solution and false enables the “light” version.

Iubenda Shortcode

Pro accounts also have the ability to access the privacy and cookie policies over a JSON api endpoint. What this means for BluestNight users is that Hugo can download the contents of the privacy policy once while building the site, rather than loading the text using JavaScript every time the page is loaded.

The recommended way to do this is to create the privacy-policy.md or cookie-policy.md file in the root of your content directory and use the shortcode in place of any page content. If your site's configuration file is set up correctly, the following should be enough to create your policy page.

title = "Privacy Policy"

{{< iubenda >}}

To fetch the cookie policy instead, pass the string “cookie” as an argument to the shortcode, like so:

title = "Cookie Policy"

{{< iubenda "cookie" >}}