Remove use of Scratch in search configuration
This commit is contained in:
parent
134b7456b8
commit
68f096fa4c
2 changed files with 1 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
const indexCfg = {{ with .Scratch.Get "bookSearchConfig" }}
|
const indexCfg = {{ with i18n "bookSearchConfig" }}
|
||||||
{{ . }};
|
{{ . }};
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{};
|
{};
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}">
|
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}">
|
||||||
|
|
||||||
{{ if default true .Site.Params.BookSearch }}
|
{{ if default true .Site.Params.BookSearch }}
|
||||||
{{- .Scratch.Set "bookSearchConfig" (i18n "bookSearchConfig") -}} <!-- Remove after https://github.com/gohugoio/hugo/issues/6331 -->
|
|
||||||
{{- $searchJSFile := printf "%s.search.js" .Language.Lang -}}
|
{{- $searchJSFile := printf "%s.search.js" .Language.Lang -}}
|
||||||
{{- $searchJS := resources.Get "search.js" | resources.ExecuteAsTemplate $searchJSFile . | resources.Minify | resources.Fingerprint }}
|
{{- $searchJS := resources.Get "search.js" | resources.ExecuteAsTemplate $searchJSFile . | resources.Minify | resources.Fingerprint }}
|
||||||
<script defer src="{{ $searchJS.RelPermalink }}" integrity="{{ $searchJS.Data.Integrity }}"></script>
|
<script defer src="{{ $searchJS.RelPermalink }}" integrity="{{ $searchJS.Data.Integrity }}"></script>
|
||||||
|
|
Loading…
Reference in a new issue