diff --git a/.gitignore b/.gitignore index 52bce1a639a..7381324ecf0 100644 --- a/.gitignore +++ b/.gitignore @@ -25,7 +25,6 @@ Thumbs.dbi *.jar *.rar *.tar -*.zip *.log *.sql diff --git a/_vendor/github.com/linode/linode-docs-theme/assets/js/body-start/index.js b/_vendor/github.com/linode/linode-docs-theme/assets/js/body-start/index.js index 07425b5b0b8..ae018cfc0c9 100644 --- a/_vendor/github.com/linode/linode-docs-theme/assets/js/body-start/index.js +++ b/_vendor/github.com/linode/linode-docs-theme/assets/js/body-start/index.js @@ -1,12 +1,6 @@ -import { setIsTranslating, isMobile, toggleBooleanClass } from '../main/helpers/helpers'; +import { isMobile, toggleBooleanClass } from '../main/helpers/helpers'; (function () { - if (!window.turbolinksLoaded) { - // If a language other than en is set, we need to try to prevent the - // untranslated content from being visible. - setIsTranslating(document.body); - } - if (!window.truste) { window.truste = {}; } diff --git a/_vendor/github.com/linode/linode-docs-theme/assets/js/main/helpers/helpers.js b/_vendor/github.com/linode/linode-docs-theme/assets/js/main/helpers/helpers.js index c50475776b4..8c3cc559273 100644 --- a/_vendor/github.com/linode/linode-docs-theme/assets/js/main/helpers/helpers.js +++ b/_vendor/github.com/linode/linode-docs-theme/assets/js/main/helpers/helpers.js @@ -127,47 +127,6 @@ export function getOffsetTop(container, el) { return offset; } -export function setIsTranslating(el, timeout = 1000) { - let currentLang = getCurrentLang(); - if (!currentLang || currentLang == 'en') { - return; - } - - let els = isIterable(el) ? el : [el]; - - els.forEach((el) => { - el.classList.add('is-translating'); - }); - - setTimeout(function () { - els.forEach((el) => { - el.classList.remove('is-translating'); - }); - }, timeout); -} - -// getLang gets the language from either the URL or the browser's local storage. -export function getCurrentLang() { - let lang = getCurrentLangFromLocation(); - if (lang) { - return lang; - } - - // _x_ is the special namespace used by AlpineJS. - // Read it directly here because we need to access it before Alpine is loaded. - return JSON.parse(localStorage.getItem('_x_currentLang')); -} - -const validLangs = ['en', 'es']; - -export function getCurrentLangFromLocation() { - let lang = new URLSearchParams(window.location.search).get('lang'); - if (validLangs.includes(lang)) { - return lang; - } - return ''; -} - export function getIntParamFromLocation(param) { let value = new URLSearchParams(window.location.search).get(param); if (value) { @@ -176,10 +135,6 @@ export function getIntParamFromLocation(param) { return 0; } -function isIterable(obj) { - return Symbol.iterator in Object(obj); -} - export function isMobile() { return document.documentElement.clientWidth < 768; } 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 0da3d3d07fc..ee5aa1fa328 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 @@ -11,11 +11,9 @@ import { newDropdownsController, newTabsController, } from './components/index'; -import { toggleBooleanClass, setIsTranslating, getCurrentLang, scrollToActiveExplorerNode } from './helpers/helpers'; +import { toggleBooleanClass, scrollToActiveExplorerNode } from './helpers/helpers'; import { leackChecker } from './helpers/leak-checker'; import { - addLangToLinks, - newLanguageSwitcherController, newNavController, newPromoCodesController, newToCController, @@ -85,8 +83,7 @@ const searchConfig = getSearchConfig(params); // Register AlpineJS controllers. { // Search and navigation. - Alpine.data('lncNav', () => newNavController(params.weglot_api_key)); - Alpine.data('lncLanguageSwitcher', newLanguageSwitcherController(params.weglot_api_key)); + Alpine.data('lncNav', () => newNavController()); Alpine.data('lncSearchFilters', () => newSearchFiltersController(searchConfig)); Alpine.data('lncSearchInput', newSearchInputController); Alpine.data('lncSearchExplorerNode', (node = {}) => newSearchExplorerNode(searchConfig, node)); @@ -159,13 +156,6 @@ const searchConfig = getSearchConfig(params); }; document.addEventListener('turbo:load', function (event) { - // Update any static links to the current language. - let lang = getCurrentLang(); - if (lang && lang !== 'en') { - addLangToLinks(lang, document.getElementById('linode-menus')); - addLangToLinks(lang, document.getElementById('footer')); - } - if (window.turbolinksLoaded) { // Make sure we only fire one event to GTM. // The navigation events gets handled by turbo:render @@ -174,27 +164,12 @@ const searchConfig = getSearchConfig(params); toggleBooleanClass('turbo-loaded', document.documentElement, true); - // Init language links. - let languageSwitcherTarget = document.getElementById('weglot_here'); - - let languageSwitcherTemplate = document.getElementById('language-switcher-template'); - let languageSwitcherSource = document.importNode(languageSwitcherTemplate.content, true); - languageSwitcherTarget.replaceChildren(languageSwitcherSource); - window.turbolinksLoaded = true; setTimeout(function () { pushDataLayer('docs_load'); }, 2000); }); - document.addEventListener('turbo:before-render', function (event) { - let body = event.detail.newBody; - - // This hides the relevant elements for a second if the user has selected a language different from the default one. - // This should avoid the static and untranslated content showing. - setIsTranslating(body.querySelectorAll('.hide-on-lang-nav')); - }); - document.addEventListener('turbo:render', function (event) { if (document.documentElement.hasAttribute('data-turbo-preview')) { // Turbolinks is displaying a preview diff --git a/_vendor/github.com/linode/linode-docs-theme/assets/js/main/navigation/index.js b/_vendor/github.com/linode/linode-docs-theme/assets/js/main/navigation/index.js index f69e3b39294..e07a2abbe78 100644 --- a/_vendor/github.com/linode/linode-docs-theme/assets/js/main/navigation/index.js +++ b/_vendor/github.com/linode/linode-docs-theme/assets/js/main/navigation/index.js @@ -1,7 +1,5 @@ export * from './explorer'; export * from './create-href'; -export * from './lang'; -export * from './language-switcher'; export * from './nav'; export * from './toc'; export * from './promo-codes'; diff --git a/_vendor/github.com/linode/linode-docs-theme/assets/js/main/navigation/lang.js b/_vendor/github.com/linode/linode-docs-theme/assets/js/main/navigation/lang.js deleted file mode 100644 index ae6e419b719..00000000000 --- a/_vendor/github.com/linode/linode-docs-theme/assets/js/main/navigation/lang.js +++ /dev/null @@ -1,39 +0,0 @@ -const linodeDotCom = 'https://www.linode.com'; - -export function addLangToLinks(lang, container) { - if (!container) { - return; - } - let links = container.querySelectorAll('a'); - for (let i = 0; i < links.length; i++) { - let link = links[i]; - - let href = link.getAttribute('href'); - if (!href || href.startsWith(`${linodeDotCom}/${lang}/`)) { - // Language already present. - continue; - } - let hrefWithLang = addLangToHref(href, lang); - if (href === hrefWithLang) { - continue; - } - link.setAttribute('href', hrefWithLang); - } -} - -export function addLangToHref(href, lang) { - if (!(href && href.startsWith(`${linodeDotCom}`))) { - return href; - } - let url = new URL(href); - let pathExcludeRe = /(\/docs\/|\/community\/questions\/|\/wp-content\/)/; - if (pathExcludeRe.test(url.pathname)) { - return href; - } - - if (url.pathname == '/') { - return `${href}${lang}/`; - } - - return href.replace(url.pathname, `/${lang}${url.pathname}`); -} diff --git a/_vendor/github.com/linode/linode-docs-theme/assets/js/main/navigation/language-switcher.js b/_vendor/github.com/linode/linode-docs-theme/assets/js/main/navigation/language-switcher.js deleted file mode 100644 index 3bf51a68784..00000000000 --- a/_vendor/github.com/linode/linode-docs-theme/assets/js/main/navigation/language-switcher.js +++ /dev/null @@ -1,91 +0,0 @@ -'use strict'; - -import { getCurrentLangFromLocation } from '../helpers/helpers'; - -var debug = 0 ? console.log.bind(console, '[language-switcher]') : function () {}; - -export function newLanguageSwitcherController(weglot_api_key) { - debug('newLanguageSwitcherController'); - const initAndSwitchTo = function (self) { - let lang = self.currentLang; - self.$store.nav.lang = lang; - setTimeout(() => { - // We navigate with Turbo, but we need to initialize Weglot on each - // page load. - Weglot.initialized = false; - Weglot.on('initialized', () => { - debug('Weglot initialized'); - Weglot.switchTo(lang); - }); - initWeglot(weglot_api_key); - }, 600); - }; - - // This needs to be a function to get the $persist binded. - return function () { - return { - show: true, - open: false, - currentLang: this.$persist('en'), - languages: [ - { lang: 'en', name: 'English' }, - { lang: 'es', name: 'EspaƱol' }, - ], - - init: function () { - debug('init language'); - const langParam = getCurrentLangFromLocation(); - if (langParam) { - this.currentLang = langParam; - } - - if (!this.isDefaultLanguage()) { - this.$nextTick(() => { - initAndSwitchTo(this); - }); - } - }, - - switchLanguage: function (lang) { - if (!lang || lang === this.currentLang) { - return; - } - // Do a full refresh to make sure all links etc. gets updatedd. - if (window.location.search.includes('lang=')) { - window.location.search = `lang=${lang}`; - } else { - window.location.search += `&lang=${lang}`; - } - }, - - currentLanguage: function () { - return this.languages.find((element) => { - return element.lang === this.currentLang; - }); - }, - languageIDs: function (prefix) { - //A string of language IDs prefixed with the given prefix separated by spaces. - let s = ''; - for (let i = 0; i < this.languages.length; i++) { - s += prefix + this.languages[i].lang; - if (i < this.languages.length - 1) { - s += ' '; - } - } - return s; - }, - isDefaultLanguage: function () { - return this.currentLang === 'en'; - }, - }; - }; -} - -function initWeglot(apiKey) { - debug('initWeglot'); - // Initialization of Weglot. - Weglot.initialize({ - api_key: apiKey, - hide_switcher: true, - }); -} 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 c1aa95d965d..1bd3f20a5a3 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 @@ -73,7 +73,7 @@ const applyUIState = function (self, init = false) { setClassAndWatch(self.$store.nav.pinned, '$store.nav.pinned', 'topbar-pinned'); }; -export function newNavController(weglot_api_key) { +export function newNavController() { return { init: function () { applyUIState(this, true); diff --git a/_vendor/github.com/linode/linode-docs-theme/assets/js/main/search/search-store.js b/_vendor/github.com/linode/linode-docs-theme/assets/js/main/search/search-store.js index a6fcb0063f2..d27b539ed03 100644 --- a/_vendor/github.com/linode/linode-docs-theme/assets/js/main/search/search-store.js +++ b/_vendor/github.com/linode/linode-docs-theme/assets/js/main/search/search-store.js @@ -1,7 +1,7 @@ import { newQuery, QueryHandler } from './query'; -import { getCurrentLang, toDateString } from '../helpers/helpers'; +import { toDateString } from '../helpers/helpers'; import { LRUMap } from '../helpers/lru'; -import { newCreateHref, addLangToHref } from '../navigation/index'; +import { newCreateHref } from '../navigation/index'; import { newRequestCallback, newRequestCallbackFactories, @@ -397,7 +397,7 @@ export function newSearchStore(searchConfig, params, Alpine) { return store; } -export function normalizeAlgoliaResult(result, lang = '') { +export function normalizeAlgoliaResult(result) { let index = result.index; let queryID = result.queryID ? result.queryID : ''; @@ -443,10 +443,6 @@ export function normalizeAlgoliaResult(result, lang = '') { hit.isExternalLink = hit.href.startsWith('http'); } - if (lang && lang !== 'en' && hit.href) { - hit.href = addLangToHref(hit.href, lang); - } - hit.firstPublishedDateString = ''; if (hit.firstPublishedTime) { hit.firstPublishedDateString = toDateString(new Date(hit.firstPublishedTime * 1000)); @@ -571,9 +567,7 @@ const normalizeResult = function (self, result) { return sections; }; - let lang = getCurrentLang(); - - normalizeAlgoliaResult(result, lang); + normalizeAlgoliaResult(result); }; class SearchBatcher { diff --git a/_vendor/github.com/linode/linode-docs-theme/config.toml b/_vendor/github.com/linode/linode-docs-theme/config.toml index 507eb117fe4..c385f1a94ea 100644 --- a/_vendor/github.com/linode/linode-docs-theme/config.toml +++ b/_vendor/github.com/linode/linode-docs-theme/config.toml @@ -2,8 +2,6 @@ [params] time_format_iso8601 = "2006-01-02T15:04:05-07:00" - weglot_api_key = "wg_3b3ef29c81aa81292c64d1368ee318969" - # # Adobe Analytics script used in production. # For development/staging, see the config dir. adobe_launch_script = "https://assets.adobedtm.com/fcfd3580c848/f9e7661907ee/launch-2fb69de42220.min.js" 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 7b415990bed..b16b2259d3d 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 @@ -54,9 +54,6 @@ [x-cloak] { display: none !important; } - .is-translating { - opacity: 0 !important; - } {{/* Main content area. */}} -
+
{{ if site.Params.enable_leak_checker }} {{ partial "helpers/leak-checker.html" }} @@ -215,7 +212,4 @@ {{ partial "sections/before-body-end.html" . }}
- diff --git a/_vendor/github.com/linode/linode-docs-theme/layouts/partials/sections/head-src.html b/_vendor/github.com/linode/linode-docs-theme/layouts/partials/sections/head-src.html index 062d1e45aff..cd3888b23d4 100644 --- a/_vendor/github.com/linode/linode-docs-theme/layouts/partials/sections/head-src.html +++ b/_vendor/github.com/linode/linode-docs-theme/layouts/partials/sections/head-src.html @@ -32,16 +32,10 @@ type="font/woff2" crossorigin /> - {{ $params := (dict "search_config" site.Params.search_config2 "file_issue_button" site.Params.file_issue_button - "weglot_api_key" site.Params.weglot_api_key "page_title_suffix" site.Params.page_title_suffix "is_production" (ne hugo.Environment "development") "is_test" $isTest ) diff --git a/_vendor/github.com/linode/linode-docs-theme/layouts/partials/sections/navigation/explorer-toggle.html b/_vendor/github.com/linode/linode-docs-theme/layouts/partials/sections/navigation/explorer-toggle.html index 3e7266969a3..0e7d35de980 100644 --- a/_vendor/github.com/linode/linode-docs-theme/layouts/partials/sections/navigation/explorer-toggle.html +++ b/_vendor/github.com/linode/linode-docs-theme/layouts/partials/sections/navigation/explorer-toggle.html @@ -30,7 +30,7 @@ -
-
-
-
-
diff --git a/_vendor/modules.txt b/_vendor/modules.txt index cf723898725..f3134e375fd 100644 --- a/_vendor/modules.txt +++ b/_vendor/modules.txt @@ -1,4 +1,4 @@ -# github.com/linode/linode-docs-theme v0.0.0-20260129182953-a5dc39097dba +# github.com/linode/linode-docs-theme v0.0.0-20260227165149-899fbfe40185 # github.com/linode/linode-website-partials v0.0.0-20250814204525-0d7fe4159951 # github.com/gohugoio/hugo-mod-jslibs-dist/alpinejs/v3 v3.21300.20800 # github.com/gohugoio/hugo-mod-jslibs/turbo/v8 v8.20000.20400 diff --git a/docs/guides/akamai/solutions/deploy-rag-powered-chatbot-langchain-akamai-compute-instance/chatbot-short-stories.zip b/docs/guides/akamai/solutions/deploy-rag-powered-chatbot-langchain-akamai-compute-instance/chatbot-short-stories.zip new file mode 100644 index 00000000000..a353727f373 Binary files /dev/null and b/docs/guides/akamai/solutions/deploy-rag-powered-chatbot-langchain-akamai-compute-instance/chatbot-short-stories.zip differ diff --git a/go.mod b/go.mod index f087fcb2a38..13bf193232e 100644 --- a/go.mod +++ b/go.mod @@ -7,5 +7,5 @@ require ( github.com/gohugoio/hugo-mod-jslibs/turbo/v7 v7.20300.20000 // indirect github.com/instantpage/instant.page v5.1.1+incompatible // indirect github.com/linode/linode-api-docs/v4 v4.176.0 // indirect - github.com/linode/linode-docs-theme v0.0.0-20260129182953-a5dc39097dba // indirect + github.com/linode/linode-docs-theme v0.0.0-20260227165149-899fbfe40185 // indirect ) diff --git a/go.sum b/go.sum index 266bb7a7e5d..ab71b6c285c 100644 --- a/go.sum +++ b/go.sum @@ -336,6 +336,8 @@ github.com/linode/linode-docs-theme v0.0.0-20250902163319-d09d95b9ed25 h1:DqCQjE github.com/linode/linode-docs-theme v0.0.0-20250902163319-d09d95b9ed25/go.mod h1:sMRfMYZ0n0E2/EJTPRPwbkXX/RKLhDma1cs4FyszErE= github.com/linode/linode-docs-theme v0.0.0-20260129182953-a5dc39097dba h1:Uus1RnftDQsqcqa9hY1R5cvU8Cgie30tKvfQeRMXImM= github.com/linode/linode-docs-theme v0.0.0-20260129182953-a5dc39097dba/go.mod h1:sMRfMYZ0n0E2/EJTPRPwbkXX/RKLhDma1cs4FyszErE= +github.com/linode/linode-docs-theme v0.0.0-20260227165149-899fbfe40185 h1:TFWSsMOrbP9ah52LHHv9DqCU8Z9n1t1JJDGrWBDs97U= +github.com/linode/linode-docs-theme v0.0.0-20260227165149-899fbfe40185/go.mod h1:sMRfMYZ0n0E2/EJTPRPwbkXX/RKLhDma1cs4FyszErE= github.com/linode/linode-website-partials v0.0.0-20221205205120-b6ea1aaa59fb/go.mod h1:K1Em3lwb16JiCwNVftAFwWGhyB9Zkl/nXhxjBBUC1Ao= github.com/linode/linode-website-partials v0.0.0-20221222200538-99862e429110/go.mod h1:K1Em3lwb16JiCwNVftAFwWGhyB9Zkl/nXhxjBBUC1Ao= github.com/linode/linode-website-partials v0.0.0-20230201145731-a8703d0a954a/go.mod h1:K1Em3lwb16JiCwNVftAFwWGhyB9Zkl/nXhxjBBUC1Ao=