88 lines
3.3 KiB
Markdown
Raw Normal View History

2022-11-29 22:20:16 +01:00
# Include Mastodon Feed Wordpress Plugin
2022-11-25 22:19:00 +01:00
2022-11-29 22:20:16 +01:00
Plugin that provides an `[include-mastodon-feed]` shortcode to easily integrate mastodon feeds into wordpress pages.
2022-11-25 22:23:46 +01:00
The plugin is written in PHP and generates native JavaScript to fetch and render the mastodon feed. No special libraries needed.
2022-11-25 22:19:00 +01:00
## Table of contents
* [Usage](#usage)
* [Supported shortcode attributes](#supported-shortcode-attributes)
* [Additional customization](#additional-customizations)
2022-11-25 22:51:44 +01:00
* [Installation](#installation)
* [Installation via ZIP file](#installation-via-zip-file)
* [Installation via git checkout](#installation-via-git-checkout)
2022-11-25 23:52:15 +01:00
* [Known issues](#known-issues)
* [TODO](#todo)
2022-11-25 22:19:00 +01:00
* [FAQ](#faq)
* [How do I find my account ID?](#how-do-i-find-my-account-id)
* [Can I modify the plugin?](#can-i-modify-the-plugin)
## Usage
Place the following shortcode right into the page. Either as shortcode block or just copy and paste right within a text block:
```[include-mastodon-feed account="YOUR-ACCOUNT-ID"]```
2022-11-25 22:19:00 +01:00
### Supported shortcode attributes
2022-11-25 22:23:46 +01:00
| Attribute* | Default value | Description |
| ------------- | ----------------------------- | ----------------------------------------------------------------- |
| **account** | | your account ID ([a long number](#how-do-i-find-my-account-id)) |
| **instance** | | domain name of the instance (e.g. example.org) |
2022-11-25 23:44:29 +01:00
| loading | "Loading Mastodon feed..." | loading text |
2022-11-25 22:23:46 +01:00
| darkmode | false | enable dark mode |
2022-11-25 22:19:00 +01:00
\* Attributes marked **bold** are required
### Additional customizations
2022-11-25 23:25:21 +01:00
You can create a file config.php to overrwrite select settings
2022-11-25 22:19:00 +01:00
2022-11-25 23:25:21 +01:00
See [config-example.php](config-example.php) for a full list of supported settings
2022-11-25 22:19:00 +01:00
2022-11-25 22:51:44 +01:00
## Installation
The plugin is not yet listed in the official Wordpress plugin directory
### Installation via ZIP file
1. Click on the `<>Code` in the top right of this page
2. Select `Download ZIP`
3. Create a `include-mastodon-feed` folder in your Wordpress plugins directory
2022-11-25 22:51:44 +01:00
4. Unpack all the files from the ZIP there (files only, no sub-directory)
5. Enable plugin in Wordpress
6. Use shortcode
### Installation via git checkout
If you are familiar with Github you can clone the repository right into your Wordpress plugins folder
1. SSH into your webserver
2. `cd /path/to/wordpress/wp-content/plugins`
3. `git clone https://github.com/wolfgang101/include-mastodon-feed.git`
2022-11-25 22:51:44 +01:00
4. Enable plugin in Wordpress
5. Use shortcode
2022-11-25 23:52:15 +01:00
## Known issues
### TODO
* support additional media attachment types (currently only images supported)
2022-11-25 22:19:00 +01:00
## FAQ
### How do I find my account ID?
As an instance admin you can easily read your user ID in the admin backend. As regular user you can try an API v2 search to find your ID
Use the following URL to get your ID:
```https://example.org/api/v2/search?q=username@example.org&resolve=true&limit=5```
2022-11-25 22:19:00 +01:00
* Change `example.org` to your instance
2022-11-25 22:19:00 +01:00
* Replace `username` with your handle.
* Open the URL in your webbrowser
**Note:** You must be logged in to do that
### Can I modify the plugin?
The plugin is released unter the [Expat License](LICENSE) which is very permissive. Knock youself out!