|
@@ -49,8 +49,8 @@
|
|
|
|
|
|
{{ if ne site.Params.search.engine 0 }}
|
|
|
{{/* Configure search engine. */}}
|
|
|
- {{ $min_length := site.Params.search.academic.min_length | default 1 }}
|
|
|
- {{ $threshold := site.Params.search.academic.threshold | default 0.3 }}
|
|
|
+ {{ $min_length := site.Params.search.wowchemy.min_length | default 1 }}
|
|
|
+ {{ $threshold := site.Params.search.wowchemy.threshold | default 0.3 }}
|
|
|
{{ $search_i18n := dict "placeholder" (i18n "search_placeholder") "results" (i18n "search_results") "no_results" (i18n "search_no_results") }}
|
|
|
{{ $search_config := dict "indexURI" ("/index.json" | relLangURL) "threshold" $threshold "minLength" $min_length }}
|
|
|
<script>
|
|
@@ -152,25 +152,33 @@
|
|
|
<script id="dsq-count-scr" src="https://{{site.Params.comments.disqus.shortname}}.disqus.com/count.js" async></script>
|
|
|
{{ end }}
|
|
|
|
|
|
- {{ $js_comment := printf "/* Wowchemy v%s | https://wowchemy.com/ */\n" site.Data.wowchemy.version }}
|
|
|
- {{ $js_bundle_head := $js_comment | resources.FromString "js/bundle-head.js" }}
|
|
|
+ {{ $js_license := printf "/*! Wowchemy v%s | https://wowchemy.com/ */\n" site.Data.wowchemy.version }}
|
|
|
+ {{ $js_license := $js_license | printf "%s/*! Copyright 2016-present George Cushen (https://georgecushen.com/) */\n" }}
|
|
|
+ {{ $js_license := $js_license | printf "%s/*! License: https://github.com/wowchemy/wowchemy-hugo-modules/blob/master/LICENSE.md */\n" }}
|
|
|
+ {{ $js_bundle_head := $js_license | resources.FromString "js/bundle-head.js" }}
|
|
|
{{ $js_linebreak := "\n" | resources.FromString "js/linebreak.js" }}{{/* Fix no line break after Bootstrap JS causing error. */}}
|
|
|
{{ $js_params := dict "hugoEnvironment" hugo.Environment }}
|
|
|
{{ $js_academic := resources.Get "js/wowchemy.js" | js.Build (dict "params" $js_params) }}
|
|
|
- {{ $js_academic_search := resources.Get "js/wowchemy-search.js" }}
|
|
|
- {{ $js_algolia_search := resources.Get "js/algolia-search.js" }}
|
|
|
{{ $js_bootstrap := resources.Get "js/_vendor/bootstrap.bundle.js" }}
|
|
|
{{ $js_bundle := slice $js_bootstrap $js_linebreak $js_academic }}
|
|
|
{{ if eq site.Params.search.engine 1 }}
|
|
|
+ {{ $js_academic_search := resources.Get "js/wowchemy-search.js" }}
|
|
|
{{ $js_bundle = $js_bundle | append $js_academic_search }}
|
|
|
{{ else if eq site.Params.search.engine 2 }}
|
|
|
+ {{ $js_algolia_search := resources.Get "js/algolia-search.js" }}
|
|
|
{{ $js_bundle = $js_bundle | append $js_algolia_search }}
|
|
|
{{ end }}
|
|
|
{{ range site.Params.plugins_js }}
|
|
|
{{ $js_bundle = $js_bundle | append (resources.Get (printf "js/%s.js" .)) }}
|
|
|
{{ end }}
|
|
|
- {{ $js_bundle := $js_bundle | resources.Concat "js/wowchemy-bundle-pre.js" | minify }}
|
|
|
- {{ $js_bundle := slice $js_bundle_head $js_bundle | resources.Concat "js/wowchemy.min.js" | fingerprint "md5" }}
|
|
|
+ {{ $js_bundle := $js_bundle | resources.Concat "js/wowchemy-bundle-pre.js" }}
|
|
|
+ {{- if eq hugo.Environment "production" -}}
|
|
|
+ {{ $js_bundle = $js_bundle | minify }}
|
|
|
+ {{- end -}}
|
|
|
+ {{ $js_bundle := slice $js_bundle_head $js_bundle | resources.Concat "js/wowchemy.min.js" }}
|
|
|
+ {{- if eq hugo.Environment "production" -}}
|
|
|
+ {{- $js_bundle = $js_bundle | fingerprint "md5" -}}
|
|
|
+ {{- end -}}
|
|
|
<script src="{{ $js_bundle.RelPermalink }}"></script>
|
|
|
|
|
|
{{ partial "custom_js" . }}
|