From 8aeb69fa56e8b8a8bcbd8cf2fa795dae763f87c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Sun, 20 Nov 2022 23:00:40 +0100 Subject: [PATCH] search: make build and js forgiving against config errors #400 --- layouts/partials/search.html | 6 ++++-- static/js/search.js | 2 +- static/js/theme.js | 3 +++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/layouts/partials/search.html b/layouts/partials/search.html index 4605958e7a..1813289f6f 100644 --- a/layouts/partials/search.html +++ b/layouts/partials/search.html @@ -1,6 +1,8 @@ {{- $link := "" }} - {{- with .Site.Home.OutputFormats.Get "SEARCHPAGE" }} - {{- $link = partial "relLangPrettyUglyURL.hugo" (dict "to" .) }} + {{- if or (.Site.Home.OutputFormats.Get "JSON") (.Site.Home.OutputFormats.Get "SEARCH") }} + {{- with .Site.Home.OutputFormats.Get "SEARCHPAGE" }} + {{- $link = partial "relLangPrettyUglyURL.hugo" (dict "to" .) }} + {{- end }} {{- end }} {{- $c:="" }} {{ if $link }}
{{ end }}