承接 scottboms/mastodon-feed 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

scottboms/mastodon-feed

Composer 安装命令:

composer require scottboms/mastodon-feed

包简介

Mastodon Feed plugin for Kirby

README 文档

README

Plugin Preview

Display posts from Mastodon on your Kirby-powered site. Includes a variety of configuration options and caching for improved performance.

Installation

Kirby CLI

kirby plugin:install scottboms/mastodon-feed

Git Submodule

$ git submodule add https://github.com/scottboms/kirby-mastodon-feed.git site/plugins/mostadon-feed

Copy and Paste

  1. Download the contents of this repository as Zip file.
  2. Rename the extracted folder to mastodon-feed and copy it into the site/plugins/ directory in your Kirby project.

Usage

Add the following line to include the built-in snippet to your site. You can customize the HTML formatting by creating a snippet with the same name in your /site/snippets/ folder.

<?= snippet('mastodon_feed') ?>

Template Output

If you want to explore the data returned via the plugin to the snippet or that you can render directly in a template, you can use the following to output the contents of the $feed object returned.

<pre>
	<?php print_r($items->toArray()); ?>
</pre>

Configuration Options

Property Default Req? Description
cache.scottboms.mastodon.type file Yes Required to enable cache type for the plugin
username null Yes Your Mastodon username
server null Yes Your Mastodon server (e.g. mastodon.social)
cache true No Caches data returned from Mastodon API.
cachettl 900 No Cache timeout - 15 minutes default (900s)
limit 20 No Number of results to return/display (max 40)
dateformat M d, Y No Adjust date format per PHP datetime formats
excludereplies true No Exclude replies from results?
onlymedia false No Only show posts with media attachments?
panel.limit 12 No Number of results to display in the Panel Area

Date formatting follows the available format options from PHP.

Example Config:

<?php
  return [
    'cache' => [
      'scottboms.mastodon' => [
        'type' => 'file',
      ]
    ],

	  'scottboms.mastodon' => [
      'username'   => 'scottboms',
      'instance'   => 'mastodon.social',
      'dateformat' => 'm-d-Y',
      'cache'      => true,
      'cachettl'   => 300 // 5 minutes
      'onlymedia'  => true,
      'panel'      => [
        'limit' => 6
      ]
    ]
  ]

Panel View Button

The plugin includes a custom Panel View Button for Kirby 5.x to manually clear the Mastodon cache file which can be added to the site or a page blueprint using the buttons option.

buttons:
  mastodoncache: true

Compatibility

  • Kirby 4.x
  • Kirby 5.x

Disclaimer

This plugin is provided "as is" with no guarantee. Use it at your own risk and always test before using it in a production environment. If you identify an issue, typo, etc, please create a new issue so I can investigate.

License

MIT

统计信息

  • 总下载量: 2
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-08-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固