From 81fa0bbb360968cfc289f57cd188fd4a9cb9a76f Mon Sep 17 00:00:00 2001 From: Michael Zhang Date: Mon, 1 Nov 2021 00:52:38 -0500 Subject: [PATCH] Mastodon testing --- .editorconfig | 4 ++++ config.toml | 12 ++++++++++++ layouts/_default/section.activitypub.json | 10 ++++++++++ static/.well-known/host-meta | 4 ++++ static/.well-known/webfinger | 16 ++++++++++++++++ static/mastodon/user.json | 17 +++++++++++++++++ 6 files changed, 63 insertions(+) create mode 100644 layouts/_default/section.activitypub.json create mode 100644 static/.well-known/host-meta create mode 100644 static/.well-known/webfinger create mode 100644 static/mastodon/user.json diff --git a/.editorconfig b/.editorconfig index 4266da6..ec6a2b8 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,3 +7,7 @@ trim_trailing_whitespace = true charset = utf-8 indent_style = space indent_size = 4 + +[*.json] +indent_size = 2 + diff --git a/config.toml b/config.toml index 27a505d..6b7c7a6 100644 --- a/config.toml +++ b/config.toml @@ -11,3 +11,15 @@ language = "languages" endLevel = 4 ordered = true startLevel = 2 + +[mediaTypes."application/activitypub"] +suffixes = ["json"] + +[outputs] +section = ["HTML", "ActivityPub"] + +[outputFormats.ActivityPub] +baseName = "ActivityPub" +mediaType = "application/activitypub" +isPlainText = true + diff --git a/layouts/_default/section.activitypub.json b/layouts/_default/section.activitypub.json new file mode 100644 index 0000000..0844e7d --- /dev/null +++ b/layouts/_default/section.activitypub.json @@ -0,0 +1,10 @@ +{ + "posts": [ + {{- range $i, $page := .Pages -}} + {{- if $i -}} , {{- end -}} + { + "title": {{ $page.Title | jsonify }} + } + {{- end -}} + ] +} diff --git a/static/.well-known/host-meta b/static/.well-known/host-meta new file mode 100644 index 0000000..f45bb49 --- /dev/null +++ b/static/.well-known/host-meta @@ -0,0 +1,4 @@ + + + + diff --git a/static/.well-known/webfinger b/static/.well-known/webfinger new file mode 100644 index 0000000..926ba83 --- /dev/null +++ b/static/.well-known/webfinger @@ -0,0 +1,16 @@ +{ + "subject": "acct:blogger@mzhang.io", + "aliases": [], + "links": [ + { + "rel": "http://webfinger.net/rel/profile-page", + "type": "text/html", + "href": "https://mzhang.io" + }, + { + "rel": "self", + "type": "application/activity+json", + "href": "https://mzhang.io/mastodon/user.json" + } + ] +} diff --git a/static/mastodon/user.json b/static/mastodon/user.json new file mode 100644 index 0000000..83ca3ef --- /dev/null +++ b/static/mastodon/user.json @@ -0,0 +1,17 @@ +{ + "@context": [ + "https://www.w3.org/ns/activitystreams" + ], + "id": "https://mzhang.io/mastodon/user.json", + "type": "Person", + "outbox": "https://mzhang.io/posts/activitypub.json", + "name": "Michael Zhang", + "url": "https://mzhang.io", + "attachment": [ + { + "type": "PropertyValue", + "name": "hellosu", + "value": "https://osu.ppy.sh/u/2688103" + } + ] +}