File tree Expand file tree Collapse file tree 8 files changed +37
-13
lines changed Expand file tree Collapse file tree 8 files changed +37
-13
lines changed Original file line number Diff line number Diff line change @@ -25,5 +25,7 @@ maxAge = -1
2525 github_repo = " https://github.com/nginxinc/nginx-hugo-theme"
2626 github_subdir = " exampleSite"
2727 enable_last_modified = true
28- disable_coveo = true
29- coveo_search_redirect = " /search.html"
28+ coveo_search_redirect = " /search.html"
29+ [params .featureFlags ]
30+ disable_coveo = true
31+ disable_qualtrics = true
Original file line number Diff line number Diff line change @@ -38,7 +38,8 @@ <h1>{{ .Title }}</h1>
3838 {{ end }}
3939
4040 {{ partial "version-list" . }}
41- {{ if .Site.Params.enable_qualtrics }}
41+ {{ $qualtricsEnabled := partial "get-feature-flags.html" "disable_qualtrics" }}
42+ {{ if $qualtricsEnabled }}
4243 {{ partial "qualtrics-feedback.html" }}
4344 {{ end }}
4445 </ article >
Original file line number Diff line number Diff line change 1+ {{- /* Extract parameter with defaults and validation */ -}}
2+ {{- $featureName := . -}}
3+ {{- $featureFlags := site.Params.featureflags -}}
4+ {{- $featureFlagVal := (index $featureFlags $featureName) | default false -}}
5+
6+ {{- if ne (printf "%T" $featureFlagVal) "bool" -}}
7+ {{ errorf "Expected type of feature flag param %s to be boolean." $featureName }}
8+ {{- end -}}
9+
10+ {{- $param := index $featureFlagVal -}}
11+ {{- $result := false -}}
12+ {{- if not (eq $param true) -}}
13+ {{- $result = true -}}
14+ {{- end -}}
15+
16+ {{- return $result -}}
Original file line number Diff line number Diff line change 1212 </ div >
1313 {{ if ( not ( in .Site.Params.buildtype "package" ) ) }}
1414 <!-- Mobile button -->
15- {{ if not (or (eq .Site.Params.disable_coveo true) (eq .Site.Params.disable_coveo "true")) }}
15+ {{ $coveoEnabled := partial "get-feature-flags.html" "disable_coveo" }}
16+ {{ if $coveoEnabled }}
1617 < label class ="header__search--mobile--search--button "for ="search-standalone-header-panel " data-testid ="header__search--mobile--search--button ">
1718 {{ partial "lucide" (dict "context" . "icon" "search") }}
1819 </ label >
Original file line number Diff line number Diff line change 3737< meta http-equiv ="last-modified " content ="{{ .Page.Lastmod.Format "02 /01/2006" }}" />
3838{{ end }}
3939
40-
40+ {{ $coveoEnabled := partial "get-feature-flags.html" "disable_coveo" }}
41+ {{ $qualtricsEnabled := partial "get-feature-flags.html" "disable_qualtrics" }}
4142{{/* 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') */}}
4243< meta http-equiv ="Content-Security-Policy " content ="script-src 'self' 'unsafe-inline'
43- https://consent.trustarc.com/ https://mktg.tags.f5.com/basic/prod/utag.sync.js
44- {{ if not (or (eq .Site.Params.disable_coveo true) (eq .Site.Params.disable_coveo "true ")) }} https://static.cloud.coveo.com/ {{ end }}
44+ https://consent.trustarc.com/
45+ https://mktg.tags.f5.com/basic/prod/utag.sync.js
46+ {{ if $coveoEnabled }}https://static.cloud.coveo.com/{{ end }}
4547 https://*.f5.com/
4648 https://*.netlify.app https://gist.github.com
4749 https://tag.demandbase.com/pscSDsz4.min.js
5456 https://cdn.bizible.com/xdc.js
5557 https://f5networksglobalprod.122.2o7.net/
5658 https://f5networksnginxdocs.122.2o7.net/
57- https://*.siteintercept.qualtrics.com/SIE/?Q_ZID=*
58- https: //siteintercept.qualtrics.com/
59+ {{ if $qualtricsEnabled }} https://*.siteintercept.qualtrics.com/SIE/?Q_ZID=*{{ end }}
60+ {{ if $qualtricsEnabled }} https://siteintercept.qualtrics.com/{{ end }}
5961 {{ if in .Params.doctypes "devportal " }} 'unsafe-eval' {{end}};
6062 worker-src 'self' blob:">
6163{{/* end */}}
Original file line number Diff line number Diff line change 1717{{ end }}
1818
1919<!-- Coveo Atomic -->
20- {{ if not (or (eq .Site.Params.disable_coveo true) (eq .Site.Params.disable_coveo "true")) }}
20+ {{ $coveoEnabled := partial "get-feature-flags.html" "disable_coveo" }}
21+ {{ if $coveoEnabled }}
2122< script
2223 type ="module "
2324 src ="https://static.cloud.coveo.com/atomic/v3.19.0/atomic.esm.js "
4041{{ $.Scratch.Set "coveoSc" $coveo}}
4142{{ $secureCoveo := $.Scratch.Get "coveoSc" | minify | fingerprint "sha512" }}
4243
43-
4444< script src ="{{ $secureCoveo.RelPermalink }} " integrity ="{{ $secureCoveo.Data.Integrity }} "type ="text/javascript "> </ script >
4545{{ end }}
4646
Original file line number Diff line number Diff line change 88< link href ="{{ $cssHighlight.RelPermalink }} " rel ="stylesheet " type ="text/css ">
99
1010<!-- load CSS Atomic CSS -->
11- {{ if not (or (eq .Site.Params.disable_coveo true) (eq .Site.Params.disable_coveo "true")) }}
11+ {{ $coveoEnabled := partial "get-feature-flags.html" "disable_coveo" }}
12+ {{ if $coveoEnabled }}
1213< link
1314 rel ="stylesheet "
1415 href ="https://static.cloud.coveo.com/atomic/v3.19.0/themes/coveo.css "
Original file line number Diff line number Diff line change 11{{ define "main" }}
2- {{ if not (or (eq .Site.Params.disable_coveo true) (eq .Site.Params.disable_coveo "true")) }}
2+ {{ $coveoEnabled := partial "get-feature-flags.html" "disable_coveo" }}
3+ {{ if $coveoEnabled }}
34 < section class ="search no-sidebar ">
45 {{ partial "coveo-atomic.html" .}}
56 </ section >
You can’t perform that action at this time.
0 commit comments