diff --git a/README.md b/README.md index d68939d6..15ba5805 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ Term page: - Minimal design - Responsive - Safari and Firefox Reader View support +- Search - Sections - Single column - Social links @@ -91,6 +92,9 @@ Single pages use the `link` page parameter, if any, as the reference for an anchor around the page title, if any. If the page or site parameter `math` is set to true, math typesetting is enabled with KaTeX. +The `paige_search` layout provides full site search. It requires setting +`outputs.home` to `["html", "json", "rss"]` in `config.yaml`. + If `partials/paige_head_last.html` exists in the site, it is included at the end of the head tag. If `partials/paige_body_last.html` exists in the site, it is included at the end of the body tag. diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index dbb20149..4931b546 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -33,6 +33,15 @@ menu: name: Tags weight: 70 url: /tags/ + - identifier: search + name: Search + weight: 80 + url: /search/ +outputs: + home: + - html + - json + - rss paginate: 50 params: paigehidethemecomment: true diff --git a/exampleSite/content/search.md b/exampleSite/content/search.md new file mode 100644 index 00000000..df56441b --- /dev/null +++ b/exampleSite/content/search.md @@ -0,0 +1,4 @@ +--- +layout: paige_search +title: Search +--- diff --git a/layouts/_default/home.json b/layouts/_default/home.json new file mode 100644 index 00000000..ade5dcf8 --- /dev/null +++ b/layouts/_default/home.json @@ -0,0 +1,5 @@ +{{- $.Scratch.Add "index" slice -}} +{{- range .Site.RegularPages -}} +{{- $.Scratch.Add "index" (dict "title" (.Title | markdownify | plainify | htmlUnescape) "description" (.Description | markdownify | plainify | htmlUnescape) "date" .PublishDate "categories" .Params.categories "tags" .Params.tags "keywords" .Params.keywords "text" (strings.TrimRight " " (replace (.Plain | htmlUnescape) "\n" " ")) "link" .RelPermalink) -}} +{{- end -}} +{{- $.Scratch.Get "index" | jsonify -}} diff --git a/layouts/_default/paige_search.html b/layouts/_default/paige_search.html new file mode 100644 index 00000000..9456fc99 --- /dev/null +++ b/layouts/_default/paige_search.html @@ -0,0 +1,4 @@ +{{ define "main" }} +{{ partial "paige_main.html" . }} +{{ partial "paige_search.html" . }} +{{ end }} diff --git a/layouts/partials/paige_search.html b/layouts/partials/paige_search.html new file mode 100644 index 00000000..f400311c --- /dev/null +++ b/layouts/partials/paige_search.html @@ -0,0 +1,108 @@ +