PHPackages                             medienbaecker/kirby-mastodon - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. medienbaecker/kirby-mastodon

ActiveKirby-plugin[Utility &amp; Helpers](/categories/utility)

medienbaecker/kirby-mastodon
============================

Two-way Mastodon integration for Kirby: post pages from the Panel or CLI, fetch and display replies

2.0.1(1mo ago)140MITPHP

Since Nov 3Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/medienbaecker/kirby-mastodon)[ Packagist](https://packagist.org/packages/medienbaecker/kirby-mastodon)[ RSS](/packages/medienbaecker-kirby-mastodon/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

Kirby Mastodon
==============

[](#kirby-mastodon)

Post Kirby pages to Mastodon from the Panel or CLI. Display replies, stars and boosts on the backend and frontend.

[![Panel section in action: composing a toot with live preview, posting, then watching reply, boost and favourite tiles update with engagement counts.](.github/demo.gif)](.github/demo.gif)

Installation
------------

[](#installation)

```
composer require medienbaecker/kirby-mastodon
```

Configuration
-------------

[](#configuration)

```
// site/config/config.php
return [
    'medienbaecker.kirby-mastodon' => [
        'instance'      => 'https://mastodon.social',
        'token'         => 'YOUR_APP_TOKEN_HERE', // scope: write:statuses
        'post.default' => '{{ page.title }}: {{ page.url }}',
    ],
];
```

All options:

OptionDefault`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
-------

[](#posting)

Add the section to a page blueprint:

```
sections:
  mastodon:
    type: mastodon
```

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:

```
kirby mastodon:post path/to/article
kirby mastodon:post path/to/article --text="Custom toot for {{ page.title }}"
```

Requires `composer global require getkirby/cli`.

Displaying replies
------------------

[](#displaying-replies)

```
