From 71376cfce74cf4e5beb3887534bd8fe7c2d9eaab Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Thu, 5 Feb 2026 17:33:28 +0100 Subject: [PATCH 1/5] agents: add fetch toolset to docs_engineer agent Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> --- docs_engineer.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docs_engineer.yml b/docs_engineer.yml index 736148e3cd0..b383057029d 100644 --- a/docs_engineer.yml +++ b/docs_engineer.yml @@ -290,6 +290,7 @@ agents: toolsets: - type: filesystem + - type: fetch - type: shell - type: todo - type: script From fa18c7f8bfb41540477bbe4972155cef760658c2 Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Thu, 5 Feb 2026 17:56:49 +0000 Subject: [PATCH 2/5] site: upgrade pagefind to v1.5.0-beta.1 Assisted-By: cagent --- Dockerfile | 2 +- netlify.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7a5e0dfe789..f3f69b4f1af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ ARG HTMLTEST_VERSION=0.17.0 ARG VALE_VERSION=3.11.2 ARG HUGO_VERSION=0.154.2 ARG NODE_VERSION=22 -ARG PAGEFIND_VERSION=1.3.0 +ARG PAGEFIND_VERSION=1.5.0-beta.1 # base defines the generic base stage FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS base diff --git a/netlify.toml b/netlify.toml index cb07b6343c9..a55b635e290 100644 --- a/netlify.toml +++ b/netlify.toml @@ -10,4 +10,4 @@ HUGO_ENVIRONMENT = "preview" SECRETS_SCAN_OMIT_PATHS = "public/contribute/file-conventions/index.html" [context.deploy-preview] -command = "hugo --gc --minify -b $DEPLOY_PRIME_URL && ./hack/flatten-and-resolve.js && npx pagefind@v1.3.0" +command = "hugo --gc --minify -b $DEPLOY_PRIME_URL && ./hack/flatten-and-resolve.js && npx pagefind@v1.5.0-beta.1" From 0150180a43df91ded692d222728f2aa1e5724671 Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Thu, 5 Feb 2026 17:56:53 +0000 Subject: [PATCH 3/5] site: remove /search page, redirect to homepage The search functionality is now handled entirely by the modal. Assisted-By: cagent --- content/_index.md | 2 + content/search.md | 7 -- layouts/_default/search.html | 191 ----------------------------------- 3 files changed, 2 insertions(+), 198 deletions(-) delete mode 100644 content/search.md delete mode 100644 layouts/_default/search.html diff --git a/content/_index.md b/content/_index.md index 7de643bad9a..b49f900340d 100644 --- a/content/_index.md +++ b/content/_index.md @@ -2,4 +2,6 @@ title: Home description: Docker Documentation is the official Docker library of resources, manuals, and guides to help you containerize applications. keywords: Docker, documentation, manual, guide, reference, api, samples +aliases: + - /search/ --- diff --git a/content/search.md b/content/search.md deleted file mode 100644 index 59f5903bbb3..00000000000 --- a/content/search.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: Search -layout: search -params: - sitemap: false - icon: search ---- diff --git a/layouts/_default/search.html b/layouts/_default/search.html deleted file mode 100644 index 3192eaadaa4..00000000000 --- a/layouts/_default/search.html +++ /dev/null @@ -1,191 +0,0 @@ -{{ define "left" }}{{ partial "sidebar/mainnav.html" . }}{{ end }} {{ define -"main" }} -
-

{{ .Title }}

- {{ .Content }} -
-
- -
-

- Not finding what you're looking for? Try -

- -
-
-
-
- -
-
-
- -{{ end }} From 42f46c1c5ec3653076401f3f75cfbfb98219a846 Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Thu, 5 Feb 2026 17:56:59 +0000 Subject: [PATCH 4/5] site: implement pagefind component ui for search modal - Add pagefind-component-ui.css and .js assets - Replace search bar with custom button that opens modal - Add custom result template with Tailwind classes - Add dark mode styling for modal and result highlights - Support Cmd/Ctrl+K keyboard shortcut Assisted-By: cagent --- assets/css/pagefind.css | 25 +++ assets/css/style.css | 1 + layouts/partials/head.html | 1 + layouts/partials/search-bar.html | 277 ++++++++++--------------------- 4 files changed, 118 insertions(+), 186 deletions(-) create mode 100644 assets/css/pagefind.css diff --git a/assets/css/pagefind.css b/assets/css/pagefind.css new file mode 100644 index 00000000000..a6619c3b104 --- /dev/null +++ b/assets/css/pagefind.css @@ -0,0 +1,25 @@ +/* Pagefind Component UI Customizations */ + +/* Dark mode variables for modal */ +.dark pagefind-modal { + --pf-text: var(--color-gray-100); + --pf-text-secondary: var(--color-gray-300); + --pf-text-muted: var(--color-gray-400); + --pf-background: var(--color-gray-900); + --pf-border: var(--color-gray-700); + --pf-border-focus: var(--color-blue-400); + --pf-hover: var(--color-gray-800); +} + +/* Highlight marks in results */ +pagefind-results mark { + background-color: var(--color-yellow-200); + color: inherit; + padding: 0 0.125rem; + border-radius: 0.125rem; +} + +.dark pagefind-results mark { + background-color: rgba(255, 204, 72, 0.3); + color: white; +} diff --git a/assets/css/style.css b/assets/css/style.css index 8315621f425..f63fc6f5aec 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -38,6 +38,7 @@ @import "global.css"; } @import "utilities.css"; +@import "pagefind.css"; @import "syntax-dark.css"; @import "syntax-light.css"; @import "components.css"; diff --git a/layouts/partials/head.html b/layouts/partials/head.html index dfc8f368d69..ea19cfcd958 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -5,6 +5,7 @@ {{ end -}} {{ partial "utils/css.html" "-" }} + {{- if hugo.IsProduction -}} - + // Show/hide placeholder based on search state + const instance = getInstanceManager().getInstance('default'); + instance.on('search', (term) => { + placeholder.hidden = !!term; + }); + instance.on('results', () => { + placeholder.hidden = !!instance.searchTerm; + }); + + // Open modal + const openModal = () => modal.open?.(); + document.getElementById('search-modal-trigger').addEventListener('click', openModal); + document.addEventListener('keydown', (e) => { + if ((e.metaKey || e.ctrlKey) && e.key === 'k') { + e.preventDefault(); + openModal(); + } + }); + From 42f7ba20b16835e62027b953d179b698cdee97ca Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Thu, 5 Feb 2026 20:14:49 +0000 Subject: [PATCH 5/5] site: add pagefind metadata for improved search ranking Index description, keywords, and breadcrumbs as Pagefind metadata to improve search result relevance. Configure ranking weights to prioritize title matches and reduce term frequency bias. - Add pagefind-meta.html partial for centralized metadata - Move breadcrumb metadata from breadcrumbs.html to new partial - Configure metaWeights: title (10x), keywords (6x), description (4x) Assisted-By: cagent --- layouts/_default/baseof.html | 1 + layouts/partials/breadcrumbs.html | 8 +------- layouts/partials/pagefind-meta.html | 10 ++++++++++ layouts/partials/search-bar.html | 7 ++++++- 4 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 layouts/partials/pagefind-meta.html diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 946147a21e9..ebb1e7f5d85 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -63,6 +63,7 @@ {{ if ne .Params.sitemap false }}data-pagefind-body{{- end }} class="dark:bg-background-dark w-full min-w-0 bg-white p-8" > + {{ partial "pagefind-meta.html" . }} {{ block "main" . }} {{ end }} diff --git a/layouts/partials/breadcrumbs.html b/layouts/partials/breadcrumbs.html index fc893af263e..7c2ce060db9 100644 --- a/layouts/partials/breadcrumbs.html +++ b/layouts/partials/breadcrumbs.html @@ -1,19 +1,13 @@ diff --git a/layouts/partials/pagefind-meta.html b/layouts/partials/pagefind-meta.html new file mode 100644 index 00000000000..f08a9346e82 --- /dev/null +++ b/layouts/partials/pagefind-meta.html @@ -0,0 +1,10 @@ +{{/* Pagefind metadata - must be inside data-pagefind-body */}} +{{- $description := partial "utils/description.html" . -}} +{{- $keywords := partialCached "utils/keywords.html" . . -}} +{{- $breadcrumbs := slice -}} +{{- range .Ancestors.Reverse -}} + {{- $breadcrumbs = $breadcrumbs | append .LinkTitle -}} +{{- end -}} +{{- with $description }}{{ end }} +{{- with $keywords }}{{ end }} +{{- with $breadcrumbs }}{{ end }} diff --git a/layouts/partials/search-bar.html b/layouts/partials/search-bar.html index 3192fd8a3b1..0d4a6552aa6 100644 --- a/layouts/partials/search-bar.html +++ b/layouts/partials/search-bar.html @@ -23,7 +23,12 @@ termFrequency: 0.0, termSimilarity: 2.0, pageLength: 0.0, - termSaturation: 1.0 + termSaturation: 1.0, + metaWeights: { + title: 10.0, + description: 4.0, + keywords: 6.0 + } } });