1
Fork 0

Add search list pages

This commit is contained in:
Jake Howard 2017-09-30 17:37:27 +01:00
parent 9a4039237c
commit 3d5e7d16b8
Signed by: jake
GPG key ID: 57AFB45680EDD477
6 changed files with 45 additions and 10 deletions

6
content/search.md Normal file
View file

@ -0,0 +1,6 @@
---
title: Search
layout: search
---
test

View file

@ -1,15 +1,6 @@
{ {
{{ range $i, $e := .Data.Pages.ByTitle }} {{ range $i, $e := .Data.Pages.ByTitle }}
{{ if $i }}, {{ end }} {{ if $i }}, {{ end }}
"{{ .RelPermalink }}": { {{ partial "page_data.json" . }}
"id": "{{ .UniqueID }}",
"title": "{{ lower .Title }}",
"date": "{{ .Date }}",
"url": "{{ .Permalink }}",
"link": "{{ .RelPermalink }}",
"link_title": "{{ .LinkTitle }}",
"parent": "{{ if .Parent }}{{ lower .Parent.Title }}{{ end }}",
"tags": {{ jsonify .Params.tags }}
}
{{ end }} {{ end }}
} }

View file

@ -0,0 +1,12 @@
{{ partial "page_start.html" . }}
<section id="main" class="container">
{{ partial "content.html" . }}
<div class="row search-results">
{{ $valid_pages := where (where .Site.Pages.ByTitle "Kind" "page") ".Parent" "!=" nil }}
{{ range $valid_pages }}
{{ partial "box_image.html" . }}
{{ end }}
</div>
</section>
{{ partial "page_end.html" . }}

View file

@ -0,0 +1,8 @@
{{ $valid_pages := where (where .Site.Pages.ByTitle "Kind" "page") ".Parent" "!=" nil }}
{
{{ range $i, $e := $valid_pages }}
{{ if $i }}, {{ end }}
{{ partial "page_data.json" . }}
{{ end }}
}

View file

@ -0,0 +1,8 @@
# {{ .Title | plainify }}
{{ .RawContent | safeHTML }}
{{ $valid_pages := where (where .Site.Pages.ByTitle "Kind" "page") ".Parent" "!=" nil }}
{{ range $valid_pages }}
- ![{{ title .LinkTitle }}]({{ .Permalink }})
{{ end }}

View file

@ -0,0 +1,10 @@
"{{ .RelPermalink }}": {
"id": "{{ .UniqueID }}",
"title": "{{ lower .Title }}",
"date": "{{ .Date }}",
"url": "{{ .Permalink }}",
"link": "{{ .RelPermalink }}",
"link_title": "{{ .LinkTitle }}",
"parent": "{{ if .Parent }}{{ lower .Parent.Title }}{{ end }}",
"tags": {{ jsonify .Params.tags }}
}