From d6186c0b6dd6b90585c565161b7de472ec8c5ae6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Wed, 25 Sep 2024 22:50:59 +0200 Subject: [PATCH] search: generate warnings for unsupported output formats #888 --- hugo.toml | 18 ++++++++++++++++++ layouts/partials/search.html | 5 ++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/hugo.toml b/hugo.toml index 2e82bdf341..f99fcd4b35 100644 --- a/hugo.toml +++ b/hugo.toml @@ -15,6 +15,24 @@ permalinkable = false noUgly = true + # unused since 7.0.0 but left in here to generate warnings + [outputFormats.search] + name= "search" + baseName = "index.searchindex" + isHTML = true + mediaType = 'text/html' + permalinkable = false + noUgly = true + + # unused since 7.0.0 but left in here to generate warnings + [outputFormats.searchpage] + name= "searchpage" + baseName = "index.searchpage" + isHTML = true + mediaType = 'text/html' + permalinkable = false + noUgly = true + [params.relearn.dependencies] [params.relearn.dependencies.mathjax] name = "MathJax" diff --git a/layouts/partials/search.html b/layouts/partials/search.html index 2e57e2948a..2fa25e8a5d 100644 --- a/layouts/partials/search.html +++ b/layouts/partials/search.html @@ -2,7 +2,10 @@ {{- $assetBusting := partialCached "assetbusting.gotmpl" . }} {{- $link := "" }} {{- with .Site.Home.OutputFormats.Get "json" }} - {{- warnf "UNSUPPORTED usage of 'json' output format found, use 'search' instead; see https://mcshelby.github.io/hugo-theme-relearn/basics/releasenotes/6/#6-0-0" }} + {{- warnf "UNSUPPORTED usage of 'json' output format found, remove it from your config; see https://mcshelby.github.io/hugo-theme-relearn/basics/releasenotes/7/#7-0-0" }} + {{- end }} + {{- with .Site.Home.OutputFormats.Get "search" }} + {{- warnf "UNSUPPORTED usage of 'search' output format found, remove it from your config; see https://mcshelby.github.io/hugo-theme-relearn/basics/releasenotes/7/#7-0-0" }} {{- end }} {{- with .Site.Home.OutputFormats.Get "searchpage" }} {{- warnf "UNSUPPORTED usage of 'searchpage' output format found, remove it from your config; see https://mcshelby.github.io/hugo-theme-relearn/basics/releasenotes/7/#7-0-0" }}