aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/_default/index.json
blob: 86be4550d23800839b4f08dffdb22c4ec9b94b8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{
  "version": "https://jsonfeed.org/version/1.1",
  "title": "{{ .Site.Title }}",
  "home_page_url": "{{ .Site.BaseURL }}",
  "feed_url": "{{ .Site.BaseURL }}/index.json",
  "items": [
    {{- range $index, $data := .Site.RegularPages -}}
    {{- if and (ne $data.Type "json") (not .ExpiryDate) (not .Params.unlisted) -}}
    {{- if and $index (gt $index 0) -}},{{- end }}
    {
      "id": "{{ md5 $data.Permalink }}",
      "url": "{{ $data.Permalink }}",
      "title": "{{ $data.Summary | htmlUnescape }}",
      "summary": "{{ $data.Summary | htmlUnescape }}",
      "date_modified": "{{ $data.Date | time.Format "2006-01-02T15:04:05Z" }}",
      "date_published": "{{ $data.PublishDate | time.Format "2006-01-02T15:04:05Z" }}",
      "_metadata": {
        "slug": "{{ $data.Slug }}",
        "type": "{{ $data.Type }}"
      },
      "author": {
        "name": "{{ partial "author-user.html" . }}"
      },
      "tags": [
        {{- range $tags, $tag := $data.Params.tags -}}
          {{- if $tags -}}
          ,
          {{- end -}}
          "
          {{- $tag | htmlEscape -}}
          "
        {{- end -}}
      ],
      "content_text": {{ $data.Plain | jsonify }},
      "content_html": {{ partial "function-content.html" $data | jsonify }}
    }
    {{- end -}}
    {{ end }}
  ]
}