Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,16 @@ url = "/index.xml"
[taxonomies]
tag = "tags"
category = "categories"

[mediaTypes]
[mediaTypes."application/activity+json"]
suffixes = ["ajson"]

[outputFormats]
[outputFormats.ACTIVITY_OUTBOX]
mediaType = "application/activity+json"
notAlternative = true
baseName = "outbox"

[outputs]
home = ["HTML", "RSS", "ACTIVITY_OUTBOX"]
41 changes: 41 additions & 0 deletions layouts/index.activity_outbox.ajson
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{{- $pctx := . -}}
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
{{- $pages := slice -}}
{{- if or $.IsHome $.IsSection -}}
{{- $pages = $pctx.RegularPages -}}
{{- else -}}
{{- $pages = $pctx.Pages -}}
{{- end -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}}
{{- $pages = $pages | first $limit -}}
{{- end -}}
{
"@context": "https://www.w3.org/ns/activitystreams",
"id": "{{ $.Site.BaseURL }}outbox",
"summary": "{{$.Site.Title}}",
"type": "OrderedCollection",
{{ $notdrafts := where $pages ".Draft" "!=" true }}
{{ $all := where $notdrafts "Type" "in" "posts"}}
"totalItems": {{(len $all)}},
"orderedItems": [
{{ range $index, $element := $all }}
{{- if ne $index 0 }}, {{ end }}
{
"@context": "https://www.w3.org/ns/activitystreams",
"id": "{{.Permalink}}-create",
"type": "Create",
"actor": "https://msfjarvis.dev/blog",
"object": {
"id": "{{ .Permalink }}",
"type": "Note",
"content": "{{.Title}}<br>{{.Summary}}",
"url": "{{.Permalink}}",
"attributedTo": "https://msfjarvis.dev/blog",
"to": "https://www.w3.org/ns/activitystreams#Public",
"published": {{ dateFormat "2006-01-02T15:04:05-07:00" .Date | jsonify }}
}
}
{{end}}
]
}
14 changes: 10 additions & 4 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ NODE_VERSION = "18"
path = "/*"
function = "root"

[[edge_functions]]
function = "webfinger"
path = "/.well-known/webfinger"

[[redirects]]
from = "/robots.txt"
to = "/robots.txt"
Expand Down Expand Up @@ -49,3 +45,13 @@ X-XSS-Protection = '1; mode=block'
for = "/pretty-feed-v3.xsl"
[headers.values]
Content-Type = "application/xml; charset=utf-8"

[[headers]]
for = "/@blog"
[headers.values]
Content-Type = "application/activity+json; charset=utf-8"

[[headers]]
for = "/outbox.ajson"
[headers.values]
Content-Type = "application/activity+json; charset=utf-8"
50 changes: 0 additions & 50 deletions netlify/edge-functions/webfinger/webfinger.ts

This file was deleted.

18 changes: 18 additions & 0 deletions static/.well-known/webfinger
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"subject": "acct:blog@msfjarvis.dev",
"aliases": [
"https://msfjarvis.dev/@blog"
],
"links": [
{
"rel": "self",
"type": "application/activity+json",
"href": "https://msfjarvis.dev/@blog"
},
{
"rel":"http://webfinger.net/rel/profile-page",
"type":"text/html",
"href":"https://msfjarvis.dev/"
}
]
}
44 changes: 44 additions & 0 deletions static/@blog
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"@context": "https://www.w3.org/ns/activitystreams",
"id": "https://msfjarvis.dev/@blog",
"type": "Person",
"following": "https://androiddev.social/users/msfjarvis/following",
"followers": "https://androiddev.social/users/msfjarvis/followers",
"inbox": "https://activitypubdotnet.azurewebsites.net/api/Inbox",
"outbox": "https://msfjarvis.dev/socialweb/outbox",
"preferredUsername": "blog",
"name": "Harsh Shandilya - Blog",
"summary": "Ramblings of a recovering Android engineer",
"url": "https://msfjarvis.dev/",
"discoverable": true,
"memorial": false,
"icon": {
"type": "Image",
"mediaType": "image/webp",
"url": "https://msfjarvis.dev/android-chrome-512x512.webp"
},
"image": {
"type": "Image",
"mediaType": "image/webp",
"url": "https://msfjarvis.dev/android-chrome-512x512.webp"
},
"publicKey": {
"@context": "https://w3id.org/security/v1",
"@type": "Key",
"id": "https://msfjarvis.dev/@blog#main-key",
"owner": "https://msfjarvis.dev/@blog",
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAo6NNG4RG9L2gMsfqq8iB\nIa9Vw5BNliD8RJDO7AShupqRAbgjeRyO7xjat//fwlwVRArNEVmBlfHouPCWNNWb\nuEQEJhYYWbrXPE2qiggtUuKT+yfOrt9cmj2wZFuTwc7ZjCq3QbIiidrh9SXuZJZm\n8bRZB3RHfv1WZPFx/YOthmQysBfTkPp6ifE+s9GA0yUUA39ezOfKGzrI6phxxb7W\n2w4PcQFAvwZMlbEBsIv5YIBScMpTATA23bzyx5P2LzOvApJxppx8erU/ViqoQBab\nKJkSFta+9YlbYsC+hrKJX5FAjZHeOp4HZ1AkpghB92AUNYGXVKQMiDbcGRbAUKWF\nIpWvveC+MzkLd9jc2C0UJVY+Lfo97CdySf6+hHIiIZuKJc9wfRAA1MghQZ95Xu7Y\nv/eLNystOmJR91kwBoDI2cMB3aGANGw4odNUI7El00BiDhpwsXSwcEg9tLvoTHPW\nQa6TGutaWjj1RYvtjGvH39ov3uyW10eWaEoN/arlUKerYfNu0pSdME/9Bj6y86aA\nR2+k9kXOapc4IMt4aHr3lBbDE8GUIcv71MBt5HQjwi3gmwGavWu6Da2M4teHnEvK\nJhZCAXC1ptBvJd1WygtCFpyeSANFoev/uJzcRn4abcDxEw2b9b1bKLIbrIpgzHSN\no2IKVhP+FPukC1GaeB0ki1ECAwEAAQ==\n-----END PUBLIC KEY-----"
},
"attachment": [
{
"type": "PropertyValue",
"name": "Blog",
"value": "<a href=\"https://msfjarvis.dev\" target=\"_blank\" rel=\"nofollow noopener noreferrer me\" translate=\"no\"><span class=\"invisible\">https://</span><span class=\"\">msfjarvis.dev</span><span class=\"invisible\"></span></a>"
},
{
"type": "PropertyValue",
"name": "GitHub",
"value": "<a href=\"https://github.com/msfjarvis\" target=\"_blank\" rel=\"nofollow noopener noreferrer me\" translate=\"no\"><span class=\"invisible\">https://</span><span class=\"\">github.com/msfjarvis</span><span class=\"invisible\"></span></a>"
}
]
}