2024-11-09 20:12:57 +00:00
|
|
|
{{- with .OutputFormats.Get "as2" }}
|
|
|
|
{{- $type := slice }}
|
2024-10-15 08:09:14 +00:00
|
|
|
{
|
|
|
|
"@context": "https://www.w3.org/ns/activitystreams"
|
|
|
|
{{- with .Permalink }},
|
|
|
|
"id": "{{ . }}"
|
|
|
|
{{- end }}
|
2024-11-09 20:12:57 +00:00
|
|
|
{{- if and $.Date $.Title }}
|
|
|
|
{{- $type = $type | append "Article" }}
|
|
|
|
{{- else }}
|
|
|
|
{{- $type = $type | append "Page" }}
|
|
|
|
{{- end }}
|
2024-10-15 08:09:14 +00:00
|
|
|
{{- with $type }}
|
|
|
|
{{- if eq (. | len) 1 }},
|
|
|
|
"type": "{{index . 0}}"
|
|
|
|
{{- else }},
|
|
|
|
"type": {{ . | jsonify }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- if $.Params.title }}
|
|
|
|
{{- with $.Title | jsonify }},
|
|
|
|
"name": {{.}}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- if $.Params.summary }}
|
|
|
|
{{- with $.Summary | jsonify }},
|
|
|
|
"summary": {{.}}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
2024-11-09 20:12:57 +00:00
|
|
|
{{- if $.Params.date }}
|
|
|
|
{{- with $.Date.Format "2006-01-02T15:04:05-07:00" | jsonify }},
|
|
|
|
"published": {{.}}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
2024-10-15 08:09:14 +00:00
|
|
|
{{- with $.Permalink }},
|
|
|
|
"url": {
|
|
|
|
"href": "{{.}}"
|
|
|
|
{{- with $.Language }},
|
|
|
|
"hreflang": "{{.}}"
|
|
|
|
{{- end }},
|
2024-11-09 20:12:57 +00:00
|
|
|
"rel": ["canonical", "alternate"],
|
2024-10-15 08:09:14 +00:00
|
|
|
"mediaType": "text/html"
|
|
|
|
}
|
|
|
|
{{- end }}
|
|
|
|
}
|
2024-11-09 20:12:57 +00:00
|
|
|
{{- end }}
|