We'll create fresh WordPress site with Git it Write – Write posts from GitHub installed. You have 20 minutes to test the plugin after that site we'll be deleted.
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 Jekyll
, Next.js
, 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.
👓 Live example: Source github repository (/docs/
folder) to Posts published
⚡ Getting started: Get started with Git it write. Learn how to write .md
files and publish posts on WordPress.
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/
dir1/hello.md
will be posted as dir1/hello/
in WordPress if the post type supports hierarchy._images
folder 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.