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 d4e4b98254c..c50475776b4 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
@@ -118,7 +118,7 @@ export function scrollToActiveExplorerNode() {
}
}
-function getOffsetTop(container, el) {
+export function getOffsetTop(container, el) {
let offset = 0;
while (el && el != container) {
offset += el.offsetTop;
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 e403807cd0d..c4c0a38c5da 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
@@ -31,6 +31,7 @@ import { newSearchFiltersController, newSearchInputController, newSearchStore, g
import { newHomeController } from './sections/home/home';
import { newSectionsController } from './sections/sections/index';
import { newSVGViewerController } from './navigation/svg-viewer';
+import { newFileIssueButton } from './navigation/file-issue-button';
// Set up the search configuration (as defined in config.toml).
const searchConfig = getSearchConfig(params);
@@ -101,6 +102,9 @@ const searchConfig = getSearchConfig(params);
Alpine.data('lncPromoCodes', () => newPromoCodesController(params.is_test));
Alpine.data('lncFetch', fetchController);
Alpine.data('lnvSVGViewer', newSVGViewerController);
+ if (params.file_issue_button && params.file_issue_button.enable) {
+ Alpine.data('lncFileIssueButton', () => newFileIssueButton(params.file_issue_button));
+ }
// Page controllers.
Alpine.data('lncHome', (staticData) => {
diff --git a/_vendor/github.com/linode/linode-docs-theme/assets/js/main/navigation/file-issue-button.js b/_vendor/github.com/linode/linode-docs-theme/assets/js/main/navigation/file-issue-button.js
new file mode 100644
index 00000000000..7642896133e
--- /dev/null
+++ b/_vendor/github.com/linode/linode-docs-theme/assets/js/main/navigation/file-issue-button.js
@@ -0,0 +1,149 @@
+var debug = 0 ? console.log.bind(console, '[file-issue-button]') : function () {};
+
+import { getOffsetTop, isMobile } from '../helpers/helpers';
+
+export function newFileIssueButton(conf) {
+ return {
+ isHovered: false,
+ hoveredEl: null,
+ isHoveredButton: false,
+ timeoutID: null,
+
+ // The issue items presented to the user.
+ items: [],
+
+ show() {
+ return this.isHoveredButton || this.isHovered;
+ },
+
+ hoverButton() {
+ // Prepare the issue items.
+ // First clear any existing items.
+ this.items.length = 0;
+
+ for (let item of conf.issue_templates) {
+ let info = window.lnPageInfo;
+ let file = '';
+ if (info.path) {
+ file = `https://github.com/linode/docs/blob/develop/docs/${info.path}`;
+ }
+ let context = this.hoveredEl.textContent.trim();
+ debug('context:', context);
+ let href = `${conf.repo_url}/issues/new?&template=${item.id}&file=${encodeURIComponent(
+ file,
+ )}&context=${encodeURIComponent(context)}`;
+ this.items.push({ title: item.title, href: href });
+ }
+
+ // This will show the issue items dropdown.
+ this.isHoveredButton = true;
+ },
+
+ hoverOn(hoveredEl) {
+ if (this.isHovered) {
+ debug('hoverOn:', hoveredEl.tagName, 'vs', this.hoveredEl.tagName);
+
+ if (hoveredEl.tagName !== this.hoveredEl.tagName) {
+ // Check if we're hovering over the same element or an ancestor.
+ if (hoveredEl.contains(this.hoveredEl)) {
+ debug('skip');
+ return;
+ }
+ } else {
+ if (hoveredEl.tagName == 'TD' || hoveredEl.tagName == 'TH') {
+ debug('skip');
+ return;
+ }
+ }
+ }
+ if (this.isHoveredButton) {
+ this.isHoveredButton = false;
+ }
+ if (this.timeoutID) {
+ clearTimeout(this.timeoutID);
+ }
+ debug('hoverOn:', hoveredEl.tagName);
+
+ if (hoveredEl.tagName === 'PRE') {
+ // If the parent is a TD we need to select the second column, the first is line numbers.
+ let parent = hoveredEl.parentNode;
+ if (parent.tagName === 'TD') {
+ hoveredEl = parent.parentNode.parentNode;
+ let tds = hoveredEl.querySelectorAll('td');
+ // Select last td.
+ hoveredEl = tds[tds.length - 1];
+ }
+ }
+
+ this.isHovered = true;
+ this.hoveredEl = hoveredEl;
+
+ let el = this.$el;
+ let container = el.parentNode;
+ let distance = getOffsetTop(container, hoveredEl);
+
+ // Position el relative to hoveredEl.
+ el.style.position = 'absolute';
+ el.style.top = distance + 'px';
+ el.style.left = '0';
+ el.style.zIndex = 5;
+
+ this.timeoutID = setTimeout(() => {
+ this.isHovered = false;
+ }, 2500);
+ },
+
+ init() {
+ return this.$nextTick(() => {
+ if (isMobile()) {
+ return;
+ }
+ let mainContentEl = document.getElementById('main__content');
+ if (!mainContentEl) {
+ return;
+ }
+
+ mainContentEl.querySelectorAll('.content').forEach((contentEl) => {
+ contentEl.addEventListener(
+ 'mouseover',
+ (e) => {
+ switch (e.target.tagName) {
+ case 'DL':
+ case 'LI':
+ case 'P':
+ case 'PRE':
+ case 'TD':
+ case 'TH':
+ this.hoverOn(e.target);
+ break;
+ case 'SPAN':
+ case 'CODE':
+ // Check if we're in a pre block.
+ let pre = e.target.closest('pre');
+ if (pre) {
+ this.hoverOn(pre);
+ }
+ break;
+ case 'DIV':
+ // This class is set in the tabs component etc,
+ // to avoid getting many false positives on the DIVS.
+ let whitelist = ['file-issue-button-content', 'note', 'code'];
+ for (let w of whitelist) {
+ if (e.target.classList.contains(w)) {
+ this.hoverOn(e.target);
+ break;
+ }
+ }
+ break;
+ default:
+ debug('default:', e.target.tagName);
+ break;
+ }
+ },
+ { passive: true },
+ );
+ });
+ });
+ },
+ };
+}
diff --git a/_vendor/github.com/linode/linode-docs-theme/config.toml b/_vendor/github.com/linode/linode-docs-theme/config.toml
index 850f986ae64..80ff9943716 100644
--- a/_vendor/github.com/linode/linode-docs-theme/config.toml
+++ b/_vendor/github.com/linode/linode-docs-theme/config.toml
@@ -10,8 +10,25 @@ weglot_api_key = "wg_3b3ef29c81aa81292c64d1368ee318969"
adobe_launch_script = "https://assets.adobedtm.com/fcfd3580c848/f9e7661907ee/launch-2fb69de42220.min.js"
# OneTrust Domain used in production.
+onetrust_script_src = "https://www.linode.com/ns/ot/202410.1.0/prod/scripttemplates/otSDKStub.js"
onetrust_domain_script = "01922358-0e47-73fa-9452-fa124177d6d6"
+# Configuration for the contextual menu over content items that
+# allows the user to send specific feedback/issue about the content
+# to GitHub.
+# We currently pass attribute 'context' and 'file' prefilled from the front-end.
+[params.file_issue_button]
+enable = true
+repo_url = "https://github.com/bep/githubissuestest"
+[[params.file_issue_button.issue_templates]]
+# The id maps to a GitHub issue template in the repository.
+id = "issue-template-1.yml"
+# The title is what gets shown in the contextual menu.
+title = "Report a problem"
+[[params.file_issue_button.issue_templates]]
+id = "issue-template-2.yml"
+title = "Report something else"
+
[params.search_config2]
app_id = "KGUN8FAIPF"
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 f292e15ec94..45b87b99f23 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
@@ -3,4 +3,5 @@
adobe_launch_script = "https://assets.adobedtm.com/fcfd3580c848/f9e7661907ee/launch-006d022c8726-development.min.js"
# OneTrust Domain used in test/development.
+ onetrust_script_src = "https://www.linode.com/ns/ot/202410.1.0/staging/scripttemplates/otSDKStub.js"
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 9091267e64a..246550c5804 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
@@ -3,4 +3,5 @@
adobe_launch_script = "https://assets.adobedtm.com/fcfd3580c848/f9e7661907ee/launch-96338797f65e-staging.min.js"
# OneTrust Domain used in test/development.
+ onetrust_script_src = "https://www.linode.com/ns/ot/202410.1.0/staging/scripttemplates/otSDKStub.js"
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 f292e15ec94..45b87b99f23 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
@@ -3,4 +3,5 @@
adobe_launch_script = "https://assets.adobedtm.com/fcfd3580c848/f9e7661907ee/launch-006d022c8726-development.min.js"
# OneTrust Domain used in test/development.
+ onetrust_script_src = "https://www.linode.com/ns/ot/202410.1.0/staging/scripttemplates/otSDKStub.js"
onetrust_domain_script = "01922358-0e47-73fa-9452-fa124177d6d6-test"
diff --git a/_vendor/github.com/linode/linode-docs-theme/content/whatsnew/index.md b/_vendor/github.com/linode/linode-docs-theme/content/whatsnew/index.md
index f09b37b9a64..9ab153445ad 100644
--- a/_vendor/github.com/linode/linode-docs-theme/content/whatsnew/index.md
+++ b/_vendor/github.com/linode/linode-docs-theme/content/whatsnew/index.md
@@ -1,5 +1,6 @@
---
title: "What’s New"
+linkTitle: "New and updated Cloud Guides & Tutorials"
date: 2021-04-16
layout: "whatsnew"
---
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 78481ed9d43..7b415990bed 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
@@ -161,7 +161,7 @@
{{ if eq $mainLayout "content_toc" }}
+ {{ (or .Params.description .Summary)| truncate 160 | safeHTML }} +
+ + {{ end }} ++ View All Cloud Guides & Tutorials +
{{ end }} diff --git a/_vendor/github.com/linode/linode-docs-theme/layouts/index.html b/_vendor/github.com/linode/linode-docs-theme/layouts/index.html index 86ca4d87bf5..bfd6a59acc1 100644 --- a/_vendor/github.com/linode/linode-docs-theme/layouts/index.html +++ b/_vendor/github.com/linode/linode-docs-theme/layouts/index.html @@ -362,7 +362,7 @@- Explore more {{ .more_text }} -
+