From 93d47662b2ce5a6dc4867687386c912e8cd13720 Mon Sep 17 00:00:00 2001 From: Mitja Felicijan Date: Thu, 29 Jun 2023 18:40:17 +0200 Subject: Added search option with lunr.js --- themes/simple/layouts/section/notes.xml | 27 --------------------------- themes/simple/layouts/section/section.json | 5 +++++ themes/simple/layouts/section/section.xml | 27 +++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 27 deletions(-) delete mode 100644 themes/simple/layouts/section/notes.xml create mode 100644 themes/simple/layouts/section/section.json create mode 100644 themes/simple/layouts/section/section.xml (limited to 'themes/simple/layouts/section') diff --git a/themes/simple/layouts/section/notes.xml b/themes/simple/layouts/section/notes.xml deleted file mode 100644 index 889cf08..0000000 --- a/themes/simple/layouts/section/notes.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - {{ .Site.Author.name }}'s Notes - {{ .Permalink }} - {{ .Site.Params.description }} - en-us - - {{ range (where .Site.RegularPages "Section" "notes") }} - - - {{ .Title }} - {{ .Permalink }} - {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} - {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} - {{ .Permalink }} - - {{ " - {{ " - - - {{end}} - - - - diff --git a/themes/simple/layouts/section/section.json b/themes/simple/layouts/section/section.json new file mode 100644 index 0000000..b8f3786 --- /dev/null +++ b/themes/simple/layouts/section/section.json @@ -0,0 +1,5 @@ +{{- $.Scratch.Add "index" slice -}} +{{- range .Site.RegularPages -}} +{{- $.Scratch.Add "index" (dict "title" .Title "tags" .Params.tags "type" .Type "permalink" .RelPermalink "summary" .Summary) -}} +{{- end -}} +{{- $.Scratch.Get "index" | jsonify -}} diff --git a/themes/simple/layouts/section/section.xml b/themes/simple/layouts/section/section.xml new file mode 100644 index 0000000..889cf08 --- /dev/null +++ b/themes/simple/layouts/section/section.xml @@ -0,0 +1,27 @@ + + + + + {{ .Site.Author.name }}'s Notes + {{ .Permalink }} + {{ .Site.Params.description }} + en-us + + {{ range (where .Site.RegularPages "Section" "notes") }} + + + {{ .Title }} + {{ .Permalink }} + {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} + {{ with .Site.Author.email }}{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}{{end}} + {{ .Permalink }} + + {{ " + {{ " + + + {{end}} + + + + -- cgit v1.2.3