Synchronizing WordPress posts with Github README.md

synchronizing-wordpress-posts-with-github-readme.md

I treat my WordPress blog as my “digital home” – THE place to collect my thoughts, describe projects, and publish ideas.

It works very well for writing, but my coding projects feel better on Github. They also appreciate the documentation and descriptions I attach to them.

Over time, my projects would get out of sync with their WordPress counterparts. I would add new features, change behavior or describe new use cases and would have to manually change that in WordPress, which I naturally forgot to do.

I wrote this simple snippet to embed any Github .md file inside WordPress posts or pages. Content would be refreshed from Github every hour and displays inside the post like it was written on WordPress.

Here is an example page. Almost the entire content is from the associated README.md

How to sync your WordPress posts with any markdown file on Github

  1. Use the attached code to introduce the GitHub markdown handler to your WordPress blog. Remember to also attach Parsedown.php!
  2. Create an amazing project solving the world’s most pressing problem, write a .md file describing it
  3. Copy the URL to Github markdown file
  4. Paste it to WordPress block editor, and see how it turns into the content from the file.

Here is the code:

Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post
why-your-new-year’s-resolution-never-works.

Why your New year’s resolution never works.

Next Post
music-monday-—-what-are-you-listening-to?-(90’s-edition!)

Music Monday — What are you listening to? (90’s edition!)

Related Posts