Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add JSON seaarch index
  • Loading branch information
bep committed Mar 6, 2016
1 parent 6c2842f commit 1d7bf7f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions content/search-index.md
@@ -0,0 +1,6 @@
---
date: 2016-03-05T21:10:52+01:00
type: json
url: index.json
---

2 changes: 1 addition & 1 deletion layouts/index.ace
@@ -1,6 +1,6 @@
= content main
.main.posts
{{ range (.Paginate (where .Data.Pages "Section" "!=" "page")).Pages }}
{{ range (.Paginate (where .Data.Pages "Type" "not in" (slice "page" "json") )).Pages }}
.post
h1.post-title
a href={{ .RelPermalink }} {{ with .Params.title_main}}{{ . | markdownify }}{{ else }}{{ .Title }}{{end}}
Expand Down
5 changes: 5 additions & 0 deletions layouts/json/single.html
@@ -0,0 +1,5 @@
{{- $.Scratch.Add "index" slice -}}
{{- range where .Site.Pages "Type" "not in" (slice "page" "json") -}}
{{- $.Scratch.Add "index" (dict "title" .Title "ref" .Permalink "tags" .Params.tags "content" .Plain) -}}
{{- end -}}
{{- $.Scratch.Get "index" | jsonify -}}

0 comments on commit 1d7bf7f

Please sign in to comment.