mirror of
https://github.com/Brandon-Rozek/website-theme.git
synced 2024-11-21 07:46:30 -05:00
Reintroducing item factorization
This commit is contained in:
parent
565c349fdd
commit
f08ccf839e
3 changed files with 30 additions and 36 deletions
28
layouts/_default/item.json.json
Normal file
28
layouts/_default/item.json.json
Normal file
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"id": "{{ .Permalink }}",
|
||||
"url": "{{ .Permalink }}",
|
||||
"title": {{ .Title | jsonify }},
|
||||
"authors": [
|
||||
{{with $.Site.Author.name }}
|
||||
{ "name": "{{ . }}" }
|
||||
{{ end }}
|
||||
],
|
||||
"content_html": {{ .Content | jsonify }},
|
||||
"date_published": "{{ .Date.Format "2006.01.02" }}",
|
||||
"tags": {{ .Params.tags | jsonify }},
|
||||
"_syndication": {
|
||||
"mastodon": {
|
||||
"enabled": {{ .Params.mastodon_enabled | default "false" }},
|
||||
"toot_id": {{ .Params.mastodon_toot_id | default "null" }}
|
||||
},
|
||||
"medium": {
|
||||
"enabled": {{ .Params.medium_enabled | default "false" }},
|
||||
"post_id": {{ .Params.medium_post_id | default "null" }}
|
||||
},
|
||||
"substack": {
|
||||
"enabled": {{ .Params.substack_enabled | default "false" }},
|
||||
"post_id": {{ .Params.substack_post_id | default "null" }}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -13,14 +13,7 @@
|
|||
],
|
||||
"items": [
|
||||
{{ range $index, $page := .Pages }}{{ if ne $index 0 }},{{ end }}
|
||||
{
|
||||
"id": "{{ $page.Permalink }}",
|
||||
"url": "{{ $page.Permalink }}",
|
||||
"title": {{ $page.Title | jsonify }},
|
||||
"content_html": {{ $page.Content | jsonify }},
|
||||
"date_published": "{{ $page.Date.Format "2006.01.02" }}",
|
||||
"tags": {{ $page.Params.tags | jsonify }}
|
||||
}
|
||||
{{ .Render "item"}}
|
||||
{{ end }}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -1,28 +1 @@
|
|||
{
|
||||
"id": "{{ .Permalink }}",
|
||||
"url": "{{ .Permalink }}",
|
||||
"title": {{ .Title | jsonify }},
|
||||
"authors": [
|
||||
{{with $.Site.Author.name }}
|
||||
{ "name": "{{ . }}" }
|
||||
{{ end }}
|
||||
],
|
||||
"content_html": {{ .Content | jsonify }},
|
||||
"date_published": "{{ .Date.Format "2006.01.02" }}",
|
||||
"tags": {{ .Params.tags | jsonify }},
|
||||
"_syndication": {
|
||||
"mastodon": {
|
||||
"enabled": {{ .Params.mastodon_enabled | default "false" }},
|
||||
"toot_id": {{ .Params.mastodon_toot_id | default "null" }}
|
||||
},
|
||||
"medium": {
|
||||
"enabled": {{ .Params.medium_enabled | default "false" }},
|
||||
"post_id": {{ .Params.medium_post_id | default "null" }}
|
||||
},
|
||||
"substack": {
|
||||
"enabled": {{ .Params.substack_enabled | default "false" }},
|
||||
"post_id": {{ .Params.substack_post_id | default "null" }}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
{{ .Render "item" }}
|
Loading…
Reference in a new issue