Skip to content

Commit 7421ca6

Browse files
committed
Coveo: Refactored error message to be a partial
1 parent 08237b4 commit 7421ca6

File tree

2 files changed

+13
-17
lines changed

2 files changed

+13
-17
lines changed

layouts/partials/search-error.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{{- $isCoveoDefined := . -}}
2+
3+
<div class="content" data-testid="content" id="coveo-error-container" style="{{- if $isCoveoDefined -}}display: none;{{- else -}}{{- end -}}">
4+
<div class="not-found-container" data-testid="not-found-container">
5+
<h1 class="info-header">
6+
Search functionality is unavailable.
7+
</h1>
8+
<a href="{{ site.BaseURL | relLangURL }}" aria-label="Return home">Return to the {{ site.Title }} homepage.</a>
9+
</div>
10+
</div>

layouts/search/single.html

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,10 @@
22
{{ $coveoEnabled := partial "get-feature-flags.html" "disable_coveo" }}
33
{{ if $coveoEnabled }}
44
<section class="search no-sidebar">
5-
{{ partial "coveo-atomic.html" .}}
5+
{{ partial "coveo-atomic.html" . }}
66
</section>
7-
<div class="content" data-testid="content" id="coveo-error-container" style="display: none;">
8-
<div class="not-found-container" data-testid="not-found-container">
9-
<h1 class="info-header">
10-
Search functionality is unavailable.
11-
</h1>
12-
<a href="{{ .Site.BaseURL | relLangURL }}" aria-label="Return home">Return to the {{ .Site.Title }} homepage.</a>
13-
</div>
14-
</div>
7+
{{ partial "search-error.html" true }}
158
{{ else }}
16-
<div class="content" data-testid="content">
17-
<div class="not-found-container" data-testid="not-found-container">
18-
<h1 class="info-header">
19-
Search functionality is unavailable.
20-
</h1>
21-
<a href="{{ .Site.BaseURL | relLangURL }}" aria-label="Return home">Return to the {{ .Site.Title }} homepage.</a>
22-
</div>
23-
</div>
9+
{{ partial "search-error.html" false }}
2410
{{ end }}
2511
{{ end }}

0 commit comments

Comments
 (0)