micropub-github-pages

micropub-github-pages

A simple Sinatra-based endpoint that accepts Micropub requests and creates and publishes a Jekyll/GitHub Pages post to a configured GitHub repository.

Micropub to GitHub Pages

A Micropub server that accepts Micropub requests and creates and publishes a Jekyll/GitHub Pages post to a configured GitHub repository. This server supports posting to multiple sites from the same server. This project is inspired by Micropub to GitHub, a Node.js implementation.

Installation

Run on Heroku

Fork this repo (optional), configure and then clicky this button :point_right:

Run Elsewhere or Locally

Clone the repository and run bundle install.

Run GITHUB_ACCESS_TOKEN="your_personal_access_token" bundle exec rackup and you'll have the application running on http://localhost:9292 .

Alternatively, create an env.rb file in the root of this repository containing: ENV['GITHUB_ACCESS_TOKEN'] = 'your_personal_access_token'.

Endpoint Discovery

Once deployed, your Micropub endpoint can be found at /micropub/<sitename> e.g. https://example.com/micropub/mysite. <sitename> is the site-specific section on your config.yml file.

To enable automatic discovery for your Micropub endpoint and token endpoint, you will need to add the following values to your site's <head>:

<link rel="micropub" href="https://example.com/micropub/mysite">
<link rel="token_endpoint" href="https://tokens.indieauth.com/token">

Configuration

Copy config-example.yml to config.yml and customise to your :heart:'s content. See the configuration docs for full details.

Customise Posts Layouts

You can customise the layout and format of your posts by modifying the templates in the templates/ directory. These are written in Liquid like Jekyll themes.

Syndication

Syndication is available via Brid.gy.

Testing

Run bundle exec rake test to run through the full test suite and bundle exec rake standard for Standard linting.

Contributing

Want to contribute to this project? Great! Fork the repo, make your changes (don't forget to add tests 😉) and submit a pull request.

License

Micropub to GitHub Pages is licensed under the MIT License.