From 0e7b701e3fc48667db9f1581e7211fdb65a3226c Mon Sep 17 00:00:00 2001 From: Nathan Melehan Date: Thu, 22 Aug 2024 15:19:21 -0400 Subject: [PATCH] Theme updates (#7088) - Remove tree navigation and search results for API reference - Update header and footer --- .../assets/js/main/navigation/explorer.js | 8 +++++++- .../assets/js/main/search/search-store.js | 10 ++++++---- .../explorer-blank.json | 2 +- .../linode/linode-docs-theme/config.toml | 1 + .../sections/navigation/explorer-hydrated.html | 11 ++++------- .../search/create-cachewarmers-urls.html | 3 ++- .../layouts/partials/sections/search/panel.html | 17 +++++++++++++++-- .../linode/linode-website-partials/footer.html | 3 --- .../linode/linode-website-partials/header.html | 10 ++-------- _vendor/modules.txt | 4 ++-- go.mod | 2 +- go.sum | 3 +++ 12 files changed, 44 insertions(+), 30 deletions(-) diff --git a/_vendor/github.com/linode/linode-docs-theme/assets/js/main/navigation/explorer.js b/_vendor/github.com/linode/linode-docs-theme/assets/js/main/navigation/explorer.js index 6a213115992..c7ed747b30f 100644 --- a/_vendor/github.com/linode/linode-docs-theme/assets/js/main/navigation/explorer.js +++ b/_vendor/github.com/linode/linode-docs-theme/assets/js/main/navigation/explorer.js @@ -132,12 +132,18 @@ export function newSearchExplorerHydrated(searchConfig) { (n) => n.level === 1 && n.key !== 'bundles' && n.key != 'community', ); - // Manually add the product section with count -1 to signal a static link. + // Manually add the product and api section with count -1 to signal a static link. rootNodes.push({ key: 'products', count: -1, level: 1, }); + rootNodes.push({ + key: 'api', + count: -1, + level: 1, + }); + // Apply explorer_icon and weight from searchConfig.sections. rootNodes.forEach((n) => { let section = searchConfig.sections[n.key.toLowerCase()]; 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 83339bc0762..4fbbc9e8985 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 @@ -119,8 +119,8 @@ export function newSearchStore(searchConfig, params, Alpine) { keyOpenStack: [], }, - docsearchLink: function () { - return `https://docsearch.akamai.com/s/global-search/${this.query.lndq}?s=Akamai%20TechDocs&ds=Akamai%20cloud%20computing`; + docsearchLink: function (ds) { + return `https://docsearch.akamai.com/s/global-search/${this.query.lndq}?s=Akamai%20TechDocs&ds=${ds}`; }, shouldShowHydratedExplorer: function () { @@ -378,7 +378,9 @@ export function newSearchStore(searchConfig, params, Alpine) { let q = ''; // TODO(bep) we have removed the QA section from explorer/search, but the // data is still there. The docType filter below can be remove when we have completed the migration. - let filters = sectionConfig.filters || 'NOT docType:community AND NOT docType:products AND NOT docType:Marketplace'; + let filters = + sectionConfig.filters || + 'NOT docType:community AND NOT docType:products AND NOT docType:api AND NOT docType:Marketplace'; let facetFilters = []; let attributesToHighlight = []; let analyticsTags = []; @@ -519,7 +521,7 @@ const normalizeResult = function (self, result) { Object.entries(v).forEach(([kk, vv]) => { // TODO(bep) we have removed the QA and products section from explorer/search, but the // data is still there. The docType filter below can be remove when we have completed the migration. - if (k == 'docType' && (kk == 'community' || kk == 'products')) { + if (k == 'docType' && (kk == 'community' || kk == 'products' || kk == 'api')) { return; } let m = self.metaProvider.getSectionMeta(kk.toLocaleLowerCase()); diff --git a/_vendor/github.com/linode/linode-docs-theme/assets/json/search_cachewarmer_queries/explorer-blank.json b/_vendor/github.com/linode/linode-docs-theme/assets/json/search_cachewarmer_queries/explorer-blank.json index 61bd17d0ec1..1a1c4d84d12 100644 --- a/_vendor/github.com/linode/linode-docs-theme/assets/json/search_cachewarmer_queries/explorer-blank.json +++ b/_vendor/github.com/linode/linode-docs-theme/assets/json/search_cachewarmer_queries/explorer-blank.json @@ -2,5 +2,5 @@ "indexName": "linode-merged", "facets": ["section.*", "docType", "category", "tags"], "distinct": 1, - "filters": "NOT docType:community AND NOT docType:products AND NOT docType:Marketplace" + "filters": "NOT docType:community AND NOT docType:products AND NOT docType:api AND NOT docType:Marketplace" } diff --git a/_vendor/github.com/linode/linode-docs-theme/config.toml b/_vendor/github.com/linode/linode-docs-theme/config.toml index 4121ffa3c01..45e0cea7e2f 100644 --- a/_vendor/github.com/linode/linode-docs-theme/config.toml +++ b/_vendor/github.com/linode/linode-docs-theme/config.toml @@ -70,6 +70,7 @@ explorer_icon = "#icon-explorer--guides" [params.search_config2.sections.api] name = "api" index = "linode-documentation-api" +static_link_url = "https://techdocs.akamai.com/linode-api/reference/api" filters = "section.lvl0:api" weight = 30 title = "API" diff --git a/_vendor/github.com/linode/linode-docs-theme/layouts/partials/sections/navigation/explorer-hydrated.html b/_vendor/github.com/linode/linode-docs-theme/layouts/partials/sections/navigation/explorer-hydrated.html index 48a41cd1e21..d65d6f74af6 100644 --- a/_vendor/github.com/linode/linode-docs-theme/layouts/partials/sections/navigation/explorer-hydrated.html +++ b/_vendor/github.com/linode/linode-docs-theme/layouts/partials/sections/navigation/explorer-hydrated.html @@ -86,7 +86,7 @@
@@ -109,10 +109,7 @@ {{ template "explorer-dynamic-button-toggle" $ }}
- + @@ -143,11 +140,11 @@ 'text-textcolor': ({{ $.n }}.level > 1), 'text-brand': {{ $.n }}.level === 1 && {{ $.n }}.open, 'text-titlecolor': {{ $.n }}.level === 1 && (!{{ $.n }}.open && {{ $.n }}.count > 0), - 'text-gray-300': {{ $.n }}.level === 1 && {{ $.n }}.count <= 0, + 'text-gray-300': {{ $.n }}.level === 1 && ({{ $.n }}.count <= 0 && !{{ $.n }}.static_link_url), 'font-semibold': ({{ $.n }}.level === 1 || ( {{ $.n }}.level > 1 && {{ $.n }}.open )), 'text-sm': ({{ $.n }}.level === 2), 'text-xs': ({{ $.n }}.level > 2), - 'text-gray-300': ({{ $.n }}.count <= 0), + 'text-gray-300': ({{ $.n }}.count <= 0 && !{{ $.n }}.static_link_url), 'explorer-node-open': ({{ $.n }}.level > 1 && {{ $.n }}.open) }">

- Product docs are now on Akamai TechDocs.
+ Product docs and API reference are now on Akamai TechDocs.
Search product docs.” in product docs. +
+ + + Search API reference. + + Search for “” in API reference. +

diff --git a/_vendor/github.com/linode/linode-website-partials/footer.html b/_vendor/github.com/linode/linode-website-partials/footer.html index dfb297f1496..1834a2f8d9f 100644 --- a/_vendor/github.com/linode/linode-website-partials/footer.html +++ b/_vendor/github.com/linode/linode-website-partials/footer.html @@ -105,9 +105,6 @@

Why Choose Us

  • Customer Stories
  • -
  • - Cloud for Business -
  • Our Approach
  • diff --git a/_vendor/github.com/linode/linode-website-partials/header.html b/_vendor/github.com/linode/linode-website-partials/header.html index ad2faefe392..5d80c349735 100644 --- a/_vendor/github.com/linode/linode-website-partials/header.html +++ b/_vendor/github.com/linode/linode-website-partials/header.html @@ -191,9 +191,6 @@
  • Customer Stories
  • -
  • - Cloud for Business -
  • Our Approach
  • @@ -303,7 +300,7 @@ Ansible Collection
  • - Images + Custom Images
  • Integrations @@ -586,9 +583,6 @@
  • Customer Stories
  • -
  • - Cloud for Business -
  • Our Approach
  • @@ -722,7 +716,7 @@
    Developer Tools
    Ansible Collection
  • - Images + Custom Images
  • Integrations diff --git a/_vendor/modules.txt b/_vendor/modules.txt index 8510983518f..256b4e08144 100644 --- a/_vendor/modules.txt +++ b/_vendor/modules.txt @@ -1,5 +1,5 @@ -# github.com/linode/linode-docs-theme v0.0.0-20240814160123-f3130661fabf -# github.com/linode/linode-website-partials v0.0.0-20240516182804-8b13c1f13759 +# github.com/linode/linode-docs-theme v0.0.0-20240822165550-4890fb1bfcb6 +# github.com/linode/linode-website-partials v0.0.0-20240816154606-b7584738bd92 # github.com/gohugoio/hugo-mod-jslibs-dist/alpinejs/v3 v3.21300.20800 # github.com/gohugoio/hugo-mod-jslibs/turbo/v8 v8.20000.20400 # github.com/hotwired/turbo v8.0.4+incompatible diff --git a/go.mod b/go.mod index f97230c99a1..84deb9da795 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-20240814160123-f3130661fabf // indirect + github.com/linode/linode-docs-theme v0.0.0-20240822165550-4890fb1bfcb6 // indirect ) diff --git a/go.sum b/go.sum index 9a3e2b85861..f8b89734cb0 100644 --- a/go.sum +++ b/go.sum @@ -292,6 +292,8 @@ github.com/linode/linode-docs-theme v0.0.0-20240717134034-e8ca2e4ff8e0 h1:u71ng4 github.com/linode/linode-docs-theme v0.0.0-20240717134034-e8ca2e4ff8e0/go.mod h1:VJUOubAM5Rxfw4hPlBH+vQ5H6il0m3k5ZYn9OViz+Ok= github.com/linode/linode-docs-theme v0.0.0-20240814160123-f3130661fabf h1:RETs7qsHPtBAFBRP0S63lGrEAC3S6a9jcHdtRjJIBWI= github.com/linode/linode-docs-theme v0.0.0-20240814160123-f3130661fabf/go.mod h1:VJUOubAM5Rxfw4hPlBH+vQ5H6il0m3k5ZYn9OViz+Ok= +github.com/linode/linode-docs-theme v0.0.0-20240822165550-4890fb1bfcb6 h1:EsZ4rLa/Kw+KwWmkOaW+R9DAIk25b6Gk5Dn4EmLsfIg= +github.com/linode/linode-docs-theme v0.0.0-20240822165550-4890fb1bfcb6/go.mod h1:gLXl9Ywa7Ugh7iGI13bvB7TGqazmpieNOM9gwl1ZnsE= 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= @@ -312,3 +314,4 @@ github.com/linode/linode-website-partials v0.0.0-20240130163753-4a933fe77633/go. github.com/linode/linode-website-partials v0.0.0-20240424162657-dcb8464d17f3/go.mod h1:K1Em3lwb16JiCwNVftAFwWGhyB9Zkl/nXhxjBBUC1Ao= github.com/linode/linode-website-partials v0.0.0-20240426140442-12b76ccbfefd/go.mod h1:K1Em3lwb16JiCwNVftAFwWGhyB9Zkl/nXhxjBBUC1Ao= github.com/linode/linode-website-partials v0.0.0-20240516182804-8b13c1f13759/go.mod h1:K1Em3lwb16JiCwNVftAFwWGhyB9Zkl/nXhxjBBUC1Ao= +github.com/linode/linode-website-partials v0.0.0-20240816154606-b7584738bd92/go.mod h1:K1Em3lwb16JiCwNVftAFwWGhyB9Zkl/nXhxjBBUC1Ao=