From 218c3569a0ed03788e94667441fe8f5b6de586e7 Mon Sep 17 00:00:00 2001 From: Lam Nguyen Date: Wed, 15 Oct 2025 13:51:30 -0700 Subject: [PATCH 1/6] Coveo: Set usage via flag --- exampleSite/hugo.toml | 1 + layouts/partials/meta.html | 2 +- layouts/partials/scripts.html | 7 +++---- layouts/partials/styles.html | 3 +++ layouts/search/single.html | 17 ++++++++++++++--- 5 files changed, 22 insertions(+), 8 deletions(-) diff --git a/exampleSite/hugo.toml b/exampleSite/hugo.toml index 8bc7b7b0..0bef04da 100644 --- a/exampleSite/hugo.toml +++ b/exampleSite/hugo.toml @@ -25,4 +25,5 @@ maxAge = -1 github_repo = "https://github.com/nginxinc/nginx-hugo-theme" github_subdir = "exampleSite" enable_last_modified = true + enable_coveo = true coveo_search_redirect = "/search.html" \ No newline at end of file diff --git a/layouts/partials/meta.html b/layouts/partials/meta.html index ba01e3ba..120a2ffd 100644 --- a/layouts/partials/meta.html +++ b/layouts/partials/meta.html @@ -40,7 +40,7 @@ {{/* set custom CSP to load styles and scripts with special handling for GTM scripts (requires unsafe-inline) and Dev Portal page(s) (requires 'unsafe-eval') */}} - - + +{{ end }} {{ if not ( eq .Site.Params.useDevPortal true ) }} diff --git a/layouts/partials/styles.html b/layouts/partials/styles.html index 003fabfd..2f3e0fa8 100644 --- a/layouts/partials/styles.html +++ b/layouts/partials/styles.html @@ -6,9 +6,12 @@ {{ $cssHighlight := resources.Get "css/v2/highlight.css" | minify | fingerprint "sha512"}} + +{{ if .Site.Params.enable_coveo }} +{{ end }} \ No newline at end of file diff --git a/layouts/search/single.html b/layouts/search/single.html index 697223bf..0e7e5abe 100644 --- a/layouts/search/single.html +++ b/layouts/search/single.html @@ -1,5 +1,16 @@ {{ define "main" }} - + {{ if .Site.Params.enable_coveo }} + + {{ else }} +
+
+

+ Search functionality is disabled. +

+ Return to the {{ .Site.Title }} homepage. +
+
+ {{ end }} {{ end }} From d1537577fcba305b93ed7374098a528e63fdd6b0 Mon Sep 17 00:00:00 2001 From: Lam Nguyen Date: Wed, 15 Oct 2025 14:17:25 -0700 Subject: [PATCH 2/6] Coveo: Grammar added --- layouts/search/single.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/search/single.html b/layouts/search/single.html index 0e7e5abe..b5b75d90 100644 --- a/layouts/search/single.html +++ b/layouts/search/single.html @@ -7,7 +7,7 @@

- Search functionality is disabled. + Search functionality is unavailable.

Return to the {{ .Site.Title }} homepage.
From 6d35153e71935bd982c34b96cef856a51a51cf92 Mon Sep 17 00:00:00 2001 From: Lam Nguyen Date: Thu, 16 Oct 2025 08:41:37 -0700 Subject: [PATCH 3/6] Coveo: Changed to disable phrasing for flag --- exampleSite/hugo.toml | 2 +- layouts/partials/meta.html | 2 +- layouts/partials/scripts.html | 2 +- layouts/partials/styles.html | 2 +- layouts/search/single.html | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/exampleSite/hugo.toml b/exampleSite/hugo.toml index 0bef04da..21e68bd2 100644 --- a/exampleSite/hugo.toml +++ b/exampleSite/hugo.toml @@ -25,5 +25,5 @@ maxAge = -1 github_repo = "https://github.com/nginxinc/nginx-hugo-theme" github_subdir = "exampleSite" enable_last_modified = true - enable_coveo = true + disable_coveo = true coveo_search_redirect = "/search.html" \ No newline at end of file diff --git a/layouts/partials/meta.html b/layouts/partials/meta.html index 120a2ffd..16f0a688 100644 --- a/layouts/partials/meta.html +++ b/layouts/partials/meta.html @@ -40,7 +40,7 @@ {{/* set custom CSP to load styles and scripts with special handling for GTM scripts (requires unsafe-inline) and Dev Portal page(s) (requires 'unsafe-eval') */}} -{{ if .Site.Params.enable_coveo }} +{{ if eq .Site.Params.disable_coveo false }} {{ partial "coveo-atomic.html" .}} From d0803d13aebdfb3508a359f9c0d467024234a287 Mon Sep 17 00:00:00 2001 From: Lam Nguyen Date: Thu, 16 Oct 2025 09:01:26 -0700 Subject: [PATCH 4/6] Coveo: Rewrite logic --- layouts/partials/meta.html | 2 +- layouts/partials/scripts.html | 2 +- layouts/partials/styles.html | 2 +- layouts/search/single.html | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/layouts/partials/meta.html b/layouts/partials/meta.html index 16f0a688..22cb5dbe 100644 --- a/layouts/partials/meta.html +++ b/layouts/partials/meta.html @@ -40,7 +40,7 @@ {{/* set custom CSP to load styles and scripts with special handling for GTM scripts (requires unsafe-inline) and Dev Portal page(s) (requires 'unsafe-eval') */}} -{{ if eq .Site.Params.disable_coveo false }} +{{ if not (or (eq .Site.Params.disable_coveo true) (eq .Site.Params.disable_coveo "true")) }}