diff --git a/content/search.md b/content/search.md new file mode 100644 index 0000000..6738487 --- /dev/null +++ b/content/search.md @@ -0,0 +1,6 @@ +--- +title: Search +layout: search +--- + +test diff --git a/layouts/_default/list.json b/layouts/_default/list.json index 4727dcf..3b4bc06 100644 --- a/layouts/_default/list.json +++ b/layouts/_default/list.json @@ -1,15 +1,6 @@ { {{ range $i, $e := .Data.Pages.ByTitle }} {{ if $i }}, {{ end }} - "{{ .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 }} - } + {{ partial "page_data.json" . }} {{ end }} } diff --git a/layouts/_default/search.html b/layouts/_default/search.html new file mode 100644 index 0000000..a030428 --- /dev/null +++ b/layouts/_default/search.html @@ -0,0 +1,12 @@ +{{ partial "page_start.html" . }} +
+ {{ partial "content.html" . }} + +
+ {{ $valid_pages := where (where .Site.Pages.ByTitle "Kind" "page") ".Parent" "!=" nil }} + {{ range $valid_pages }} + {{ partial "box_image.html" . }} + {{ end }} +
+
+{{ partial "page_end.html" . }} diff --git a/layouts/_default/search.json b/layouts/_default/search.json new file mode 100644 index 0000000..0ed0c07 --- /dev/null +++ b/layouts/_default/search.json @@ -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 }} +} diff --git a/layouts/_default/search.txt b/layouts/_default/search.txt new file mode 100644 index 0000000..3203a3c --- /dev/null +++ b/layouts/_default/search.txt @@ -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 }} diff --git a/layouts/partials/page_data.json b/layouts/partials/page_data.json new file mode 100644 index 0000000..0b59c42 --- /dev/null +++ b/layouts/partials/page_data.json @@ -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 }} +}