Skip to content

fedikit/aoba

Folders and files

NameName
Last commit message
Last commit date

Latest commit

187401f Β· Feb 6, 2024

History

24 Commits
Nov 16, 2023
Nov 16, 2023
Jan 19, 2024
Jan 19, 2024
Feb 6, 2024
Feb 6, 2024
Nov 16, 2023
Nov 16, 2023
Nov 17, 2023
Nov 17, 2023
Jan 19, 2024
Jan 19, 2024

Repository files navigation

Aoba

deno.land/x/aoba deno compatibility

πŸƒ Fediverse Integration for Lume & Hono.

Setup

Add Aoba to your deno.json or import_map.json (replace {{version}} with the current version):

{
  "imports": {
    "aoba/": "https://deno.land/x/aoba@v{{version}}/"
  }
}

Set up static nodeinfo for your site.

import nodeinfo from 'aoba/lume/plugins/nodeinfo.ts'
site.use(nodeinfo())

Set up static webfinger for your site.

import webfinger from 'aoba/lume/plugins/webfinger.ts'
site.use(webfinger())

Set up _headers file for your site. (Netlify and Cloudflare Pages)

import headers from 'aoba/lume/plugins/headers.ts'
site.use(headers())

Set up _redirects file for your site. (Netlify and Cloudflare Pages)

import redirects from 'aoba/lume/plugins/redirects.ts'
site.use(redirects())

Hatsu Integration

Hatsu Integration is consistent with the latest version of Hatsu, so it does not follow semver.

For Hatsu users.

Copy the .well-known/* file from the Hatsu instance and set the link alternate for matched page.

import hatsuPlugin from 'aoba/lume/plugins/hatsu.ts'
site.use(
  hatsuPlugin({
    instance: new URL('https://hatsu.local'),
  }),
)

Redirecting .well-known/* and activity+json requests.

import hatsuMiddleware from 'aoba/lume/middlewares/hatsu.ts'
server.use(
  hatsuMiddleware({
    instance: new URL('https://hatsu.local'),
    location: site.options.location,
  }),
)

Redirecting .well-known/* and activity+json requests.

import { hatsuObject, hatsuWellKnown } from 'aoba/hono/middlewares/hatsu.ts'
const instance = new URL('https://hatsu.local')
app.use('/.well-known/*', hatsuWellKnown({ instance }))
app.use('/posts/*', hatsuObject({ instance }))

License

Licensed under MIT.