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:
@@ -1,12 +1,16 @@
|
|||||||
{#-
|
{#-
|
||||||
This file was automatically generated - do not edit
|
This file was automatically generated - do not edit
|
||||||
-#}
|
-#}
|
||||||
{% set cookies = config.extra.consent.cookies %}
|
{% set cookies = config.extra.consent.cookies | d({}) %}
|
||||||
{% if config.extra.analytics and not cookies %}
|
{% if config.extra.analytics %}
|
||||||
{% set cookies = { "analytics": "Google Analytics" } %}
|
{% if "analytics" not in cookies %}
|
||||||
|
{% set _ = cookies.update({ "analytics": "Google Analytics" }) %}
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if "github.com" in config.repo_url and "github" not in cookies %}
|
{% if "github.com" in config.repo_url %}
|
||||||
{% set _ = cookies.update({ "github": "GitHub" }) %}
|
{% if "github" not in cookies %}
|
||||||
|
{% set _ = cookies.update({ "github": "GitHub" }) %}
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% set actions = config.extra.consent.actions %}
|
{% set actions = config.extra.consent.actions %}
|
||||||
{% if not actions %}
|
{% if not actions %}
|
||||||
|
|||||||
@@ -20,13 +20,17 @@
|
|||||||
IN THE SOFTWARE.
|
IN THE SOFTWARE.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!-- Determine cookies (default to analytics, if present) -->
|
<!-- Determine cookies -->
|
||||||
{% set cookies = config.extra.consent.cookies %}
|
{% set cookies = config.extra.consent.cookies | d({}) %}
|
||||||
{% if config.extra.analytics and not cookies %}
|
{% if config.extra.analytics %}
|
||||||
{% set cookies = { "analytics": "Google Analytics" } %}
|
{% if "analytics" not in cookies %}
|
||||||
|
{% set _ = cookies.update({ "analytics": "Google Analytics" }) %}
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if "github.com" in config.repo_url and "github" not in cookies %}
|
{% if "github.com" in config.repo_url %}
|
||||||
{% set _ = cookies.update({ "github": "GitHub" }) %}
|
{% if "github" not in cookies %}
|
||||||
|
{% set _ = cookies.update({ "github": "GitHub" }) %}
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<!-- Determine actions -->
|
<!-- Determine actions -->
|
||||||
|
|||||||
Reference in New Issue
Block a user