mirror of
https://github.com/Brandon-Rozek/website-theme.git
synced 2025-10-09 10:11:14 +00:00
Cleaning up output format types for JSON
This commit is contained in:
parent
fc0e72ba14
commit
1c8179bae3
7 changed files with 35 additions and 38 deletions
8
layouts/_default/item.json.json
Normal file
8
layouts/_default/item.json.json
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"id": "{{ .Permalink }}",
|
||||
"url": "{{ .Permalink }}",
|
||||
"title": {{ .Title | jsonify }},
|
||||
"content_html": {{ .Content | jsonify }},
|
||||
"date_published": "{{ .Date.Format "2006.01.02" }}",
|
||||
"tags": {{ .Params.tags | jsonify }}
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
{
|
||||
"version": "https://jsonfeed.org/version/1.1",
|
||||
"title": "{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} | {{ end }}{{ .Site.Title }}{{ end }}",
|
||||
"home_page_url": "{{ .Site.BaseURL }}",
|
||||
"feed_url": "{{ .Permalink }}",
|
||||
"description": "{{ .Description }}",
|
||||
"items": [{{ range $index, $page := .Pages }}{{ if ne $index 0 }},{{ end }}
|
||||
{
|
||||
"author": {
|
||||
{{with $.Site.Author.name }}"name": "{{ . }}",{{ end }}
|
||||
"url": "{{ .Site.BaseURL }}"
|
||||
},
|
||||
"id": "{{ $page.Permalink }}",
|
||||
"content_html": {{ $page.Content | jsonify }},
|
||||
"date_published": {{ $page.Date.Format "2006.01.02" | jsonify }},
|
||||
"url": "{{ $page.Permalink }}",
|
||||
"title": {{ $page.Title | jsonify }},
|
||||
"tags": {{ $page.Params.tags | jsonify }}
|
||||
}
|
||||
{{ end }}]
|
||||
}
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
[{{ range $index, $page := .Pages }}{{ if ne $index 0 }},{{ end }}
|
||||
{
|
||||
"ref": "{{ $page.Permalink }}",
|
||||
"title": {{ $page.Title | jsonify }},
|
||||
"section": "{{ $page.Section }}",
|
||||
"tags": {{ $page.Params.tags | jsonify }},
|
||||
"date" : {{ $page.Date.Format "2006.01.02" | jsonify }},
|
||||
"body": {{ $page.Plain | jsonify }}
|
||||
}
|
||||
{{ end }}]
|
20
layouts/_default/list.json.json
Normal file
20
layouts/_default/list.json.json
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"version": "https://jsonfeed.org/version/1.1",
|
||||
"title": "{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} | {{ end }}{{ .Site.Title }}{{ end }}",
|
||||
"home_page_url": "{{ .Site.BaseURL }}",
|
||||
"feed_url": "{{ .Permalink }}",
|
||||
"description": "{{ .Description }}",
|
||||
"icon": "{{ .Site.BaseURL }}img/{{ .Site.Params.avatar }}",
|
||||
"language": "en-US",
|
||||
"authors": [
|
||||
{{with $.Site.Author.name }}
|
||||
{ "name": "{{ . }}" }
|
||||
{{ end }}
|
||||
],
|
||||
"items": [
|
||||
{{ range $index, $page := .Pages }}{{ if ne $index 0 }},{{ end }}
|
||||
{{ .Render "item" }}
|
||||
{{ end }}
|
||||
]
|
||||
}
|
||||
|
1
layouts/_default/single.json.json
Normal file
1
layouts/_default/single.json.json
Normal file
|
@ -0,0 +1 @@
|
|||
{{ .Render "item" }}
|
Loading…
Add table
Add a link
Reference in a new issue