Download the PHP package medienbaecker/kirby-mastodon without Composer
On this page you can find all versions of the php package medienbaecker/kirby-mastodon. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download medienbaecker/kirby-mastodon
More information about medienbaecker/kirby-mastodon
Files in medienbaecker/kirby-mastodon
Package kirby-mastodon
Short Description Two-way Mastodon integration for Kirby: post pages from the Panel or CLI, fetch and display replies
License MIT
Informations about the package kirby-mastodon
Kirby Mastodon
Post Kirby pages to Mastodon from the Panel or CLI. Display replies, stars and boosts on the backend and frontend.
Installation
Configuration
All options:
| Option | Default | |
|---|---|---|
instance |
Mastodon instance URL | |
token |
App token with write:statuses scope |
|
post.default |
{{ page.title }}\n\n{{ page.url }} |
Default toot text. String or closure receiving the page. Supports page/site query placeholders. The kirby and user globals are intentionally shadowed so user-edited templates can't leak {{ kirby.option('token') }} or similar. |
name |
Mastodon |
Brand name shown in the section labels |
field |
mastodon_url |
Page field that stores the posted toot URL |
cache.ttl |
5 |
Reply cache freshness in minutes. 0 disables. |
Posting
Add the section to a page blueprint:
Before posting the section shows a textarea seeded with post.default, a Preview toggle, and a Post button. After posting it shows reply, boost and favourite counts plus Refresh and Unlink buttons. The { } button opens a dialog listing every supported placeholder. Only the posted URL is stored on the page (in mastodon_url); the toot text itself lives on Mastodon. Unlinking only clears the local field; the toot is left intact.
Or post from the CLI:
Requires composer global require getkirby/cli.
Displaying replies
The wrapper snippet pulls in sub-snippets for heading, stats, list, reply, outro, empty, and error. Override any of them by placing your own version at site/snippets/mastodon-replies/<name>.php.
Reply data is also available raw via $page->mastodonReplies(), which returns success, url, replies, count, repliesCount, favouritesCount, reblogsCount, and error.
License
MIT