metbril / grav-plugin-micropub

Micropub for Grav

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Micropub Plugin

NOTE: This plugin is currently in alpha. Features are slowly added.

The Micropub Plugin is for Grav CMS and implements a Micropub server endpoint for the IndieWeb.

Installation

Installing the Micropub plugin can be done in one of two ways. The GPM (Grav Package Manager) installation method enables you to quickly and easily install the plugin with a simple terminal command, while the manual method enables you to do so via a zip file.

GPM Installation (Preferred)

The simplest way to install this plugin is via the Grav Package Manager (GPM) through your system's terminal (also called the command line). From the root of your Grav install type:

bin/gpm install micropub

This will install the Micropub plugin into your /user/plugins directory within Grav. Its files can be found under /your/site/grav/user/plugins/micropub.

Manual Installation

To install this plugin, just download the zip version of this repository and unzip it under /your/site/grav/user/plugins. Then, rename the folder to micropub. You can find these files on GitHub or via GetGrav.org.

You should now have all the plugin files under

/your/site/grav/user/plugins/micropub

NOTE: This plugin is a modular component for Grav which requires Grav and the Error and Problems to operate.

Admin Plugin

If you use the admin plugin, you can install directly through the admin plugin by browsing the Plugins tab and clicking on the Add button.

Configuration

Before configuring this plugin, you should copy the user/plugins/micropub/micropub.yaml to user/config/plugins/micropub.yaml and only edit that copy.

Here is the default configuration and an explanation of available options:

enabled: true
debug: false
route: /micropub
advertise_method: header
token_endpoint:
parent_page:
post_template:
destination:
map:
  width: 600
  height: 200
  zoom: 16
Option Description
enabled Enable or disable the plugin
debug Save every request into a yaml file. Files are save in the user/data/micropub folder.
route The route to the endpoint
advertise_method The method used to advertise the endpoint. This can be in the HTML <head> header or as a <link> inside the page <body>.
token_endpoint Your authorization token endpoint. This should be the same as advertised on your home page.
parent_page The parent page that any new page will be created under
post_template The filename of the page template, also used for rendering your output.
mapbox_token Token to generate static maps with Mapbox.
map.width Static map width
map.height Static map height
map.zoom Static map zoom
destination A list of available endpoint destinations. Posts can be saved as a child to one of these. If a Micropub endpoint does not support destinations, the first one is used by default.

Note that if you use the admin plugin, a file with your configuration, and named micropub.yaml will be saved in the user/config/plugins/ folder once the configuration is saved in the admin.

Usage

Currently supported:

  • Deliver a Micropub endpoint with multiple destinations
  • Advertise the endpoint in your site

After configuration, you can use any Micropub client to publish content to your site. Some publicly available web clients are:

To be able to use any client, you will also need to be able to provide those IndieAuth authentication. The easiest way to achieve this is, to install the IndieAuth plugin.

Credits

This plugin is largely inspired by:

To Do

This plugin is currently in alpha. Features are slowly added.

  • Add micropub media endpoint
  • Read token endpoint from home page instead of configuration
  • Get parent page from blog configuration

About

Micropub for Grav

License:GNU General Public License v3.0


Languages

Language:PHP 99.7%Language:HTML 0.3%