Skip to content

Commit

Permalink
HD-22392 Added Osano cookie consent
Browse files Browse the repository at this point in the history
modified:   _resource/overrides/main.html
	modified:   docs/index.md
	new file:   docs/js/consent.js
	modified:   mkdocs-base.yml
  • Loading branch information
nastena1606 committed Feb 12, 2024
1 parent 7c62233 commit a990610
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion _resource/overrides/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
{# Import the theme's layout. #}
{% extends "base.html" %}


{% block scripts %}
<script src="https://cmp.osano.com/Azqe5vTyLOSbN3OuT/49ad85b5-0418-4794-ab81-7599dddd534c/osano.js"></script>
{{ super() }}
{% endblock %}

{% block extrahead %}
{{ super() }}
{% set title = config.site_name %}
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ Our comprehensive resources will help you overcome challenges, from everyday iss
</div>
</div>


[Change privacy settings](#__consent)

Check failure on line 53 in docs/index.md

View workflow job for this annotation

GitHub Actions / runner / vale

Link fragments should be valid

docs/index.md:53:1 MD051/link-fragments Link fragments should be valid [Context: "[Change privacy settings](#__consent)"] https://github.com/DavidAnson/markdownlint/blob/v0.28.2/doc/md051.md


6 changes: 6 additions & 0 deletions docs/js/consent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
var consent = __md_get("__consent")
if (consent && consent.custom) {
/* The user accepted the cookie */
} else {
/* The user rejected the cookie */
}
4 changes: 3 additions & 1 deletion mkdocs-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ extra_css:

extra_javascript:
- js/promptremover.js
- js/feedback.js
- js/consent.js
# - js/feedback.js

markdown_extensions:
abbr: {}
Expand Down Expand Up @@ -147,6 +148,7 @@ extra:
cookies:
analytics: Google Analytics
github: Github
custom: Osano
actions:
- manage
- accept
Expand Down

0 comments on commit a990610

Please sign in to comment.