Publish markdown files present in a Github repository as posts to WordPress automatically
|Author:||Aakash Chakravarthy (profile at wordpress.org)|
|WordPress version required:||4.4|
|WordPress version tested:||5.8.2|
|Added to WordPress repository:||15-08-2020|
|Total downloads:||1 080|
Click to start download
Git it Write allows to publish the markdown files present in a Github repository to your WordPress site. So with this plugin, whenever the files are added, updated in the repository the WordPress post will be added, updated accordingly.
This plugin is inspired from static site generators like
Gatsby.js on how content is written is markdown. This is a similar idea for WordPress where markdown files are parsed from Github and published as posts.
This allows people to collaborate with the post, share edits and suggestions in Github which when pulled the WordPress post will be updated automatically.
If a repository has files in the below structure,
docs\ guide\ introduction.md getting-started.md help\ faq.md
Then below posts will be created like below (if permalinks are configured and the post type supports “hierarchy” i.e creating posts level by level (example: pages))
https://example.com/docs/guide/introduction/ https://example.com/docs/guide/getting-started/ https://example.com/help/faq/
???? What is the use of this plugin ?
- Publish posts using the files in your Github repository.
- Write your posts in Markdown format.
- Write your posts on your desktop application (Notepad++, Sublime Text, Visual studio code).
- Collaborate, involve communities on the files in Github and publish them on WordPress.
- All the advantages of Git and it’s version management system.
???? Some use cases
- Can be used for documentation posts, FAQs, Wikis etc.
- Write blog posts.
- Any articles which may need community involvement.
- Markdown will be processed and post will be published as HTML.
- Images used in the source file will be uploaded to WordPress.
- Relative links are supported.
- Set post properties like post status, title, order, category, tags etc, in the source file itself.
- Webhook support (whenever repository is changed, it updates the plugin to pull the latest changes and publish the posts)
- Add multiple repositories.
- Publish to any post type.
- Posts are published in hierarchial manner if they are under folders. Example: a file
dir1/hello.mdwill be posted as
dir1/hello/in WordPress if the post type supports hierarchy.
- Support for post metadata like setting tags, categories, custom fields.
- Only Markdown files will be pulled and published right now
- Posts won’t be deleted when it’s source file is deleted on Github.
- It is preferred to have a permalink structure.
- It is preferred to select a post type which supports hierarchy.
- Images have to present only in
_imagesfolder in the repository root. Markdown files have to relatively use them in the file.
It is recommended that a permalink structure is enabled in the WordPress site so that, if you have file under
docs\reference\my-post.md then a post is published like
https://example.com/docs/reference/my-post/. This will be the result when post type has hierarchy support. They will be posted level by level for every folder in the repository. The folder’s post will be taken from the
index.md file if exists under that folder.
????♂️ Using the plugin
- Have a Github repository where all the source files (markdown files) are maintained (organized in folders if needed the exact structure)
- In the plugin settings page, click add a new repository.
- Enter the details of the repository to pull the posts from and under what post type to publish them.
- Save the settings
- Click “Pull the posts” and then “Pull only” changes. This will publish posts for all the markdown files.
- To automatically update posts whenever repository is updated, configure webhook as mentioned in the settings page.
Your files in a Github repository
Posts pulled and published from Github.
Content of the published post.
Plugin admin page.
Repository configuration page.
Please visit the plugin documentation page for complete list of FAQs.
No. This plugin won’t sync post content. It is a one way update. Only changes made to the Github repository will update the posts and not otherwise.
All markdown files will be published as posts.
Any folder/file starting with
. (dot) won’t be considered for publishing.
Yes, if you want to pull posts from a branch in a repository then you can specify it in the plugin’s repository settings page.
Yes, if you want to pull posts from a folder in a repository then you can specify it in the plugin’s repository settings page. For example, if a repository has a folder
website\main\docs and if you want to pull only from docs folder, then you can specify
website\main\docs in the plugin settings.
- Fix: Repository not found issue by adding Github authentication.
- Fix: Duplicate posts when filename has special characters.
- Fix: PHP warning when directory has no index.md file.
- New: Support for git branches (Thanks to https://github.com/AppalachiaInteractive for the contribution)
- New: Logs directory has been changed to the uploads directory.
- Fix: Minor admin page enhancements.
- New: Support for custom fields
- New: New shortcode attribute in
[giw_edit_link]to automatically wrap in
- Fix: Added permission callback for the webhook REST API.
- Fix: Minor admin UI enhancements.
- New: Support for Parsedown extra
- Fix: Webhook is changed to
- Fix: Readme formatting.
- First version of the plugin.