From a9b319ad74f853d43c6425162bf7998d3e2314a1 Mon Sep 17 00:00:00 2001 From: Ian Maddaus Date: Mon, 4 Nov 2024 16:35:10 -0500 Subject: [PATCH] Import theme branch for testing Signed-off-by: Ian Maddaus --- .../chef-docs-theme/assets/js/feedback.js | 8 +- .../assets/js/swiftype-config.js | 236 +++++++----- .../chef-docs-theme/assets/js/version-docs.js | 101 ----- .../assets/sass/_homepage.scss | 1 - .../assets/sass/partials/_grid.scss | 3 - .../assets/sass/partials/_sidebar.scss | 11 +- .../sass/partials/_swiftype_search.scss | 354 +++++++++--------- .../assets/sass/partials/_utility-bar.scss | 16 + .../assets/sass/typography/_prose.scss | 25 -- .../layouts/_default/baseof.html | 2 - .../layouts/_default/search.html | 81 ++++ .../layouts/partials/javascript.html | 3 +- .../layouts/partials/sidebar-off-canvas.html | 7 +- .../layouts/partials/sidebar-on-canvas.html | 10 +- .../partials/swiftype_search_modal.html | 91 +---- .../layouts/partials/utility-bar.html | 24 +- .../partials/versioned-docs-content.html | 65 ---- .../partials/versioned-docs-dropdown.html | 47 --- .../layouts/partials/versioned-docs-toc.html | 57 --- _vendor/modules.txt | 2 +- go.mod | 2 +- go.sum | 4 +- 22 files changed, 452 insertions(+), 698 deletions(-) delete mode 100644 _vendor/github.com/chef/chef-docs-theme/assets/js/version-docs.js create mode 100644 _vendor/github.com/chef/chef-docs-theme/layouts/_default/search.html delete mode 100644 _vendor/github.com/chef/chef-docs-theme/layouts/partials/versioned-docs-content.html delete mode 100644 _vendor/github.com/chef/chef-docs-theme/layouts/partials/versioned-docs-dropdown.html delete mode 100644 _vendor/github.com/chef/chef-docs-theme/layouts/partials/versioned-docs-toc.html diff --git a/_vendor/github.com/chef/chef-docs-theme/assets/js/feedback.js b/_vendor/github.com/chef/chef-docs-theme/assets/js/feedback.js index 11179f0c5b..8a8065dd73 100644 --- a/_vendor/github.com/chef/chef-docs-theme/assets/js/feedback.js +++ b/_vendor/github.com/chef/chef-docs-theme/assets/js/feedback.js @@ -104,6 +104,8 @@ function submitContactFormFeedback(event) { .catch((error) => alert(error)); }; -document - .querySelector("#feedback-form") - .addEventListener("submit", submitContactFormFeedback); +const feedbackForm = document.querySelector("#feedback-form"); + +if (feedbackForm) { + feedbackForm.addEventListener("submit", submitContactFormFeedback); +} diff --git a/_vendor/github.com/chef/chef-docs-theme/assets/js/swiftype-config.js b/_vendor/github.com/chef/chef-docs-theme/assets/js/swiftype-config.js index c854cf9728..c8da65fe3d 100644 --- a/_vendor/github.com/chef/chef-docs-theme/assets/js/swiftype-config.js +++ b/_vendor/github.com/chef/chef-docs-theme/assets/js/swiftype-config.js @@ -9,62 +9,136 @@ $(document).ready(function() { - // Swiftype UI elements // + // Retrieve list of default search product keys from search page HTML and parse into JSON array + var defaultSearchProducts = $('#swiftype-search').data('default-search-keys'); - var showSearchModal = function() { - $("#swiftype-modal").show(500); + if (defaultSearchProducts) { + var defaultSearchProducts = JSON.stringify(defaultSearchProducts); + var defaultSearchProducts = JSON.parse(defaultSearchProducts); + } + + /////////////////////////////////// + // + // Search Modal functions + // + /////////////////////////////////// + + function showSearchModal(event) { + $("#swiftype-modal").show(250); $("#swiftype-search-form-modal").focus(); + event.stopPropagation(); } - var hideSearchModal = function() { + function hideSearchModal() { $("#swiftype-modal").hide(250); - $("#swiftype-custom-facets input:checkbox[class='product-filter']").prop( "checked", false ); - window.location.hash = ""; + $('input#swiftype-search-form-modal-input').val(''); } - $("#swiftype-close-button").click(function(){ + // Hide search modal if clicking close button + $("#swiftype-search-close-button").click(function(){ hideSearchModal(); }); - $('body').click(function (event) { - if($('#swiftype-modal').is(":visible") && !$(event.target).closest('#swiftype-modal-content').length && !$(event.target).is('#swiftype-modal-content')) { - hideSearchModal(); + // Hide search modal if it's already visible and click outside modal box + $('body').on('click', function(event) { + if ($('#swiftype-modal').is(':visible') && !$(event.target).closest("#swiftype-modal").length) { + $('#swiftype-modal:visible').hide(); } }); - $("#swiftype-custom-facets-toggle-button").click(function(){ - if ($(window).width() < 768) { - $("#swiftype-custom-facets").toggle(500); - $("#swiftype-custom-facets-toggle-caret").find('svg').toggle(); - } + // Show search modal when clicking on search bar in top nav + $("#swiftype-search-top-nav").click(function(event){ + showSearchModal(event); }); - $('#swiftype-facet-infra').on('change',function(){ - $('#swiftype-facet-client, #swiftype-facet-server').prop('checked',$(this).prop('checked')); + // Clear text in search modal if x button is clicked + $('#swiftype-search-form-modal-input-clear').click(function() { + $('input#swiftype-search-form-modal-input').val(''); + $('input#swiftype-search-form-modal-input').focus(); }); - // trigger hideCustomFacets function after resize ends - var debounce = function(fn, interval) { - let timer; - return function debounced(...args) { - clearTimeout(timer); - timer = setTimeout(function call() { - fn(...args); - }, interval); - }; - } + // on pressing enter key, navigate to search page and submit search string + $("input.swiftype-search-input").on('keypress', function (event) { + if (event.keycode == 13 || event.which == 13) { + event.preventDefault(); + window.location.href = "/search/#stq=" + encodeURIComponent($(this).val()) + '&stp=1'; + hideSearchModal(); + }; + }); + + /////////////////////////////////// + // + // Search Input functions + // + /////////////////////////////////// + + // If x button next to input is clicked: + // Clear search input + // Reset search in URL + // Reset search results + $('input#swiftype-search-top-container-form-input-clear').click(function() { + $('input#swiftype-search-top-container-form-input').val(''); + $('input#swiftype-search-top-container-form-input').focus(); + history.pushState({page: "Chef Documentation Search"}, "", "/search/") + }); - var hideCustomFacets = function() { - if ($(this).width() > 768) { - $('#swiftype-custom-facets').show(); + $("input#swiftype-search-top-container-form-input-search").on('click', function (event) { + console.log('search') + var searchString = $('input#swiftype-search-top-container-form-input').val(); + window.location.href = "/search/#stq=" + encodeURIComponent(searchString) + '&stp=1'; + }); + + /////////////////////////////////// + // + // Search Filter functions + // + /////////////////////////////////// + + // On selecting a checkbox for a versioned product: + // 1. display the version select tag + + // On deselecting a checkbox for a versioned product + // selected versioned checkboxes are deselected + $('.swiftype-product-with-versions').on('change', function(){ + + const versionListId = $($(this).data('version-selector-id')); + + if ($(this).is(':checked')) { + versionListId.show(); } else { - $('#swiftype-custom-facets').hide(); - $("#swiftype-custom-facets-toggle-caret > svg.fa-caret-down").hide(); - $("#swiftype-custom-facets-toggle-caret > svg.fa-caret-up").show(); + versionListId.hide(); } - } - $(window).resize(debounce(hideCustomFacets, 400)); + getChefProducts(); + reloadResults(); + }); + + // When selecting a version option + // 1. regenerate results + $('select.search-facet-versions').on('change', function(){ + getChefProducts(); + reloadResults(); + }); + + // When the product facet checkboxes are checked/unchecked, update the array of products and reload the results + $("#swiftype-custom-facets input:checkbox[class='product-filter']").change(function() { + getChefProducts(); + reloadResults(); + }); + + // "Clear all" button resets search filters + // show hidden products + // hide version checkboxes + // uncheck everything + // reload results + $('#swiftype-clear-all-filters').on('click', function() { + $('#swiftype-custom-facets input[type=checkbox]').prop('checked', false).css('display', 'inline-block'); + $('select.search-facet-versions').css('display', 'none'); + + getChefProducts(); + reloadResults(); + }); + const searchHashRegex = /^#stq./; const searchStringMatchRegex = /^#stq=(.*)/; @@ -79,7 +153,7 @@ $(document).ready(function() { } else { var matchString = decodeURIComponent(hash); }; - $('input#swiftype-search-form-modal').val(matchString); + $('input#swiftype-search-top-container-form-input').val(matchString); }; // Watch for hashchange @@ -89,22 +163,13 @@ $(document).ready(function() { $(window).on('hashchange', function() { if (searchHashRegex.test(window.location.hash)) { processLocationHash(); - showSearchModal(); } }); if (searchHashRegex.test(window.location.hash)) { processLocationHash(); - showSearchModal(); }; - // Autocomplete UI elements - $("input.swiftype-search-input").on('keypress', function (event) { - if (event.keycode == 13 || event.which == 13) { - event.preventDefault(); - window.location.hash = 'stq=' + encodeURIComponent($(this).val()) + '&stp=1'; - }; - }); ///////////////////////// // Handle Search Results @@ -113,14 +178,16 @@ $(document).ready(function() { "facets": {} }; - ///////// - // Handle Regular Search Results - ///////// + // Define default products used in search + searchConfig.facets['chef-products'] = defaultSearchProducts; + var resultTemplate = Hogan.compile([ "
  • ", "", "{{title}}", - "Product: {{product}} {{{sections}}} • {{{body}}}", + "Product: {{product}} ", + "{{{sections}}}", + "{{{body}}}", "", "
  • " ].join('') ); @@ -137,24 +204,26 @@ $(document).ready(function() { return resultTemplate.render(data); }; - // Update the hash value in window.location // + // Update the hash value in window.location var reloadResults = function() { - window.location.hash = window.location.hash.replace(/stp=[^&]*/i, 'stp=1'); // Reset to page 1 + // Reset window to page 1 + window.location.hash = window.location.hash.replace(/stp=[^&]*/i, 'stp=1'); $(window).hashchange(); }; - //Checking the Infra checkbox will also check the Infra Client and Infra Server checkboxes. - $('#swiftype-facet-infra').on('change',function(){ - $('#swiftype-facet-client, #swiftype-facet-server').prop('checked',$(this).prop('checked')); - }); + // Get all Chef products selected in product checkbox field + // If no checkboxes are selected, return the default list of products + var getChefProducts = function(){ + if ($('#swiftype-product-filters :checkbox:checked').length === 0) { + searchConfig.facets['chef-products'] = defaultSearchProducts; + console.log('none checked', $(this)); + } else { + searchConfig.facets['chef-products'] = $("#swiftype-custom-facets input:checkbox[name='chef-product']:checked, select.search-facet-versions:visible option:selected").map(function() { + return $(this).val() + }).get(); + } + }; - // When the product facet checkboxes are checked/unchecked, update the array of products and reload the results - $("#swiftype-custom-facets input:checkbox[class='product-filter']").change(function() { - searchConfig.facets['chef-products'] = $("#swiftype-custom-facets input:checkbox[name='chef-product']:checked").map(function() { - return $(this).val() - }).get(); - reloadResults(); - }); // Returns an array of the chef-products to filter by var readFilters = function () { @@ -172,59 +241,20 @@ $(document).ready(function() { } } - ///////// - // Handle Autocomplete Search Results - ///////// - - var resultAutocompleteTemplate = Hogan.compile([ - "", - "{{title}}", - "{{{sections}}}", - "" - ].join('') ); - - var customAutocompleteFunction = function(document_type, item) { - var - data = { - title: item['title'], - url: item['url'], - sections: item['highlight']['sections'], - }; - return resultAutocompleteTemplate.render(data); - }; - - var autoHighlightFields = { - "page": { - "sections":{"size": 200, "fallback":true}, - "body":{"size": 250, "fallback": true}, - } - } - /* The swiftypeSearch function is from the Swiftype jQuery Plugin - "jquery.swiftype.search.js" https://swiftype.com/documentation/site-search/guides/jquery https://github.com/swiftype/swiftype-search-jquery */ - $('#swiftype-search-form-modal').swiftypeSearch({ + $('#swiftype-search-top-container-form-input').swiftypeSearch({ resultContainingElement: '#swiftype-search-results', engineKey: 'mXqaEKYsv--xS9fcY3Jz', renderFunction: customRenderFunction, facets: { page: ['chef-product'] }, filters: readFilters, - perPage: 8, + perPage: 10, highlightFields: highlightFields, }); - /* - The swiftype function is from the autocomplete plugin - "jquery.swiftype.autocomplete.js" - https://swiftype.com/documentation/site-search/guides/jquery - https://github.com/swiftype/swiftype-autocomplete-jquery - */ - - $('.swiftype-search-autocomplete').swiftype({ - engineKey: 'mXqaEKYsv--xS9fcY3Jz', - highlightFields: autoHighlightFields, - renderFunction: customAutocompleteFunction, - }); }); diff --git a/_vendor/github.com/chef/chef-docs-theme/assets/js/version-docs.js b/_vendor/github.com/chef/chef-docs-theme/assets/js/version-docs.js deleted file mode 100644 index 8aa4b8d959..0000000000 --- a/_vendor/github.com/chef/chef-docs-theme/assets/js/version-docs.js +++ /dev/null @@ -1,101 +0,0 @@ - -// Display text divs with parentClass class and displayClass class -// Hide other text divs with just parentClass class -displayHideTextBlocks = function(displayClass, parentClass){ - for (var i = 0; i < parentClass.length; i++) { - versionedText = parentClass[i]; - versionedTextVersion = parentClass[i].classList[1]; - - if (versionedTextVersion === displayClass) { - versionedText.style.display = "block"; - } else { - versionedText.style.display = "none"; - } - } -} - -// Display correct product/version in dropdown list -changeDropdownListValue = function(version){ - var opts = dropdownId.options.length; - for (var i=0; i." - console.log("This browser does not support Window.localstorage") - }; - - } else { - urlVersion = urlVersion.split("#")[0] - displayHideTextBlocks(urlVersion, versionedTextBlocks) - changeDropdownListValue(urlVersion) - if (typeof(Storage) !== "undefined") { - localStorage.setItem(docsProductVersionKey, urlVersion); - } else { - // If browser does not support Window.localstorage - // Drop a div in between each section of the versioned documentation - // Stating something like "The following is documentation for version x.y of ." - console.log("This browser does not support Window.localstorage") - }; - }; -}; diff --git a/_vendor/github.com/chef/chef-docs-theme/assets/sass/_homepage.scss b/_vendor/github.com/chef/chef-docs-theme/assets/sass/_homepage.scss index d35fceb21a..e7f45b4c1e 100644 --- a/_vendor/github.com/chef/chef-docs-theme/assets/sass/_homepage.scss +++ b/_vendor/github.com/chef/chef-docs-theme/assets/sass/_homepage.scss @@ -59,7 +59,6 @@ .cell{ -webkit-box-shadow: $box-shadow; - -moz-box-shadow: $box-shadow; box-shadow: $box-shadow; border: 1px solid transparent; } diff --git a/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_grid.scss b/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_grid.scss index e3395b6a72..c00d1230dd 100644 --- a/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_grid.scss +++ b/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_grid.scss @@ -28,7 +28,6 @@ display: block; margin: rem-calc(32) auto; -webkit-box-shadow: $box-shadow; - -moz-box-shadow: $box-shadow; box-shadow: $box-shadow; border: 1px solid transparent; padding: 1rem; @@ -49,7 +48,6 @@ text-indent: 0; border: 1px solid transparent; -webkit-box-shadow: $box-shadow; - -moz-box-shadow: $box-shadow; box-shadow: $box-shadow; padding: 0.5rem; margin: rem-calc(32) auto; @@ -71,7 +69,6 @@ padding: 0; border: none; -webkit-box-shadow: none; - -moz-box-shadow: none; box-shadow: none; } } diff --git a/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_sidebar.scss b/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_sidebar.scss index 69086802db..923b78ec30 100644 --- a/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_sidebar.scss +++ b/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_sidebar.scss @@ -1,8 +1,6 @@ #left-nav-on-canvas { - margin-top: .5rem; - padding: rem-calc(18 0); + margin: .5rem 1rem 0 0; z-index: 50; - width: 260px; box-shadow: none; } @@ -36,7 +34,7 @@ z-index: 25; overflow-y: scroll; overflow-x: hidden; - margin: 0 10px; + // margin: 0 10px; &.offCanvas{ width: inherit; } @@ -45,11 +43,11 @@ margin-bottom: 30px; > .accordion-menu { - font-size: rem-calc(14px); + // font-size: 1rem; > li { > a { - font-weight: 700; + font-weight: 600; } a { @@ -60,6 +58,7 @@ &:focus { outline: none; } + padding: .75rem 0 .75rem 1rem; } } diff --git a/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_swiftype_search.scss b/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_swiftype_search.scss index 2fc4228157..037f6fde10 100644 --- a/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_swiftype_search.scss +++ b/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_swiftype_search.scss @@ -1,27 +1,48 @@ #swiftype-modal { - display: none; /* Hidden by default */ - position: fixed; /* Stay in place */ - z-index: 1000; /* Sit on top */ - left: 0; - top: 0; - width: 100%; /* Full width */ - height: 100%; /* Full height */ - background-color: rgb(0,0,0); /* Fallback color */ - background-color: rgba(0,0,0,0.4); /* Black w/ opacity */ + display: none; + background-color: #fefefe; + left: 50%; + top: 100px; + position: absolute; + transform: translate(-50%, -50%); + z-index: 1000; + width: 60%; + box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); + padding: 10px; + font-size: 1rem; &-content { - background-color: #fefefe; - padding: 20px; - border: 1px solid #888; - width: 80%; - height: 90%; - position: fixed; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - overflow-y: hidden; display: flex; - flex-direction: column; + align-items: flex-start; + font-size: 1rem; + + .input-group { + margin: 1rem; + } + + input { + border: 1px solid $border-dark; + } + + #swiftype-search-form-modal-input{ + border-right: none; + padding: 2px; + } + + #swiftype-search-form-modal-input-clear { + background: none; + border-left: none; + padding: 0 10px; + margin-right: 5px; + } + + #swiftype-search-close-button { + display: inline; + vertical-align: text-top; + font-size: 1.5rem; + margin: 0 .5rem 0 .75rem; + } + } } @@ -33,7 +54,7 @@ width: 100%; height: 100%; - #swiftype-modal-content-container{ + #swiftype-content-container{ margin: 0 1rem 1rem 0; overflow-y: hidden; display: flex; @@ -41,27 +62,56 @@ width: 100%; height: 100%; - h3 { - font-size: 1.25rem; - font-weight: 600; - margin-top: 1rem; - padding-top: 0; - display: inline; - position: relative; - } - #swiftype-container-left-sidebar { padding-top: 1rem; flex-grow: 0; + #swiftype-filters-heading{ + border-bottom: 1px solid $border-dark; + padding: 10px 0; + } + + #swiftype-filters-title { + font-size: 1.2rem; + font-weight: 700; + } + + #swiftype-clear-all-filters { + margin-top: 10px; + } + + #swiftype-product-filters{ + border-bottom: 1px solid $border-dark; + padding: 20px 0; + + select { + width: 150px; + border: 1px solid $border-dark; + height: 2rem; + border-radius: $border-radius-base; + } + } + + #search-facet-product { + font-size: 1.2rem; + font-weight: 600; + } + + #swiftype-version-filters { + border-bottom: 1px solid $border-dark; + padding: 20px 0; + } + + .search-facet-versions { + display: none; + margin: 0 0 1rem 1rem; + } + span#swiftype-custom-facets-toggle-caret{ color: $accordionmenu-arrow-color; margin-left: .5rem; } - label { - font-size: .8rem; - } #swiftype-custom-facets{ >ul{ margin: 1em 0; @@ -75,6 +125,13 @@ margin-bottom: .75em; } } + #swiftype-version-filters { + display: none; + + .swiftype-product-versions { + display: none; + } + } } } @@ -86,8 +143,10 @@ flex-grow: 1; padding-top: 16px; - #swiftype-results-heading{ + #swiftype-results-heading { flex-grow: 0; + font-size: 1.5rem; + font-weight: 600; } #swiftype-search-results { overflow-y: scroll; @@ -95,42 +154,52 @@ padding-right: 10px; width: 100%; flex: 1 1 auto; - margin-left: 0; - a { - padding: .5rem 0; + // margin-left: 0; + margin: 0; + + li { + padding: 10px 0; border-bottom: 1px solid $border-dark; - display: block; - width: 100%; - >span { - display: inherit; - overflow: hidden; - &.st-result-title { - font-size: 15px; - font-weight: 500; - line-height: 1.2; - } - &.st-result-detail { - font-size: 12px; - font-weight: 400; - line-height: 1.4; - color:$lightgray; - em { - color: $gray + a { + padding: .5rem 0; + + display: block; + text-decoration: none; + width: 100%; + >span { + display: inherit; + overflow: hidden; + &.st-result-title { + font-size: 1.25rem; + font-weight: 500; + line-height: 1.2; } - >.st-result-highlight-product{ - color:red; + &.detail { + color: $charcoal; + padding: 2px 0; + + em { + font-weight: 500; + + } + } + &.st-result-highlight-product{ + // color:red; display: none; } } } } + >.st-page { - border-bottom: 1px solid $border-dark; - overflow:hidden; + >a { position: relative; border-bottom: none; width: auto; + margin-top: 5px; + padding: 5px 0; + font-size: 1rem; &.st-prev { float: left; } @@ -169,35 +238,59 @@ } /////// -// Search Input +// Swiftype Search /////// -#left-nav-off-canvas-top-bar { - @include top-bar-unstack; - .search { - display: inline-block; - margin-right: 1rem; - } - .close-button { - position: relative; - margin: 0 0 0 1rem; - display: inline-block; - right: 0; - top: 0; +#swiftype-search { + &-top-container { + &-input { + width: 80%; + } + &-form { + border-radius: $border-radius-base; + outline: none; + + &-input { + padding: 10px; + font-size: 1rem; + width: 90%; + border: 1px solid $border-dark; + border-right: none; + height: 2.5rem; + + &-clear { + + font-size: 1rem; + padding: 10px; + border-left: none; + border-right: 1px solid $border-dark; + border-top: 1px solid $border-dark; + border-bottom: 1px solid $border-dark; + + margin-right: 10px; + background-color: $white; + + &:hover { + color: $white; + background-color: $body-font-color; + } + + } + } + } } } + + form > input.swiftype-search { + &-form { + width: 80%; + } + &-input { - padding: 7px 11px 7px 28px; - font-size: 14px; - font-weight: 400; - line-height: 16px; - border-radius: $border-radius-base; - border: 1px solid #ccc; - outline: none; - background: #fcfcfc url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAUFJREFUeNqU0j0oRWEcx/Hj3ifvlMHL7C1lY7mDwUBKkoksBjKJxWIQu7xlOybDLVGukhhMZDFbxGBS8nIjKR3E96nf0dPjuuVfn+6tc35P//P8/yYMw8CpbgygGQlcYw8H+Ai8MvotxQImgt81hk1M4cEPF2IV43jCGo7wjk5MYhhlGMKbG+7BKO4wiGPn8DO1vIN+jGA9fpjQaUksecG4zjGPL3VQ5IZb9OAw+LtO1FkjatxwUuEoTzjSbRu9/xO+0W97nnArqvXuoxve1/9p1OUIlmNGU7EX9+KGt3GKNuyiC5WoQAe2NJFP3PpzzmoR0khpxle6h3pnkeKJPCPjbtglerVFfWhSVxfqJtK4qrChTMY4XdjVm9O21aIA92LrFcv6HHtAsclxQVnxa0WfsqgDUib4X9muStCA2W8BBgDJ0EeGeFZ8WAAAAABJRU5ErkJggg==) no-repeat 5px 8px; + } &-autocomplete { @@ -216,7 +309,7 @@ form > input.swiftype-search { } - #swiftype-close-button { + #swiftype-search-close-button { font-size: .9rem; margin-left: 10px; padding: 6px; @@ -229,104 +322,3 @@ form > input.swiftype-search { } } } - -///// -// Autocomplete Search Results -///// - -.swiftype-widget .autocomplete { - border-radius: $border-radius-base; - background-color: $white; - display: block; - list-style-type: none; - margin: 0; - padding: 0; - -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); - -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); - box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); - position: absolute; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - -ms-border-radius: 3px; - -o-border-radius: 3px; - border-radius: 3px; - text-align: left; -} - -.swiftype-widget .autocomplete ul { - background-color: #fff; - display: block; - list-style-type: none; - margin: 0; - padding: 0; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - -ms-border-radius: 3px; - -o-border-radius: 3px; - border-radius: 3px; - text-align: left; -} - -.swiftype-widget .autocomplete li { - border-top: 1px solid $border; - cursor: pointer; - padding: 10px 8px; - font-size: 12px; - font-weight: 400; - list-style-type: none; - background-image: none; - margin: 0; -} - -.swiftype-widget .autocomplete li:first-child { - -webkit-border-radius: 3px 3px 0 0; - -moz-border-radius: 3px 3px 0 0; - -ms-border-radius: 3px 3px 0 0; - -o-border-radius: 3px 3px 0 0; - border-radius: 3px 3px 0 0; -} - -.swiftype-widget .autocomplete li:last-child { - -webkit-border-radius: 0 0 3px 3px; - -moz-border-radius: 0 0 3px 3px; - -ms-border-radius: 0 0 3px 3px; - -o-border-radius: 0 0 3px 3px; - border-radius: 0 0 3px 3px; -} - -.swiftype-widget .autocomplete li.active { - background-color: $menu-item-background-active; -} - -.swiftype-widget .autocomplete li span { - line-height: 16px; - margin: 0; - padding: 0; - text-overflow: ellipsis; - overflow-x: hidden; - white-space: nowrap; -} - -.swiftype-widget .autocomplete li span.swiftype-auto-result-title{ - font-weight: bold; - color: $blue-darker; - overflow: hidden; - display: block; -} - -.swiftype-widget .autocomplete li span.swiftype-auto-result-detail{ - color: $lightgray; - overflow: hidden; - display: block; -} - - -.swiftype-widget .autocomplete li span.swiftype-auto-result-title em { - color: #0b2644; - font-style: normal; - font-weight: bold; -} - -.swiftype-widget .autocomplete li.active span.swiftype-auto-result-title{ - color: $menu-item-color-active; -} diff --git a/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_utility-bar.scss b/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_utility-bar.scss index de2781d648..7761717936 100644 --- a/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_utility-bar.scss +++ b/_vendor/github.com/chef/chef-docs-theme/assets/sass/partials/_utility-bar.scss @@ -33,6 +33,22 @@ nav#utility-bar { } } } + + } + + button#swiftype-search-magnifying-icon { + border: 1px solid $border; + background-color: $sidebar-gray; + border-radius: $border-radius-base; + padding: .5rem; + margin: .25rem; + &:hover { + color: $blue-darker; + } + #swiftype-search-search-text{ + min-width: 170px; + display: inline-block; + } } button.utility-bar-nav-bars { diff --git a/_vendor/github.com/chef/chef-docs-theme/assets/sass/typography/_prose.scss b/_vendor/github.com/chef/chef-docs-theme/assets/sass/typography/_prose.scss index 627a7a1359..415696345d 100644 --- a/_vendor/github.com/chef/chef-docs-theme/assets/sass/typography/_prose.scss +++ b/_vendor/github.com/chef/chef-docs-theme/assets/sass/typography/_prose.scss @@ -54,31 +54,6 @@ margin-top: 1rem; } } - #chef-product-version-dropdown{ - margin: -12px 0 26px 0; - &-label { - display: inline-block; - font-style: bold; - font-size: 1.25rem; - } - &-select { - display: inline-block; - width: auto; - border-radius: $border-radius-base; - } - } - .chef-product-version{ - &-not-newest{ - background-color: $ash; - padding: 1rem; - margin: 1.5rem; - border: 1px solid lightgray; - border-radius: $border-radius-base; - p { - margin: 0; - } - } - } } .responsive-table { diff --git a/_vendor/github.com/chef/chef-docs-theme/layouts/_default/baseof.html b/_vendor/github.com/chef/chef-docs-theme/layouts/_default/baseof.html index fb1007cd8e..f6361e4c4f 100644 --- a/_vendor/github.com/chef/chef-docs-theme/layouts/_default/baseof.html +++ b/_vendor/github.com/chef/chef-docs-theme/layouts/_default/baseof.html @@ -44,8 +44,6 @@
    {{ partial .Params.toc_layout . }}
    - {{ else if (.Params.version_docs_product)}} - {{ partial "versioned-docs-toc" . }} {{ else }}
    {{ partial "table-of-contents" . }} diff --git a/_vendor/github.com/chef/chef-docs-theme/layouts/_default/search.html b/_vendor/github.com/chef/chef-docs-theme/layouts/_default/search.html new file mode 100644 index 0000000000..25d53d2339 --- /dev/null +++ b/_vendor/github.com/chef/chef-docs-theme/layouts/_default/search.html @@ -0,0 +1,81 @@ +{{ define "main" }} + +{{ $defaultSearchKeys := delimit .Site.Params.search.default_search_product_keys `", "` }} + +{{ end }} diff --git a/_vendor/github.com/chef/chef-docs-theme/layouts/partials/javascript.html b/_vendor/github.com/chef/chef-docs-theme/layouts/partials/javascript.html index 5b4e543e9b..983bee4d96 100644 --- a/_vendor/github.com/chef/chef-docs-theme/layouts/partials/javascript.html +++ b/_vendor/github.com/chef/chef-docs-theme/layouts/partials/javascript.html @@ -25,9 +25,8 @@ {{- $imageModal := resources.Get "js/image-modal.js" -}} {{- $inspecFilter := resources.Get "js/inspec-filter.js" -}} {{- $resourceNote := resources.Get "js/resource-note.js" -}} -{{- $versionDocs := resources.Get "js/version-docs.js" -}} -{{- $customJs := slice $copycodebutton $chefHugo $inspecFilter $resourceNote $versionDocs $feedback $imageModal -}} +{{- $customJs := slice $copycodebutton $chefHugo $inspecFilter $resourceNote $feedback $imageModal -}} {{ if hugo.Environment | eq "development" }} {{- $customJs = $customJs | resources.Concat "js/custom-bundle.js" -}} diff --git a/_vendor/github.com/chef/chef-docs-theme/layouts/partials/sidebar-off-canvas.html b/_vendor/github.com/chef/chef-docs-theme/layouts/partials/sidebar-off-canvas.html index 11744c7b65..5a5cdff1d2 100644 --- a/_vendor/github.com/chef/chef-docs-theme/layouts/partials/sidebar-off-canvas.html +++ b/_vendor/github.com/chef/chef-docs-theme/layouts/partials/sidebar-off-canvas.html @@ -1,12 +1,8 @@ +{{ if ne (.Param "left_nav") false }}
    +{{ end }} \ No newline at end of file diff --git a/_vendor/github.com/chef/chef-docs-theme/layouts/partials/sidebar-on-canvas.html b/_vendor/github.com/chef/chef-docs-theme/layouts/partials/sidebar-on-canvas.html index 3493faaaa5..6872ea10d7 100644 --- a/_vendor/github.com/chef/chef-docs-theme/layouts/partials/sidebar-on-canvas.html +++ b/_vendor/github.com/chef/chef-docs-theme/layouts/partials/sidebar-on-canvas.html @@ -1,14 +1,9 @@ {{ $currentPage := . }} {{ $currentSection := $currentPage.Section }} - +{{ if ne (.Param "left_nav") false }}
    -
    \ No newline at end of file +
    +{{ end }} \ No newline at end of file diff --git a/_vendor/github.com/chef/chef-docs-theme/layouts/partials/swiftype_search_modal.html b/_vendor/github.com/chef/chef-docs-theme/layouts/partials/swiftype_search_modal.html index 8a0d9040e5..acaef20a4f 100644 --- a/_vendor/github.com/chef/chef-docs-theme/layouts/partials/swiftype_search_modal.html +++ b/_vendor/github.com/chef/chef-docs-theme/layouts/partials/swiftype_search_modal.html @@ -1,85 +1,22 @@
    -
    -
    - -
    -
    -
    -
    - -
    - -
    -
      -
    • - -
      -
    • -
    • - -
      -
    • -
    • - -
      -
    • -
    • - -
      -
    • -
    • - -
      -
        -
      • - -
        -
      • -
      • - -
        -
      • -
      -
    • -
    • - -
      -
    • -
    • - -
      -
    • -
    • - -
      -
    • -
    • - -
      -
    • -
    -
    -
    - -
    -

    Search Results

    -
      -
    -
    -
    -
    +
    diff --git a/_vendor/github.com/chef/chef-docs-theme/layouts/partials/utility-bar.html b/_vendor/github.com/chef/chef-docs-theme/layouts/partials/utility-bar.html index d0bda0734f..dede59d0a3 100644 --- a/_vendor/github.com/chef/chef-docs-theme/layouts/partials/utility-bar.html +++ b/_vendor/github.com/chef/chef-docs-theme/layouts/partials/utility-bar.html @@ -1,17 +1,23 @@ -