0.3.2 • Published 2 months ago

astro-mastodon v0.3.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

Astro Mastodon

Easily embed Mastodon posts into your Astro blog posts.

Example in Dark Mode

Features

  • Works with .md, .mdx and .astro files
  • Embed posts from Mastodon (other ActivityPub embeds are coming!)
  • Embed posts with plain text, images, link cards, videos, embedded YouTube players, gifs, and more!
  • No client-side JavaScript, cards are generated at build time

How to use

Install the package:

pnpm add astro-mastodon

Update your astro.config.mjs file:

// Other imports
import { remarkMastodonEmbed } from "astro-mastodon";

export default defineConfig({
  // ...
  markdown: {
    remarkPlugins: [
      remarkMastodonEmbed,
      // other plugins
    ],
  },
  // ...
});

Add import "astro-mastodon/dist/output.css" at the top of your post template file (e.g. src/pages/blog/[slug]/index.astro)

In your markdown file, add post "mention":

---
title: Embeds FTW!
---

This is an example of an embedded Mastodon post:

`@rosnovsky@lounge.town:109860863149734322`

The anatomy of the embed is as follows:

@username@instance.domain:postId

Development

Clone the repo and run

pnpm i
pnpm dev

Open http://localhost:4321 and have fun!

Screenshots

Example in Light Mode

Example with photos

Example in Light Mode

0.3.2

2 months ago

0.3.0-beta6

2 months ago

0.3.0-beta7

2 months ago

0.3.1

2 months ago

0.3.0-beta1

2 months ago

0.3.0-beta4

2 months ago

0.3.0-beta5

2 months ago

0.3.0-beta2

2 months ago

0.3.0-beta3

2 months ago

0.2.7

2 months ago

0.2.8

2 months ago

0.2.6

2 months ago

0.2.5

2 months ago

0.2.4

2 months ago

0.1.0

2 months ago

0.2.1

2 months ago

0.1.2

2 months ago

0.2.0

2 months ago

0.1.1

2 months ago

0.2.3

2 months ago

0.2.2

2 months ago

0.0.3

2 months ago

0.0.2

2 months ago

0.0.4

2 months ago

0.0.1

2 months ago