Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions exampleSite/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ maxAge = -1
github_repo = "https://github.com/nginxinc/nginx-hugo-theme"
github_subdir = "exampleSite"
enable_last_modified = true
disable_coveo = true
coveo_search_redirect = "/search.html"
8 changes: 5 additions & 3 deletions layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
</div>
{{ if ( not ( in .Site.Params.buildtype "package" ) ) }}
<!-- Mobile button -->
<label class="header__search--mobile--search--button"for="search-standalone-header-panel" data-testid="header__search--mobile--search--button">
{{ partial "lucide" (dict "context" . "icon" "search") }}
</label>
{{ if not (or (eq .Site.Params.disable_coveo true) (eq .Site.Params.disable_coveo "true")) }}
<label class="header__search--mobile--search--button"for="search-standalone-header-panel" data-testid="header__search--mobile--search--button">
{{ partial "lucide" (dict "context" . "icon" "search") }}
</label>
{{ end }}
<div class="header__search" data-testid="header__search">
<!-- Standalone search box. -->
{{ partial "coveo-atomic-search.html" (dict "id" "search-standalone-header") }}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/meta.html
Original file line number Diff line number Diff line change
Expand Up @@ -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') */}}
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline'
https://consent.trustarc.com/ https://mktg.tags.f5.com/basic/prod/utag.sync.js https://static.cloud.coveo.com/ https://*.f5.com/
https://consent.trustarc.com/ https://mktg.tags.f5.com/basic/prod/utag.sync.js {{ if not (or (eq .Site.Params.disable_coveo true) (eq .Site.Params.disable_coveo "true")) }} https://static.cloud.coveo.com/ {{ end }} https://*.f5.com/
https://*.netlify.app https://gist.github.com
https://tag.demandbase.com/pscSDsz4.min.js
https://munchkin.brightfunnel.com/js/build/bf-munchkin.min.js
Expand Down
7 changes: 3 additions & 4 deletions layouts/partials/scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
{{ end }}

<!-- Coveo Atomic -->
{{ if not (or (eq .Site.Params.disable_coveo true) (eq .Site.Params.disable_coveo "true")) }}
<script
type="module"
src="https://static.cloud.coveo.com/atomic/v3.19.0/atomic.esm.js"
Expand All @@ -40,10 +41,8 @@
{{ $secureCoveo := $.Scratch.Get "coveoSc" | minify | fingerprint "sha512" }}


<script src="{{ $secureCoveo.RelPermalink }}" integrity="{{ $secureCoveo.Data.Integrity }}"
type="text/javascript"></script>


<script src="{{ $secureCoveo.RelPermalink }}" integrity="{{ $secureCoveo.Data.Integrity }}"type="text/javascript"></script>
{{ end }}

<!-- Load the Redoc resources if we're not using Dev Portal for the API reference layout-->
{{ if not ( eq .Site.Params.useDevPortal true ) }}
Expand Down
3 changes: 3 additions & 0 deletions layouts/partials/styles.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@

{{ $cssHighlight := resources.Get "css/v2/highlight.css" | minify | fingerprint "sha512"}}
<link href="{{ $cssHighlight.RelPermalink }}" rel="stylesheet" type="text/css">

<!-- load CSS Atomic CSS -->
{{ if not (or (eq .Site.Params.disable_coveo true) (eq .Site.Params.disable_coveo "true")) }}
<link
rel="stylesheet"
href="https://static.cloud.coveo.com/atomic/v3.19.0/themes/coveo.css"
integrity="sha512-m2BufPi8Tc6H2jcQfDj/PIl5H57C9jeqhbDFgFXKTtOhoC4S7ULXmx74FseZ8WXpfdT9uyccMHDBJDrIZlrUUQ=="
crossorigin="anonymous"/>
{{ end }}
17 changes: 14 additions & 3 deletions layouts/search/single.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
{{ define "main" }}
<section class="search no-sidebar">
{{ partial "coveo-atomic.html" .}}
</section>
{{ if not (or (eq .Site.Params.disable_coveo true) (eq .Site.Params.disable_coveo "true")) }}
<section class="search no-sidebar">
{{ partial "coveo-atomic.html" .}}
</section>
{{ else }}
<div class="content" data-testid="content">
<div class="not-found-container" data-testid="not-found-container">
<h1 class="info-header">
Search functionality is unavailable.
</h1>
<a href="{{ .Site.BaseURL | relLangURL }}" aria-label="Return home">Return to the {{ .Site.Title }} homepage.</a>
</div>
</div>
{{ end }}
{{ end }}
Loading