From 1cee2bf4ac5d8435f618a21890d0fdbbb3387c56 Mon Sep 17 00:00:00 2001 From: Garry Ing Date: Thu, 12 Mar 2026 18:22:56 -0400 Subject: [PATCH 1/3] migrate to scalar --- assets/js/snippets.js | 2 +- layouts/shortcodes/openapi.html | 96 +++++++++++++++++++++++++-------- 2 files changed, 74 insertions(+), 24 deletions(-) diff --git a/assets/js/snippets.js b/assets/js/snippets.js index 9f7ce2adff..f9f3867295 100644 --- a/assets/js/snippets.js +++ b/assets/js/snippets.js @@ -168,5 +168,5 @@ const customizeUI = (pre) => { }; document.addEventListener("DOMContentLoaded", () => { - document.querySelectorAll("pre").forEach((pre) => customizeUI(pre)); + document.querySelectorAll("pre:not(.scalar-app pre)").forEach((pre) => customizeUI(pre)); }); \ No newline at end of file diff --git a/layouts/shortcodes/openapi.html b/layouts/shortcodes/openapi.html index 1353fd38ce..c06497429a 100644 --- a/layouts/shortcodes/openapi.html +++ b/layouts/shortcodes/openapi.html @@ -1,35 +1,85 @@ - - - - +
+ + From 7fadca356fe0fbc8fc918cefec08b9605117d9d6 Mon Sep 17 00:00:00 2001 From: Garry Ing Date: Fri, 13 Mar 2026 11:04:17 -0400 Subject: [PATCH 2/3] remove unused listener --- assets/js/index.js | 65 ---------------------------------------------- 1 file changed, 65 deletions(-) diff --git a/assets/js/index.js b/assets/js/index.js index de8d5bf874..bda8ebbff3 100644 --- a/assets/js/index.js +++ b/assets/js/index.js @@ -1,68 +1,3 @@ -var searchForms = document.getElementsByClassName("search-container") - -Array.from(searchForms).forEach(container => { - const search = container.querySelectorAll('.search')[0] - const suggestions = document.querySelectorAll('.suggestions')[0] - - if (search) { - document.addEventListener('keydown', inputFocus); - } - - function inputFocus(e) { - if (e.key === '/' ) { - e.preventDefault(); - search.focus(); - } - if (e.key === 'Escape' ) { - search.blur(); - suggestions.classList.add('d-none'); - } - } - - document.addEventListener('click', function(event) { - let isClickInsideElement = suggestions.contains(event.target); - - if (!isClickInsideElement) { - suggestions.classList.add('d-none'); - } - }); - - document.addEventListener('keydown', suggestionFocus); - - function suggestionFocus(e) { - const suggestionsHidden = suggestions.classList.contains('d-none'); - if (suggestionsHidden) return; - - const focusableSuggestions = [...suggestions.querySelectorAll('a')]; - if (focusableSuggestions.length === 0) return; - - const index = focusableSuggestions.indexOf(document.activeElement); - - if (e.key === "ArrowUp") { - e.preventDefault(); - const nextIndex = index > 0 ? index - 1 : 0; - focusableSuggestions[nextIndex].focus(); - } else if (e.key === "ArrowDown") { - e.preventDefault(); - const nextIndex = index + 1 < focusableSuggestions.length ? index + 1 : index; - focusableSuggestions[nextIndex].focus(); - } - } - - search.addEventListener('input', show_results, true); - - function show_results() { - const maxResult = 5; - let searchQuery = this.value; - - if (!searchQuery) { - suggestions.classList.add('d-none'); - suggestions.innerHTML = ""; - return; - } - } -}); - const menuPositioner = () => { const nav = document.querySelectorAll("#sidebar-default")[1] const itemActive = document.querySelectorAll(".sidebar-item-active") From e925179a85cd85f7178af1255d8de789f6515a10 Mon Sep 17 00:00:00 2001 From: Garry Ing Date: Fri, 13 Mar 2026 11:05:11 -0400 Subject: [PATCH 3/3] update script --- content/chainguard/api/spec.md | 1 + layouts/shortcodes/openapi.html | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/content/chainguard/api/spec.md b/content/chainguard/api/spec.md index 9c8d178b3e..0129d409f1 100644 --- a/content/chainguard/api/spec.md +++ b/content/chainguard/api/spec.md @@ -10,6 +10,7 @@ lastmod: 2020-10-06T08:48:23+00:00 draft: false images: [] type: "article" +toc: false weight: 010 --- diff --git a/layouts/shortcodes/openapi.html b/layouts/shortcodes/openapi.html index c06497429a..5f2f992e76 100644 --- a/layouts/shortcodes/openapi.html +++ b/layouts/shortcodes/openapi.html @@ -1,5 +1,9 @@
- +