Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/heyeshuang/hugo-theme-tokiwa.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/index.json5
-rw-r--r--layouts/partials/site-scripts.html4
-rw-r--r--layouts/partials/social-follow.html11
3 files changed, 18 insertions, 2 deletions
diff --git a/layouts/_default/index.json b/layouts/_default/index.json
new file mode 100644
index 0000000..cafad40
--- /dev/null
+++ b/layouts/_default/index.json
@@ -0,0 +1,5 @@
+{{- $.Scratch.Add "index" slice -}}
+{{- range .Site.RegularPages -}}
+ {{- $.Scratch.Add "index" (dict "title" .Title "tags" .Params.tags "categories" .Params.categories "contents" .Plain "permalink" .Permalink "date" .Date "section" .Section) -}}
+{{- end -}}
+{{- $.Scratch.Get "index" | jsonify -}}
diff --git a/layouts/partials/site-scripts.html b/layouts/partials/site-scripts.html
index 4e3b0ea..03c3d73 100644
--- a/layouts/partials/site-scripts.html
+++ b/layouts/partials/site-scripts.html
@@ -1,4 +1,8 @@
{{ $script := .Site.Data.webpack_assets.app }}
{{ with $script.js }}
<script src="{{ relURL (printf "%s%s" "dist/" .) }}"></script>
+{{ end }}
+{{ if .Site.Params.fuse }}
+<script src="/lib/fuse.min.js"></script> <!-- download and copy over fuse.min.js file from fusejs.io -->
+<script src="/lib/fastsearch.js"></script>
{{ end }} \ No newline at end of file
diff --git a/layouts/partials/social-follow.html b/layouts/partials/social-follow.html
index 17d3d1f..70c47b6 100644
--- a/layouts/partials/social-follow.html
+++ b/layouts/partials/social-follow.html
@@ -1,6 +1,6 @@
{{ $count := len .Site.Social}}
-<div class="flex flex-wrap-reverse md:justify-end content-end md:content-start justify-start items-start {{if gt $count 4}}md:flex-col{{end}} pb-2 max-h-16">
+<div class="flex flex-wrap-reverse md:justify-end content-end md:content-start justify-start items-start {{if gt $count 4}}md:flex-col{{end}} max-h-16">
{{ range $key,$value:=.Site.Social }}
<a href='{{$value}}' target="_blank" class="{{- $key}} icon pl-1 text-eucalyptus-400 hover:text-java-400" title="{{- $key}} link" rel="noopener"
aria-label="follow on {{$key}}——Opens in a new window">
@@ -11,4 +11,11 @@
</div>
</a>
{{ end }}
-</div> \ No newline at end of file
+</div>
+{{ if .Site.Params.fuse }}
+<div id="fastSearch" class="mb-2">
+ <ul id="searchResults" class="bg-gray-200 px-2 my-2">
+ </ul>
+ <input id="searchInput" class="bg-gray-100 border-b border-b-1 focus:border-eucalyptus-500 md:text-right px-2" tabindex="0" placeholder="search..." size="10">
+</div>
+{{ end }} \ No newline at end of file