Skip to content

Commit

Permalink
cookie banner implementation for docsite (#30)
Browse files Browse the repository at this point in the history
* cookie banner implementation for docsite

* version check update

---------

Co-authored-by: Alonso Guevara <[email protected]>
  • Loading branch information
gaudyb and AlonsoGuevara authored Apr 3, 2024
1 parent 77f9dba commit a4bd4a2
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .yarn/versions/9d5536f9.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
releases:
"@graphrag/docsite": minor
2 changes: 1 addition & 1 deletion javascript/docsite/_includes/page.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ body{

header {
background-color: lightgrey;
height: 40px;
height: 2%;
padding: 10px;
}

Expand Down
24 changes: 24 additions & 0 deletions javascript/docsite/_includes/page.njk
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,33 @@ title: GraphRAG
<link href="https://unpkg.com/[email protected]/themes/prism-okaidia.css" rel="stylesheet">
<style>{{ css | safe }}</style>
{% mermaid_js %}

{% block js %}
<script src="https://wcpstatic.microsoft.com/mscc/lib/v2/wcp-consent.js" type="text/javascript"></script>
<script>
function onConsentChanged(categoryPreferences) {
console.log("onConsentChanged", categoryPreferences);
}
function initialize(){
var siteConsent
window.WcpConsent && WcpConsent.init("en-US", "cookie-banner", function (err, _siteConsent) {
if (!err) {
console.log("consentUpdated", _siteConsent)
siteConsent = _siteConsent; //siteConsent is used to get the current consent
} else {
console.log("Error initializing WcpConsent: "+ err);
}
}, onConsentChanged, WcpConsent.themes.light);
}
addEventListener("DOMContentLoaded", initialize)
</script>
{% endblock %}
</head>
<body>
<header>
<div id="cookie-banner"></div>
<a href="/"><span class="logotitle">GraphRAG</span></a>
</header>
<div class="page-content">
Expand Down

0 comments on commit a4bd4a2

Please sign in to comment.