feat(search): add local search (#231)

* feat(search): add local search

* docs: add docs for search
This commit is contained in:
Dillon
2020-04-15 15:46:50 +08:00
committed by GitHub
parent b6ce753ae7
commit 90184ca3e7
92 changed files with 4843 additions and 1214 deletions

View File

@@ -1,5 +1,6 @@
{{- $scratch := .Scratch.Get "scratch" -}}
{{- $CDN := $scratch.Get "CDN" -}}
{{- $fingerprint := $scratch.Get "fingerprint" -}}
<link rel="canonical" href="{{ .Permalink }}" />
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
@@ -22,29 +23,17 @@
{{- end -}}
{{- /* Font Awesome */ -}}
{{- with $CDN.fontawesomeFreeCSS -}}
{{- . | safeHTML -}}
{{- else -}}
{{- $res := resources.Get "lib/fontawesome-free/all.min.css" -}}
{{- $stylesheet := dict "resource" $res "fingerprint" ($scratch.Get "fingerprint") -}}
{{- partial "plugin/stylesheet.html" $stylesheet -}}
{{- end -}}
{{- $source := $CDN.fontawesomeFreeCSS | default "lib/fontawesome-free/all.min.css" -}}
{{- $stylesheet := dict "source" $source "fingerprint" $fingerprint -}}
{{- partial "plugin/stylesheet.html" $stylesheet -}}
{{- /* Animate.css */ -}}
{{- with $CDN.animateCSS -}}
{{- . | safeHTML -}}
{{- else -}}
{{- $res := resources.Get "lib/animate/animate.min.css" -}}
{{- $stylesheet := dict "resource" $res "fingerprint" ($scratch.Get "fingerprint") -}}
{{- partial "plugin/stylesheet.html" $stylesheet -}}
{{- end -}}
{{- $source := $CDN.animateCSS | default "lib/animate/animate.min.css" -}}
{{- $stylesheet := dict "source" $source "fingerprint" $fingerprint -}}
{{- partial "plugin/stylesheet.html" $stylesheet -}}
{{- /* style.min.css */ -}}
{{- $res := resources.Get "css/style.template.scss" -}}
{{- $options := dict "targetPath" "css/style.min.css" -}}
{{- $options = dict "includePaths" (slice "config/css") | merge $options -}}
{{- $options = dict "outputStyle" "compressed" | merge $options -}}
{{- $options = dict "enableSourceMap" true | merge $options -}}
{{- $res = resources.ExecuteAsTemplate "style.scss" . $res | toCSS $options -}}
{{- $stylesheet := dict "resource" $res "fingerprint" ($scratch.Get "fingerprint") -}}
{{- $stylesheet := dict "source" "css/style.template.scss" "fingerprint" $fingerprint -}}
{{- $options := dict "targetPath" "css/style.min.css" "includePaths" (slice "config/css") -}}
{{- $stylesheet = dict "template" "style.scss" "context" . "toCSS" $options | merge $stylesheet -}}
{{- partial "plugin/stylesheet.html" $stylesheet -}}