commit 0a2d91d4145531964f9670e69b0c0ede49177bc2 Author: Jan-Lukas Else Date: Mon Feb 10 17:48:50 2020 +0100 Init diff --git a/config.yaml b/config.yaml new file mode 100644 index 0000000..f3f546b --- /dev/null +++ b/config.yaml @@ -0,0 +1,11 @@ +outputFormats: + activity: + mediaType: "application/activity+json" + baseName: "index" + isPlainText: true + notAlternative: true + +mediaTypes: + application/activity+json: + suffixes: + - ajson \ No newline at end of file diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..4989b5c --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module codeberg.org/jlelse/hugo-activitystreams + +go 1.13 diff --git a/layouts/_default/home.activity.ajson b/layouts/_default/home.activity.ajson new file mode 100644 index 0000000..a6fb944 --- /dev/null +++ b/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 }} +} \ No newline at end of file diff --git a/layouts/_default/single.activity.ajson b/layouts/_default/single.activity.ajson new file mode 100644 index 0000000..3fb4a72 --- /dev/null +++ b/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"] +} \ No newline at end of file