|
| 1 | +{{- $pctx := . -}} |
| 2 | +{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} |
| 3 | +{{- $pages := slice -}} |
| 4 | +{{- if or $.IsHome $.IsSection -}} |
| 5 | +{{- $pages = $pctx.RegularPages -}} |
| 6 | +{{- else -}} |
| 7 | +{{- $pages = $pctx.Pages -}} |
| 8 | +{{- end -}} |
| 9 | +{{- $limit := .Site.Config.Services.RSS.Limit -}} |
| 10 | +{{- if ge $limit 1 -}} |
| 11 | +{{- $pages = $pages | first $limit -}} |
| 12 | +{{- end -}} |
| 13 | +{ |
| 14 | + "@context": "https://www.w3.org/ns/activitystreams", |
| 15 | + "id": "{{ $.Site.BaseURL }}outbox", |
| 16 | + "summary": "{{$.Site.Title}}", |
| 17 | + "type": "OrderedCollection", |
| 18 | + {{ $notdrafts := where $pages ".Draft" "!=" true }} |
| 19 | + {{ $all := where $notdrafts "Type" "in" "posts"}} |
| 20 | + "totalItems": {{(len $all)}}, |
| 21 | + "orderedItems": [ |
| 22 | + {{ range $index, $element := $all }} |
| 23 | + {{- if ne $index 0 }}, {{ end }} |
| 24 | + { |
| 25 | + "@context": "https://www.w3.org/ns/activitystreams", |
| 26 | + "id": "{{.Permalink}}-create", |
| 27 | + "type": "Create", |
| 28 | + "actor": "https://msfjarvis.dev/blog", |
| 29 | + "object": { |
| 30 | + "id": "{{ .Permalink }}", |
| 31 | + "type": "Note", |
| 32 | + "content": "{{.Title}}<br>{{.Summary}}", |
| 33 | + "url": "{{.Permalink}}", |
| 34 | + "attributedTo": "https://msfjarvis.dev/blog", |
| 35 | + "to": "https://www.w3.org/ns/activitystreams#Public", |
| 36 | + "published": {{ dateFormat "2006-01-02T15:04:05-07:00" .Date | jsonify }} |
| 37 | + } |
| 38 | + } |
| 39 | + {{end}} |
| 40 | + ] |
| 41 | +} |
0 commit comments