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") 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/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 1353fd38ce..5f2f992e76 100644 --- a/layouts/shortcodes/openapi.html +++ b/layouts/shortcodes/openapi.html @@ -1,35 +1,94 @@ - - - - - +
+ +