trwnh.com/unified.test.hugo/layouts/_default/index.as2

58 lines
No EOL
1.4 KiB
Text

{{- $as2 := .OutputFormats.Get "as2" -}}
{
"@context": "https://www.w3.org/ns/activitystreams",
"id": "{{$as2.Permalink}}",
"type": "Person",{{/* TODO: make this variable? */}}
{{- with (or .Title .Site.Params.author.name) }}
"name": {{. | jsonify}},
{{- end }}
{{- with (or .Summary .Site.Params.author.summary) }}
"summary": {{. | jsonify}},
{{- end }}
"url": {
"href": "{{ .Permalink }}"
{{- with .Language }},
"hreflang": "{{.}}"
{{- end }},
"rel": ["canonical", "alternate"],
"mediaType": "text/html"
},
"icon": { {{/* TODO: make this variable */}}
"type": "Image",
"name": "a's icon",
"summary": "is this going to work?",
"url": {
"href": "https://trwnh.com/.assets/icon.png",
"name": "icon.png",
"width": 400,
"height": 400,
"mediaType": "image/png"
}
},
{{- with .Site.GetPage "/streams" }}
{{- $streams_as2 := .OutputFormats.Get "as2"}}
"streams": [
{{- range .Pages }}
{{- $stream_as2 := .OutputFormats.Get "as2"}}
{
"id": "{{ $stream_as2.Permalink }}",
"type": "OrderedCollection", {{/* TODO: expose orderedItems? */}}
{{- with .Title }}
"name": {{. | jsonify}},
{{- end }}
{{- with .Summary }}
"summary": {{. | jsonify}},
{{- end }}
"url": {
"href": "{{.Permalink}}"
{{- with .Language }},
"hreflang": "{{.}}"
{{- end }},
"rel": ["canonical", "alternate"],
"mediaType": "text/html"
}
}
{{- end }}
]
{{- end }}
}