mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fixed cookie consent when analytics was not set
This commit is contained in:
parent
1f0578849c
commit
c7deb06b79
@ -1,12 +1,16 @@
|
||||
{#-
|
||||
This file was automatically generated - do not edit
|
||||
-#}
|
||||
{% set cookies = config.extra.consent.cookies %}
|
||||
{% if config.extra.analytics and not cookies %}
|
||||
{% set cookies = { "analytics": "Google Analytics" } %}
|
||||
{% set cookies = config.extra.consent.cookies | d({}) %}
|
||||
{% if config.extra.analytics %}
|
||||
{% if "analytics" not in cookies %}
|
||||
{% set _ = cookies.update({ "analytics": "Google Analytics" }) %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if "github.com" in config.repo_url and "github" not in cookies %}
|
||||
{% set _ = cookies.update({ "github": "GitHub" }) %}
|
||||
{% if "github.com" in config.repo_url %}
|
||||
{% if "github" not in cookies %}
|
||||
{% set _ = cookies.update({ "github": "GitHub" }) %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% set actions = config.extra.consent.actions %}
|
||||
{% if not actions %}
|
||||
|
@ -20,13 +20,17 @@
|
||||
IN THE SOFTWARE.
|
||||
-->
|
||||
|
||||
<!-- Determine cookies (default to analytics, if present) -->
|
||||
{% set cookies = config.extra.consent.cookies %}
|
||||
{% if config.extra.analytics and not cookies %}
|
||||
{% set cookies = { "analytics": "Google Analytics" } %}
|
||||
<!-- Determine cookies -->
|
||||
{% set cookies = config.extra.consent.cookies | d({}) %}
|
||||
{% if config.extra.analytics %}
|
||||
{% if "analytics" not in cookies %}
|
||||
{% set _ = cookies.update({ "analytics": "Google Analytics" }) %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if "github.com" in config.repo_url and "github" not in cookies %}
|
||||
{% set _ = cookies.update({ "github": "GitHub" }) %}
|
||||
{% if "github.com" in config.repo_url %}
|
||||
{% if "github" not in cookies %}
|
||||
{% set _ = cookies.update({ "github": "GitHub" }) %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
<!-- Determine actions -->
|
||||
|
Loading…
Reference in New Issue
Block a user