Skip to content

Commit

Permalink
prerelease: activity pub files
Browse files Browse the repository at this point in the history
0.1.5 for refactor API calls in ipns-site-generator closes #149
  • Loading branch information
49659410+tx0c committed Nov 1, 2023
1 parent 7292d89 commit b56b739
Show file tree
Hide file tree
Showing 11 changed files with 1,213 additions and 20 deletions.
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Matters IPNS Site Generator

Matters IPNS Site Generator is currently used by matters.town, to genereate HTML files of article & user homepage before adding to IPFS & IPNS.
Matters IPNS Site Generator is currently used by matters.town, to genereate HTML files of article & user homepage & static activitypub files before adding to IPFS & IPNS.

It can be used to create encrypted HTML page with decryption code embedded, generate HTML bundle, and create content metadata.

Expand Down Expand Up @@ -52,6 +52,31 @@ const { bundle, key } = await makeArticlePage({
})
```

### Create HTML bundle for user homepage & static activitypub files
```js
import {
HomepageContext,
makeHomepageBundles,
makeActivityPubBundles,
} from '@matters/ipns-site-generator'

const context: HomepageContext = {
meta: { title, description, authorName, siteDomain, image, ... },
byline: { author: { userName, displayName, ipnsKey, webfDomain, }, ... },
rss: { ... },
articles: [ { id, title, createdAt, ... }, ... ],
}

const contents = [
...makeHomepageBundles(context),
...makeActivityPubBundles(context),
]

const bundles = await ipfs.addAll(contents) // get the top dir CID
```

![Screenshot of Matty shown on Mastodon](./img/mastodon-social-hi176-matters-ens.png)

## Unit test

Run test with:
Expand Down
Binary file added img/mastodon-social-hi176-matters-ens.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 35 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@matters/ipns-site-generator",
"version": "0.1.3",
"version": "0.1.5",
"description": "IPNS site generator for matters.town",
"author": "https://github.com/thematters <tech@matters.town>",
"homepage": "https://github.com/matters-ipns-site-generator",
"homepage": "https://github.com/thematters/ipns-site-generator",
"repository": {
"type": "git",
"url": "git@github.com:matters-ipns-site-generator.git"
Expand Down Expand Up @@ -44,6 +44,7 @@
"typescript": "^4.9.3"
},
"dependencies": {
"@matters/slugify": "^0.7.3",
"@peculiar/webcrypto": "^1.1.6",
"cheerio": "^1.0.0-rc.9",
"isomorphic-fetch": "^3.0.0",
Expand Down
Loading

0 comments on commit b56b739

Please sign in to comment.