-
Notifications
You must be signed in to change notification settings - Fork 818
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update intro text Update cookie consent Remove workflow from docs Hide announce banner Co-authored-by: Cathal McCabe <cathal.mccabe@xilinx.com>
- Loading branch information
1 parent
720ff2f
commit c54cd87
Showing
7 changed files
with
132 additions
and
69 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
title: PYNQ | ||
description: Python Productivity to AMD Adaptive Coompute platforms | ||
show_downloads: false | ||
google_analytics: G-MV1L2SX33L | ||
theme: jekyll-theme-cayman | ||
google_analytics: | ||
theme: jekyll-theme-cayman |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
// Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved. | ||
// SPDX-License-Identifier: MIT | ||
|
||
document.addEventListener('DOMContentLoaded', function () { | ||
// Check if the user has already given consent | ||
if (localStorage.getItem('cookieConsent')) { | ||
// Initialize Google Analytics if consent is already given | ||
initializeGoogleAnalytics(); | ||
}else{ | ||
// Show the cookie consent banner | ||
showCookieConsent(); | ||
} | ||
}); | ||
|
||
function showCookieConsent() { | ||
var cookieConsent = document.getElementById('cookie-consent'); | ||
|
||
// Display the cookie consent banner | ||
cookieConsent.style.display = 'block'; | ||
|
||
// Add event listener to the "Got it!" link | ||
document.getElementById('cookie-accept').addEventListener('click', function () { | ||
// Set a localStorage flag to remember user's consent | ||
localStorage.setItem('cookieConsent', true); | ||
|
||
// Hide the cookie consent banner | ||
cookieConsent.style.display = 'none'; | ||
|
||
// Add Google Analytics tracking code | ||
initializeGoogleAnalytics(); | ||
}); | ||
|
||
// Add event listener to the "Reject" link | ||
document.getElementById('cookie-reject').addEventListener('click', function () { | ||
// Set a localStorage flag to remember user's rejection | ||
localStorage.setItem('cookieRejected', true); | ||
|
||
// Hide the cookie consent banner | ||
cookieConsent.style.display = 'none'; | ||
}); | ||
} | ||
|
||
function initializeGoogleAnalytics() { | ||
//console.log("Add Google Analytics tracking code"); | ||
// Add Google Analytics tracking code | ||
(function (i, s, o, g, r, a, m) { | ||
i['GoogleAnalyticsObject'] = r; | ||
(i[r] = | ||
i[r] || | ||
function () { | ||
(i[r].q = i[r].q || []).push(arguments); | ||
}), | ||
(i[r].l = 1 * new Date()); | ||
(a = s.createElement(o)), (m = s.getElementsByTagName(o)[0]); | ||
a.async = 1; | ||
a.src = g; | ||
m.parentNode.insertBefore(a, m); | ||
})( | ||
window, | ||
document, | ||
'script', | ||
'https://www.googletagmanager.com/gtag/js?id=G-MV1L2SX33L', | ||
'gtag' | ||
); | ||
|
||
gtag('js', new Date()); | ||
gtag('config', 'G-MV1L2SX33L'); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters