A Ruby Script that will convert your exported Wordpress XML into markdown scripts formatted for Middleman
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.DS_Store
.gitignore
Gemfile
Gemfile.lock
LICENSE
README.md
wordpress_to_middleman.rb
wordpressxml_to_middleman.rb

README.md

Wordpress to Middleman Exporter

A Ruby Script that will convert your exported Wordpress XML into markdown files with the appropriate frontmatter metadata so that they are consumable by Middleman.

Getting Started

  1. Open up the wordpress_to_middleman.rb file and setup the following three variables
    • WORDPRESS_XML_FILE_PATH (The path to the exported wordpress.xml file)
    • OUTPUT_PATH (The path where all of the markdown posts will be saved)
    • ORIGINAL_DOMAIN (The domain of the original website)
    • SEPARATE_CATEGORIES_FROM_TAGS (List categories as its own YAML attribute. Defalut: false - all categories will be listed as tags)
    • CONVERT_FROM_HTML (Convert HTML tags to markdown)
  2. Ensure that all of the required gems are installed (Gemfile is included, so you can run bundle) - three in specific that are required are:
    • nokogiri
    • upmark
    • html2md
  3. Remove the following lines from the exported Wordpress XML (They mess with nokogiri's parser):

  4. In the terminal, navigate to the folder where the project has been saved, and run ruby wordpress_to_middleman.rb

Please Note that this is a work in progress. Contributions welcome.