From 1f3addcca5bad9ed12ed3e1df7ba75859c650249 Mon Sep 17 00:00:00 2001 From: Alex Shpak Date: Tue, 16 Jul 2019 14:34:02 +0200 Subject: Implement search, loading on demand --- layouts/partials/docs/html-head.html | 7 +++++-- layouts/partials/docs/search.html | 11 +++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'layouts/partials') 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 }} -{{- $search := resources.Get "search.js" | resources.ExecuteAsTemplate "search.js" . | resources.Minify | resources.Fingerprint }} - +{{ if default true .Site.Params.BookSearch }} +{{- $searchJS := resources.Get "search.js" | resources.ExecuteAsTemplate "search.js" . | resources.Minify | resources.Fingerprint }} + + +{{ end }} diff --git a/layouts/partials/docs/search.html b/layouts/partials/docs/search.html index d4b0e65..6276cc3 100644 --- a/layouts/partials/docs/search.html +++ b/layouts/partials/docs/search.html @@ -1,2 +1,9 @@ - - +{{ if default true .Site.Params.BookSearch }} + +{{ end }} -- cgit v1.2.3