Browse Source

Init

master
Jan-Lukas Else 1 year ago
commit
0a2d91d414
  1. 11
      config.yaml
  2. 3
      go.mod
  3. 26
      layouts/_default/home.activity.ajson
  4. 15
      layouts/_default/single.activity.ajson

11
config.yaml

@ -0,0 +1,11 @@
outputFormats:
activity:
mediaType: "application/activity+json"
baseName: "index"
isPlainText: true
notAlternative: true
mediaTypes:
application/activity+json:
suffixes:
- ajson

3
go.mod

@ -0,0 +1,3 @@
module codeberg.org/jlelse/hugo-activitystreams
go 1.13

26
layouts/_default/home.activity.ajson

@ -0,0 +1,26 @@
{
"@context": [
"https://www.w3.org/ns/activitystreams"
],
"id": "{{ "" | absLangURL }}",
"type": "Person",
"name": {{ .Site.Title | jsonify }},
"summary": {{ .Site.Params.description | jsonify }},
"preferredUsername": "{{ .Site.Language.Lang }}"
{{ with .Site.Author.avatar -}}
,"icon": {
"type": "Image",
"url": "{{ . | absURL }}"
}
{{- end }}
{{ with .Site.Params.activitypub.inbox -}}
,"inbox": "{{ . }}"
{{- end }}
{{ with .Site.Params.activitypub.publickeypem -}}
,"publicKey": {
"id": "{{ "" | absLangURL }}#main-key",
"owner": "{{ "" | absLangURL }}",
"publicKeyPem": "{{ . }}"
}
{{- end }}
}

15
layouts/_default/single.activity.ajson

@ -0,0 +1,15 @@
{
"@context": [
"https://www.w3.org/ns/activitystreams"
],
"title": {{ .Title | jsonify }},
"content_html": {{ .Content | jsonify }},
"summary": {{ .Summary | jsonify }},
"published": {{ dateFormat "2006-01-02T15:04:05-07:00" .Lastmod | jsonify }},
"updated": {{ dateFormat "2006-01-02T15:04:05-07:00" .Date | jsonify }},
"id": "{{ .Permalink }}",
"url": "{{ .Permalink }}",
"type": "Article",
"attributedTo": "{{ "" | absLangURL }}",
"to": ["https://www.w3.org/ns/activitystreams#Public"]
}
Loading…
Cancel
Save