diff --git a/_vendor/github.com/linode/linode-docs-theme/assets/css/sections/content.css b/_vendor/github.com/linode/linode-docs-theme/assets/css/sections/content.css index a276aa7dd02..67da1ebaa24 100644 --- a/_vendor/github.com/linode/linode-docs-theme/assets/css/sections/content.css +++ b/_vendor/github.com/linode/linode-docs-theme/assets/css/sections/content.css @@ -84,7 +84,7 @@ Note that this is usually used in combination with Tailwind's Typography plugin } .content .file .chroma { - @apply rounded-b-md m-0; + @apply rounded-b-md m-0 py-1; } .content .file .chroma .lntable { diff --git a/_vendor/github.com/linode/linode-docs-theme/assets/js/main/components/index.js b/_vendor/github.com/linode/linode-docs-theme/assets/js/main/components/index.js index 9adf18c52dc..c7077d0c86b 100644 --- a/_vendor/github.com/linode/linode-docs-theme/assets/js/main/components/index.js +++ b/_vendor/github.com/linode/linode-docs-theme/assets/js/main/components/index.js @@ -1,6 +1,5 @@ export * from './disqus'; export * from './dropdowns'; export * from './svg'; -export * from './trustarc'; export * from './magic-helpers'; export * from './tabs'; diff --git a/_vendor/github.com/linode/linode-docs-theme/assets/js/main/components/trustarc.js b/_vendor/github.com/linode/linode-docs-theme/assets/js/main/components/trustarc.js deleted file mode 100644 index b99b847dbb8..00000000000 --- a/_vendor/github.com/linode/linode-docs-theme/assets/js/main/components/trustarc.js +++ /dev/null @@ -1,108 +0,0 @@ -import { getCookie } from '../helpers/helpers'; - -var debug = 0 ? console.log.bind(console, '[trustarc]') : function () {}; - -const cookieNamePrivacy = 'cmapi_cookie_privacy'; -const cookieNameNotice = 'notice_behavior'; - -export function initConsentManager(trustarcDomain, trustecm, callback) { - debug('initConsentManager for domain', trustarcDomain); - - // Check to see if any of the TrustArc cookies are already set. - if (getCookie(cookieNamePrivacy) || getCookie(cookieNameNotice)) { - debug('TrustArc cookieset'); - doInit(trustecm); - callback(); - } - - var apiObject = { - PrivacyManagerAPI: { - action: 'getConsentDecision', - timestamp: new Date().getTime(), - self: trustarcDomain, - }, - }; - - const onConsent = function (e) { - if (typeof e.data != 'string') { - return; - } - - let data; - try { - data = JSON.parse(e.data); - } catch (err) { - return; - } - - if (data.source == 'preference_manager' && data.message == 'submit_preferences') { - debug('TrustArc preference message received:', data.message, data.data); - doInit(trustecm, data.data); - callback(); - } else if (data.source == 'preference_manager') { - //debug('Unhandled TrustArc message received:', data.message, JSON.stringify(data)); - } - }; - - window.top.postMessage(JSON.stringify(apiObject), '*'); - window.addEventListener('message', onConsent, false); -} - -function doInit(trustecm, privacyCookie = '') { - // Assume that initConsentManager can be called multiple times and that the consent state may have changed. - // Start with a clean slate. - for (let bucket in trustecm) { - trustecm[bucket] = false; - } - - let buckets = { - required: 1, - performance: 2, - functional: 3, - targeting: 4, - social: 5, - }; - - if (privacyCookie) { - // The privacy settings fetched from the API are zero based. We need to convert them to 1 based, - // which is what's stored in the cookie. - let parts = privacyCookie.split(','); - for (let i = 0; i < parts.length; i++) { - parts[i] = parseInt(parts[i]) + 1; - } - privacyCookie = parts.join(','); - debug('received privacy settings from API', privacyCookie); - } else { - // If the user has expressed consent, then the cmapi_cookie_privacy cookie will be set, and we can check there to see if the user has allowed a particular bucket. - privacyCookie = getCookie(cookieNamePrivacy); - debug('read privacyCookie', privacyCookie); - } - - if (privacyCookie) { - for (let bucket in buckets) { - if (privacyCookie.indexOf(buckets[bucket]) > -1) { - trustecm[bucket] = true; - } - } - debug('trustecm', trustecm); - return; - } - - // If the user has not expressed consent, then the cmapi_cookie_privacy cookie will be missing, so we look instead at the notice_behavior cookie. - // If it contains the word expressed, then it means we can only fire required tags. But if it doesn't contain expressed, then full consent is implied, - // and it's ok to fire all the tags. - noticeBehaviorCookie = getCookie(cookieNameNotice); - debug('noticeBehaviorCookie', noticeBehaviorCookie); - if (!noticeBehaviorCookie) { - return; - } - if (noticeBehaviorCookie.indexOf('expressed') > -1) { - debug('expressed'); - trustecm.required = true; - return; - } - for (let bucket in trustecm) { - trustecm[bucket] = true; - } - debug('trustecm', trustecm); -} diff --git a/_vendor/github.com/linode/linode-docs-theme/assets/js/main/index.js b/_vendor/github.com/linode/linode-docs-theme/assets/js/main/index.js index 4a88e2f5438..e403807cd0d 100644 --- a/_vendor/github.com/linode/linode-docs-theme/assets/js/main/index.js +++ b/_vendor/github.com/linode/linode-docs-theme/assets/js/main/index.js @@ -35,6 +35,14 @@ import { newSVGViewerController } from './navigation/svg-viewer'; // Set up the search configuration (as defined in config.toml). const searchConfig = getSearchConfig(params); +// Handle consent changes. +(function () { + window.OptanonWrapper = function () { + const e = new CustomEvent('onetrust:groups-updated', { detail: OnetrustActiveGroups }); + window.dispatchEvent(e); + }; +})(); + // Set up and start Alpine. (function () { // For integration tests. @@ -191,6 +199,8 @@ const searchConfig = getSearchConfig(params); return; } + reloadOTBanner(); + pushDataLayer('docs_navigate'); }); @@ -261,3 +271,28 @@ const searchConfig = getSearchConfig(params); window.addEventListener('turbo:before-render', restoreScroll); window.addEventListener('turbo:render', restoreScroll); })(); + +// See https://my.onetrust.com/s/article/UUID-69162cb7-c4a2-ac70-39a1-ca69c9340046?language=en_US&topicId=0TO1Q000000ssJBWAY +function reloadOTBanner() { + var otConsentSdk = document.getElementById('onetrust-consent-sdk'); + if (otConsentSdk) { + otConsentSdk.remove(); + } + + if (window.OneTrust != null) { + OneTrust.Init(); + + setTimeout(function () { + OneTrust.LoadBanner(); + + var toggleDisplay = document.getElementsByClassName('ot-sdk-show-settings'); + + for (var i = 0; i < toggleDisplay.length; i++) { + toggleDisplay[i].onclick = function (event) { + event.stopImmediatePropagation(); + window.OneTrust.ToggleInfoDisplay(); + }; + } + }, 1000); + } +} diff --git a/_vendor/github.com/linode/linode-docs-theme/assets/js/main/navigation/nav-analytics.js b/_vendor/github.com/linode/linode-docs-theme/assets/js/main/navigation/nav-analytics.js index 4e515967c08..5f203cd0c38 100644 --- a/_vendor/github.com/linode/linode-docs-theme/assets/js/main/navigation/nav-analytics.js +++ b/_vendor/github.com/linode/linode-docs-theme/assets/js/main/navigation/nav-analytics.js @@ -7,14 +7,14 @@ const userTokenCookieName = 'linode_anonymous_usertoken'; var debug = 0 ? console.log.bind(console, '[nav-analytics]') : function () {}; export class AnalyticsEventsCollector { - constructor(searchConfig, getLastQueryID, trustecm) { + constructor(searchConfig, getLastQueryID, onetrust) { this.headers = { 'X-Algolia-Application-Id': searchConfig.app_id, 'X-Algolia-API-Key': searchConfig.api_key, }; (this.getLastQueryID = getLastQueryID), (this.urlEvents = `https://insights.algolia.io/1/events`); - this.trustecm = trustecm; + this.onetrust = onetrust; this.anonomousUserToken = unspecificedUserToken; if (supportsCookies()) { this.anonomousUserToken = getCookie(userTokenCookieName); @@ -46,7 +46,7 @@ export class AnalyticsEventsCollector { if (searchConfig.click_analytics) { const mergedIndex = searchConfig.indexName(searchConfig.sections_merged.index); const userToken = () => { - if (trustecm.performance) { + if (onetrust.performance) { return this.anonomousUserToken; } return unspecificedUserToken; diff --git a/_vendor/github.com/linode/linode-docs-theme/assets/js/main/navigation/nav-store.js b/_vendor/github.com/linode/linode-docs-theme/assets/js/main/navigation/nav-store.js index cc2b3691fe0..096c4572e49 100644 --- a/_vendor/github.com/linode/linode-docs-theme/assets/js/main/navigation/nav-store.js +++ b/_vendor/github.com/linode/linode-docs-theme/assets/js/main/navigation/nav-store.js @@ -2,7 +2,6 @@ import { isMobile } from '../helpers/helpers'; import { getScrollPosNavbar } from './nav'; import { AnalyticsEventsCollector } from './nav-analytics'; import { RecommendationsFetcher } from './recommendations'; -import { initConsentManager } from '../components/index'; export function newNavStore(searchConfig, searchStore, params, Alpine) { const debug = 0 ? console.log.bind(console, '[nav-store]') : function () {}; @@ -37,14 +36,22 @@ export function newNavStore(searchConfig, searchStore, params, Alpine) { toc: false, }, - // TrustArc consent settings. This will also be set on the window object, - // but keep it here so we can react on changes. - trustecm: { + onetrust: { required: false, - socialmedia: false, - targeting: false, - functional: false, performance: false, + functional: false, + targeting: false, + socialmedia: false, + + toggleConsentDialog(event) { + if (!window.OneTrust) { + return; + } + debug('toggleConsentDialog'); + // TODO1 see https://github.com/linode/linode-docs-theme/issues/954 Cookie Consent Links + window.OneTrust.ToggleInfoDisplay(); + event.preventDefault(); + }, }, recommendations: new RecommendationsFetcher(searchConfig), @@ -91,11 +98,10 @@ export function newNavStore(searchConfig, searchStore, params, Alpine) { } } }); - window.trustecm = this.trustecm; let getLastQueryID = () => { return searchStore.results.lastQueryID; }; - this.analytics = new AnalyticsEventsCollector(searchConfig, getLastQueryID, this.trustecm); + this.analytics = new AnalyticsEventsCollector(searchConfig, getLastQueryID, this.onetrust); // The callback below may be called multiple times. let analyticsLoadEventPublished = false; @@ -112,8 +118,19 @@ export function newNavStore(searchConfig, searchStore, params, Alpine) { this.analytics.handler.startNewPage(); } }; + }, - initConsentManager(params.trustarc_domain, this.trustecm, cb); + updateOptanonGroups(groups) { + // Groups on form ,C0001,C0002,C0003,C0004,C0005, + // Split on comma, remove empty strings. + let groupArray = groups.split(',').filter(Boolean); + this.onetrust.required = groupArray.includes('C0001'); + this.onetrust.performance = groupArray.includes('C0002'); + this.onetrust.functional = groupArray.includes('C0003'); + this.onetrust.targeting = groupArray.includes('C0004'); + this.onetrust.socialmedia = groupArray.includes('C0005'); + + console.log('updateOptanonGroups', this.onetrust); }, openSearchPanel(scrollUp = false) { diff --git a/_vendor/github.com/linode/linode-docs-theme/assets/js/main/navigation/nav.js b/_vendor/github.com/linode/linode-docs-theme/assets/js/main/navigation/nav.js index a20b1c6c05f..c1aa95d965d 100644 --- a/_vendor/github.com/linode/linode-docs-theme/assets/js/main/navigation/nav.js +++ b/_vendor/github.com/linode/linode-docs-theme/assets/js/main/navigation/nav.js @@ -93,6 +93,10 @@ export function newNavController(weglot_api_key) { }); }, + onOptanonGroupsUpdated: function (groups) { + this.$store.nav.updateOptanonGroups(groups); + }, + onEffect: function () { this.$store.search.updateLocationWithQuery(); }, diff --git a/_vendor/github.com/linode/linode-docs-theme/assets/js/testenvonly/index.js b/_vendor/github.com/linode/linode-docs-theme/assets/js/testenvonly/index.js index e4cd7cdb84b..13dfbcaa91c 100644 --- a/_vendor/github.com/linode/linode-docs-theme/assets/js/testenvonly/index.js +++ b/_vendor/github.com/linode/linode-docs-theme/assets/js/testenvonly/index.js @@ -4,7 +4,6 @@ let opts = { forceConsent: params.get('__forceconsent') === 'true', apiShouldfail: params.get('__api_shouldfail') === 'true', - noticeBehaviour: params.get('__noticebehaviour') || 'expressed,eu', }; console.log('Loading test environment with options:', opts); @@ -17,30 +16,10 @@ } })(); -// forceSetCookieConsent simulates setting the TrustArc consent. +// forceSetCookieConsent simulates setting the OneTrust consent. // This function is only included/invoked in test environments. function forceSetCookieConsent(opts) { - localStorage.setItem( - 'truste.eu.cookie.cmapi_cookie_privacy', - '{"name":"truste.eu.cookie.cmapi_cookie_privacy","value":"permit 1,2,3,4,5","path":"/","expires":1662226579397}', - ); - localStorage.setItem( - 'truste.eu.cookie.notice_preferences', - '{"name":"truste.eu.cookie.notice_preferences","value":"2,4:","path":"/","expires":1662226579393}', - ); - localStorage.setItem( - 'truste.eu.cookie.notice_gdpr_prefs', - '{"name":"truste.eu.cookie.notice_gdpr_prefs","value":"0,1,2,3,4:","path":"/","expires":1662226579395}', - ); - - localStorage.setItem( - 'truste.eu.cookie.cmapi_gtm_bl', - '{"name":"truste.eu.cookie.cmapi_gtm_bl","value":"","path":"/","expires":1662226579396}', - ); - - document.cookie = 'cmapi_cookie_privacy=permit 1,2,3;'; - document.cookie = 'cmapi_gtm_bl=;'; - document.cookie = 'notice_gdpr_prefs=0,1,2,3,4:;'; - document.cookie = 'notice_preferences=2,4:;'; - document.cookie = 'notice_behavior=' + opts.noticeBehaviour; + document.cookie = 'OptanonAlertBoxClosed=2024-09-18T09:20:34.230Z'; + document.cookie = + 'OptanonConsent=isGpcEnabled=0&datestamp=Mon+Sep+23+2024+10%3A25%3A39+GMT%2B0200+(Central+European+Summer+Time)&version=202403.1.0&browserGpcFlag=0&isIABGlobal=false&hosts=&consentId=c3c54993-fe07-4044-b425-0ca7d930a31f&interactionCount=60&isAnonUser=1&landingPath=NotLandingPage&groups=C0001%3A1%2CC0002%3A1%2CC0003%3A1%2CC0004%3A1%2CC0005%3A1&geolocation=NO%3B03&AwaitingReconsent=false'; } diff --git a/_vendor/github.com/linode/linode-docs-theme/config.toml b/_vendor/github.com/linode/linode-docs-theme/config.toml index 4567feb974b..7838573bb9e 100644 --- a/_vendor/github.com/linode/linode-docs-theme/config.toml +++ b/_vendor/github.com/linode/linode-docs-theme/config.toml @@ -9,8 +9,8 @@ weglot_api_key = "wg_3b3ef29c81aa81292c64d1368ee318969" # For development/staging, see the config dir. adobe_launch_script = "https://assets.adobedtm.com/fcfd3580c848/f9e7661907ee/launch-2fb69de42220.min.js" -# Trustarc Domain used in poduction -trustarc_domain = "linode.com" +# OneTrust Domain used in production. +onetrust_domain_script = "01922358-0e47-73fa-9452-fa124177d6d6" [params.search_config2] diff --git a/_vendor/github.com/linode/linode-docs-theme/config/development/config.toml b/_vendor/github.com/linode/linode-docs-theme/config/development/config.toml index 850a06dfcaa..f292e15ec94 100644 --- a/_vendor/github.com/linode/linode-docs-theme/config/development/config.toml +++ b/_vendor/github.com/linode/linode-docs-theme/config/development/config.toml @@ -2,5 +2,5 @@ # Adobe Analytics script used in development and on Netlify. adobe_launch_script = "https://assets.adobedtm.com/fcfd3580c848/f9e7661907ee/launch-006d022c8726-development.min.js" - # Trustarc domain used in development and on Netlify. - trustarc_domain = "linode_test.com" + # OneTrust Domain used in test/development. + onetrust_domain_script = "01922358-0e47-73fa-9452-fa124177d6d6-test" diff --git a/_vendor/github.com/linode/linode-docs-theme/config/staging/config.toml b/_vendor/github.com/linode/linode-docs-theme/config/staging/config.toml index 89e603d2676..9091267e64a 100644 --- a/_vendor/github.com/linode/linode-docs-theme/config/staging/config.toml +++ b/_vendor/github.com/linode/linode-docs-theme/config/staging/config.toml @@ -2,5 +2,5 @@ # Adobe Analytics script used in Staging (docs.staging.linode.com/docs) adobe_launch_script = "https://assets.adobedtm.com/fcfd3580c848/f9e7661907ee/launch-96338797f65e-staging.min.js" - # Trustarc domain used in Staging (docs.staging.linode.com/docs) - # trustarc_domain = "linode.com" + # OneTrust Domain used in test/development. + onetrust_domain_script = "01922358-0e47-73fa-9452-fa124177d6d6-test" diff --git a/_vendor/github.com/linode/linode-docs-theme/config/testing/config.toml b/_vendor/github.com/linode/linode-docs-theme/config/testing/config.toml index 850a06dfcaa..f292e15ec94 100644 --- a/_vendor/github.com/linode/linode-docs-theme/config/testing/config.toml +++ b/_vendor/github.com/linode/linode-docs-theme/config/testing/config.toml @@ -2,5 +2,5 @@ # Adobe Analytics script used in development and on Netlify. adobe_launch_script = "https://assets.adobedtm.com/fcfd3580c848/f9e7661907ee/launch-006d022c8726-development.min.js" - # Trustarc domain used in development and on Netlify. - trustarc_domain = "linode_test.com" + # OneTrust Domain used in test/development. + onetrust_domain_script = "01922358-0e47-73fa-9452-fa124177d6d6-test" diff --git a/_vendor/github.com/linode/linode-docs-theme/content/testpages/typography.md b/_vendor/github.com/linode/linode-docs-theme/content/testpages/typography.md index b5aaa51f938..12e19d12bcf 100644 --- a/_vendor/github.com/linode/linode-docs-theme/content/testpages/typography.md +++ b/_vendor/github.com/linode/linode-docs-theme/content/testpages/typography.md @@ -201,18 +201,29 @@ sudo systemctl restart apache2 sudo systemctl restart apache2 ``` -## File Shortcode +## File Shortcode / code fence ### As a regular block Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc sollicitudin id metus vel malesuada. Ut suscipit nec orci vel sagittis. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Fusce accumsan fringilla urna et maximus. Aliquam erat volutpat. Nam malesuada faucibus massa ac ultrices. Sed finibus diam at dolor maximus porttitor. +#### Fence + ```file {title="/home/minecraft/run.sh"} #!/bin/sh java -Xms1024M -Xmx1536M -jar minecraft_server.1.13.jar -o true ``` +#### Shortcode + +{{< file title="/home/minecraft/run.sh" >}} +#!/bin/sh + +java -Xms1024M -Xmx1536M -jar minecraft_server.1.13.jar -o true +{{< /file >}} + + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc sollicitudin id metus vel malesuada. ```file {title="/foo/bar/maz.go"} diff --git a/_vendor/github.com/linode/linode-docs-theme/layouts/_default/_markup/render-codeblock-file.html b/_vendor/github.com/linode/linode-docs-theme/layouts/_default/_markup/render-codeblock-file.html index 9c682b490a8..8ccc1dc2278 100644 --- a/_vendor/github.com/linode/linode-docs-theme/layouts/_default/_markup/render-codeblock-file.html +++ b/_vendor/github.com/linode/linode-docs-theme/layouts/_default/_markup/render-codeblock-file.html @@ -14,7 +14,7 @@ {{ $linenostart := .Attributes.linenostart | default 1 | int }} {{ $options := slice "lineNos=table" (printf "hl_lines=%s" $hl_lines ) (printf "linenostart=%d" $linenostart ) }} {{ $copyIcon := `` | safeHTML }} -
+
{{ $copyIcon }}
diff --git a/_vendor/github.com/linode/linode-docs-theme/layouts/_default/_markup/render-link.html b/_vendor/github.com/linode/linode-docs-theme/layouts/_default/_markup/render-link.html index 2d1638cf2f2..2bb098c9ca6 100644 --- a/_vendor/github.com/linode/linode-docs-theme/layouts/_default/_markup/render-link.html +++ b/_vendor/github.com/linode/linode-docs-theme/layouts/_default/_markup/render-link.html @@ -85,8 +85,6 @@ {{- if and .page .page.Params.description -}} {{- $text = .page.Params.description | markdownify -}} {{- end -}} - -
-{{ end }} +{{ end -}} diff --git a/_vendor/github.com/linode/linode-docs-theme/layouts/_default/baseof.html b/_vendor/github.com/linode/linode-docs-theme/layouts/_default/baseof.html index 08f404bebb3..78481ed9d43 100644 --- a/_vendor/github.com/linode/linode-docs-theme/layouts/_default/baseof.html +++ b/_vendor/github.com/linode/linode-docs-theme/layouts/_default/baseof.html @@ -111,7 +111,8 @@ x-data="lncNav" x-effect="onEffect()" @scroll.window.debounce.100ms="onScroll()" - @turbo:before-render.window="onTurboBeforeRender(event)" + @turbo:before-render.window="onTurboBeforeRender($event)" + @onetrust:groups-updated.window="onOptanonGroupsUpdated($event.detail)" @turbo:render.window="onTurboRender()" @popstate.window="onPopState($event)" id="nav-controller" diff --git a/_vendor/github.com/linode/linode-docs-theme/layouts/partials/components/disqus.html b/_vendor/github.com/linode/linode-docs-theme/layouts/partials/components/disqus.html index f10e9f1337c..bfe3d7be30a 100644 --- a/_vendor/github.com/linode/linode-docs-theme/layouts/partials/components/disqus.html +++ b/_vendor/github.com/linode/linode-docs-theme/layouts/partials/components/disqus.html @@ -3,7 +3,7 @@ class="flex justify-between bg-gray-300 pull-out items-center rounded-none md:rounded-md px-4 md:px-8 py-6 mt-8">
Join the conversation.
-
+
Read other comments or post your own below. Comments must be respectful, constructive, and relevant to the topic of the guide. Do not post external links or advertisements. Before posting, consider if your @@ -13,12 +13,12 @@ Community Site.
-
+
The Disqus commenting system for Linode Docs requires the acceptance of Functional Cookies, which allow us to analyze site usage so we can measure and improve performance. To view and create comments for this article, please - update your Cookie Preferences on this website and refresh this web page. Please note: You must have @@ -29,7 +29,7 @@