From 863dccbda8e5c6f7005f35234fb6a916002428d7 Mon Sep 17 00:00:00 2001 From: Ethan Yoo Date: Thu, 29 Dec 2022 09:44:37 -0500 Subject: [PATCH] Add search.html (partial) and index.json (base) --- themes/geronimo/layouts/_default/index.json | 15 ++ themes/geronimo/layouts/partials/search.html | 161 +++++++++++++++++++ 2 files changed, 176 insertions(+) create mode 100644 themes/geronimo/layouts/_default/index.json create mode 100644 themes/geronimo/layouts/partials/search.html diff --git a/themes/geronimo/layouts/_default/index.json b/themes/geronimo/layouts/_default/index.json new file mode 100644 index 0000000..1fa1e32 --- /dev/null +++ b/themes/geronimo/layouts/_default/index.json @@ -0,0 +1,15 @@ +{{/* layouts/_default/index.json */}} +{{- $index := slice -}} +{{- range where .Site.RegularPages.ByDate.Reverse "Type" "not in" (slice "page" "json") -}} + {{ if .Params.dateCreated }} + {{ $.Scratch.Set "date" (.Params.dateCreated) }} + {{ else }} + {{- if isset site.Params "date_format" -}} + {{- $.Scratch.Set "date" (.Date.Format site.Params.date_format) -}} + {{- else -}} + {{- $.Scratch.Set "date" (.Date.Format "2006-01-02") -}} + {{- end -}} + {{ end }} + {{- $index = $index | append (dict "title" ( .Title | plainify ) "permalink" .Permalink "section" (i18n (.Section | title)) "tags" (apply .Params.tags "i18n" "." ) "categories" (apply .Params.categories "i18n" "." ) "summary" (.Params.summary | markdownify | htmlUnescape | plainify) "date" ($.Scratch.Get "date") ) -}} +{{- end -}} +{{- $index | jsonify -}} \ No newline at end of file diff --git a/themes/geronimo/layouts/partials/search.html b/themes/geronimo/layouts/partials/search.html new file mode 100644 index 0000000..32af6bb --- /dev/null +++ b/themes/geronimo/layouts/partials/search.html @@ -0,0 +1,161 @@ + +
+ + +
+ + + + \ No newline at end of file