Skip to content

Commit

Permalink
prerelease: activity pub files
Browse files Browse the repository at this point in the history
0.1.4-rc.2 for refactor API calls in ipns-site-generator #149
  • Loading branch information
49659410+tx0c committed Oct 25, 2023
1 parent 7292d89 commit 61b936b
Show file tree
Hide file tree
Showing 10 changed files with 1,211 additions and 20 deletions.
25 changes: 24 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,29 @@ 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
```

## Unit test

Run test with:
Expand Down
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.4-rc.2",
"description": "IPNS site generator for matters.town",
"author": "https://github.com/thematters <[email protected]>",
"homepage": "https://github.com/matters-ipns-site-generator",
"homepage": "https://github.com/thematters/ipns-site-generator",
"repository": {
"type": "git",
"url": "[email protected]: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 61b936b

Please sign in to comment.