diff options
author | Alex Shpak <alex-shpak@users.noreply.github.com> | 2019-07-16 14:34:02 +0200 |
---|---|---|
committer | Alex Shpak <alex-shpak@users.noreply.github.com> | 2019-08-06 11:33:42 +0200 |
commit | 1f3addcca5bad9ed12ed3e1df7ba75859c650249 (patch) | |
tree | 2e277c7fad1f89a4aafcafa89fc269e257540f09 /layouts/partials/docs/html-head.html | |
parent | dda0a0eab19457598b71f2b2b2f978b09d3f95c7 (diff) |
Implement search, loading on demand
Diffstat (limited to 'layouts/partials/docs/html-head.html')
-rw-r--r-- | layouts/partials/docs/html-head.html | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/layouts/partials/docs/html-head.html b/layouts/partials/docs/html-head.html index 805c2b5..68b29bb 100644 --- a/layouts/partials/docs/html-head.html +++ b/layouts/partials/docs/html-head.html @@ -6,8 +6,11 @@ {{- $styles := resources.Get "book.scss" | resources.ToCSS | resources.Minify | resources.Fingerprint }} <link rel="stylesheet" href="{{ $styles.RelPermalink }}"> -{{- $search := resources.Get "search.js" | resources.ExecuteAsTemplate "search.js" . | resources.Minify | resources.Fingerprint }} -<script src="{{ $search.RelPermalink }}"></script> +{{ if default true .Site.Params.BookSearch }} +{{- $searchJS := resources.Get "search.js" | resources.ExecuteAsTemplate "search.js" . | resources.Minify | resources.Fingerprint }} +<script defer src="{{ "lunr.min.js" | relURL }}"></script> +<script defer src="{{ $searchJS.RelPermalink }}"></script> +{{ end }} <!-- Favicon --> <link rel="icon" href="{{ "favicon.png" | relURL }}" type="image/x-icon"> |