diff --git a/hugo.toml b/hugo.toml index 7941ca5098f..195fdf50886 100644 --- a/hugo.toml +++ b/hugo.toml @@ -16,7 +16,7 @@ notAlternative = true [module] [module.hugoVersion] extended = true -min = "0.121.0" +min = "0.124.0" [[module.imports]] path = "github.com/hugomods/i18n-js" diff --git a/layouts/partials/search/assets/js-resource.html b/layouts/partials/search/assets/js-resource.html index 24998aaede6..34727122356 100644 --- a/layouts/partials/search/assets/js-resource.html +++ b/layouts/partials/search/assets/js-resource.html @@ -1,5 +1,4 @@ {{- $defaultLang := .Sites.First.Language.Lang }} -{{- $multihost := partialCached "search/functions/is-multihost" . }} {{- $langs := newScratch }} {{- range .Site.Languages }} {{- $langs.Set .Lang (dict "lang" .Lang "name" .LanguageName) }} @@ -82,7 +81,7 @@ {{- $site := . }} {{- with .Home.OutputFormats.Get "SearchIndex" }} {{- $hash := partialCached "search/functions/search-index-hash" $site $site }} - {{- $indexURL := printf "%s?v=%s" (cond $multihost .Permalink .RelPermalink) $hash }} + {{- $indexURL := printf "%s?v=%s" (cond hugo.IsMultihost .Permalink .RelPermalink) $hash }} {{- $indices = $indices | append $indexURL }} {{- end }} {{- end }} diff --git a/layouts/partials/search/functions/is-multihost.html b/layouts/partials/search/functions/is-multihost.html deleted file mode 100644 index 1e9dd90a4d0..00000000000 --- a/layouts/partials/search/functions/is-multihost.html +++ /dev/null @@ -1,11 +0,0 @@ -{{- $v := false -}} -{{- $host := "" }} -{{- range site.Sites -}} - {{- $url := urls.Parse .Home.Permalink -}} - {{- if and (ne $host "") (ne $url.Host "") (ne $host $url.Host) -}} - {{- $v = true -}} - {{- break -}} - {{- end -}} - {{- $host = $url.Host -}} -{{- end -}} -{{- return $v -}} diff --git a/layouts/partials/search/index.json.html b/layouts/partials/search/index.json.html index 468f95c95f3..e88c573d94d 100644 --- a/layouts/partials/search/index.json.html +++ b/layouts/partials/search/index.json.html @@ -1,5 +1,4 @@ {{- $items := slice -}} -{{- $multihost := partialCached "search/functions/is-multihost" . }} {{- $indexContent := default false site.Params.search.index_content -}} {{- $years := true }} {{- $pages := partial "search/functions/pages" . -}} @@ -13,7 +12,7 @@ {{- end }} {{- $item.Set "kind" .Kind -}} {{- $item.Set "lang" .Language.Lang -}} - {{- $item.Set "url" (cond $multihost .Permalink .RelPermalink) -}} + {{- $item.Set "url" (cond hugo.IsMultihost .Permalink .RelPermalink) -}} {{- $item.Set "date" .Date.Unix -}} {{- if $years -}} {{- $item.Set "year" (.Date.Format "2006") -}} @@ -22,7 +21,7 @@ {{- if or $page.Params.images ($page.Resources.GetMatch "{*feature*,*cover*,*thumbnail*}") -}} {{- with partial "_funcs/get-page-images" $page -}} {{- $img := index . 0 -}} - {{- $item.Set "img" (cond $multihost $img.Permalink $img.RelPermalink) -}} + {{- $item.Set "img" (cond hugo.IsMultihost $img.Permalink $img.RelPermalink) -}} {{- end -}} {{- end -}} {{- $item.Set "headings" (partialCached "search/functions/parse-headings" . .) -}}