feat: add flexsearch
This commit is contained in:
3
layouts/partials/footer/alert.html
Normal file
3
layouts/partials/footer/alert.html
Normal file
@ -0,0 +1,3 @@
|
||||
<div class="alert alert-primary fixed-bottom text-center" role="alert">
|
||||
{{ .Site.Params.alertText | safeHTML }}
|
||||
</div>
|
@ -2,7 +2,12 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-16 text-center">
|
||||
<p>{{ .Site.Params.footer | safeHTML }}</p>
|
||||
<ul class="list-inline">
|
||||
<!-- <li class="list-inline-item">{{ .Site.Params.footer | safeHTML }}</li> -->
|
||||
<!-- <li class="list-inline-item"><a href="{{ "privacy-policy" | absURL }}">Privacy</a></li> -->
|
||||
<li class="list-inline-item">This site is powered by <a href="https://gohugo.io/">Hugo</a> and the <a href="https://getdoks.org/">Doks</a> theme</li>
|
||||
<!-- <li class="list-inline-item"><a href="https://gethyas.com/">This site is powered by Hyas</a></li> -->
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,11 +1,18 @@
|
||||
{{ $indexTemplate := resources.Get "js/index.js" -}}
|
||||
{{ $index := $indexTemplate | resources.ExecuteAsTemplate "index.js" . -}}
|
||||
{{ $lazysizes := resources.Get "js/vendor/lazysizes/lazysizes.min.js" -}}
|
||||
{{ $flexsearch := resources.Get "js/vendor/flexsearch/dist/flexsearch.min.js" -}}
|
||||
{{ if eq (hugo.Environment) "development" -}}
|
||||
{{ $app := resources.Get "js/app.js" -}}
|
||||
{{ $js := slice $lazysizes $app | resources.Concat "main.js" -}}
|
||||
{{ $js := slice $lazysizes $flexsearch $app | resources.Concat "main.js" -}}
|
||||
<script src="{{ $index.Permalink }}" defer></script>
|
||||
<script src="{{ $js.Permalink }}" defer></script>
|
||||
{{ else -}}
|
||||
{{ $instantPage := resources.Get "js/vendor/instant.page/instantpage.js" | minify -}}
|
||||
{{ $app := resources.Get "js/app.js" | minify -}}
|
||||
{{ $js := slice $lazysizes $app | resources.Concat "main.js" -}}
|
||||
{{ $secureJS := $js | resources.Fingerprint "sha512" -}}
|
||||
<script src="{{ $secureJS.Permalink }}" integrity="{{ $secureJS.Data.Integrity }}" crossorigin="anonymous" defer></script>
|
||||
{{ $js := slice $lazysizes $flexsearch $instantPage $app | resources.Concat "main.js" -}}
|
||||
{{ $jsProd := $js | resources.Fingerprint "sha512" -}}
|
||||
{{ $indexProd := $index | resources.Minify | resources.Fingerprint "sha512" -}}
|
||||
<script src="{{ $indexProd.Permalink }}" integrity="{{ $indexProd.Data.Integrity }}" crossorigin="anonymous" defer></script>
|
||||
<script src="{{ $jsProd.Permalink }}" integrity="{{ $jsProd.Data.Integrity }}" crossorigin="anonymous" defer></script>
|
||||
{{ end -}}
|
Reference in New Issue
Block a user