Compare commits
3 Commits
320ba3fc67
...
88212c3981
Author | SHA1 | Date |
---|---|---|
Shadowfacts | 88212c3981 | |
Shadowfacts | c5dd73a3a9 | |
Shadowfacts | e4b3a5f68d |
|
@ -14,11 +14,11 @@ export default async function activitypub(posts: Page[]) {
|
||||||
name: base,
|
name: base,
|
||||||
ext: ".json"
|
ext: ".json"
|
||||||
});
|
});
|
||||||
util.write(dest, JSON.stringify(object));
|
const data = JSON.stringify(object);
|
||||||
|
util.write(dest, data);
|
||||||
|
util.write(path.join(post.metadata.permalink, "index.html.json"), data);
|
||||||
}
|
}
|
||||||
|
|
||||||
util.write("ap/actor", JSON.stringify(actorObject()))
|
|
||||||
|
|
||||||
util.write(".well-known/webfinger", JSON.stringify(webfingerObject()));
|
util.write(".well-known/webfinger", JSON.stringify(webfingerObject()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ function postObject(post: Page): object {
|
||||||
"https://www.w3.org/ns/activitystreams"
|
"https://www.w3.org/ns/activitystreams"
|
||||||
],
|
],
|
||||||
"type": "Article",
|
"type": "Article",
|
||||||
"id": `https://${baseURL}${postMeta.permalink}.json`,
|
"id": `https://${baseURL}${post.metadata.permalink}`,
|
||||||
"published": (<Date>postMeta.date).toISOString(),
|
"published": (<Date>postMeta.date).toISOString(),
|
||||||
"inReplyTo": null,
|
"inReplyTo": null,
|
||||||
"url": `https://${baseURL}${postMeta.permalink}`,
|
"url": `https://${baseURL}${postMeta.permalink}`,
|
||||||
|
@ -37,47 +37,14 @@ function postObject(post: Page): object {
|
||||||
"to": [
|
"to": [
|
||||||
"https://www.w3.org/ns/activitystreams#Public"
|
"https://www.w3.org/ns/activitystreams#Public"
|
||||||
],
|
],
|
||||||
"cc": [],
|
"cc": [
|
||||||
|
`https://${baseURL}/ap/followers`
|
||||||
|
],
|
||||||
"name": postMeta.title,
|
"name": postMeta.title,
|
||||||
"content": post.text
|
"content": post.text
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function actorObject() {
|
|
||||||
return {
|
|
||||||
"@context": [
|
|
||||||
"https://www.w3.org/ns/activitystreams",
|
|
||||||
"https://w3id.org/security/v1"
|
|
||||||
],
|
|
||||||
"type": "Person",
|
|
||||||
"id": `https://${baseURL}/ap/actor`,
|
|
||||||
"preferredUsername": "shadowfacts",
|
|
||||||
"name": "shadowfacts' blog",
|
|
||||||
"icon": {
|
|
||||||
"type": "Image",
|
|
||||||
"mediaType": "image/png",
|
|
||||||
"url": `https://${baseURL}/shadowfacts.png`
|
|
||||||
},
|
|
||||||
"inbox": `https://${baseURL}/ap/inbox`,
|
|
||||||
"publicKey": {
|
|
||||||
"id": `https://${baseURL}/ap/actor#main-key`,
|
|
||||||
"owner": `https://${baseURL}/ap/actor`,
|
|
||||||
"publicKeyPem":
|
|
||||||
`
|
|
||||||
-----BEGIN PUBLIC KEY-----
|
|
||||||
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxsePhOEq6EqqgGe+5vKa
|
|
||||||
ti8cnvLoP3eJDTHENxX4M9epMIeo48cI214wkAERoNufZLtYeGOHO6YJcVydVSYN
|
|
||||||
Ud4lQxgaPwAlh0DB0BUrXR1yfcSAhHS86XBSUq86O3fY5V+vEdZiN5PfUCG5rg5t
|
|
||||||
5V/TrcbVQngXqDmwVZ/OcJ+5vUo+B62Mul7EmiNkZHKzp1VZGVtZ6nZ/4TxsdeSN
|
|
||||||
XT8Vb0f/GJQOQLzW6dV0CBupts6x7o+9oRiYiAH+cXLFyQdTQ+1TrqMSMscdfX9I
|
|
||||||
Kos5Ih7oKdj6wQt0pDEOGx090c9JzQC25RzxRk7jc1Jt1UzDi/a1U/BbucxIvPr3
|
|
||||||
PQIDAQAB
|
|
||||||
-----END PUBLIC KEY-----
|
|
||||||
`
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function webfingerObject() {
|
function webfingerObject() {
|
||||||
return {
|
return {
|
||||||
"subject": `acct:shadowfacts@${baseURL}`,
|
"subject": `acct:shadowfacts@${baseURL}`,
|
||||||
|
|
Loading…
Reference in New Issue