salmansqadeer/wordpress-to-middleman — pull request #1 by blachniet (2014-06-02 19:17:08+00:00)
Title: Spaces and Urls

When creating a filename from the title, Middleman defaults to replacing spaces with dashes (`-`) instead of underscores (`_`). My first change was to mimic that behavior.

I also ran into an issue in which the relative links to some of my posts were different after the conversion (in comparison to their Wordpress counterparts). For example, I had a post titled *HTML5 Articles and Sections* whose relative link in Wordpress was `/2013/12/27/html5-articles-sections/`. The script generated a file named `2013-12-27-html5-articles-and-sections` with relative link `2013/12/27/html5-articles-and-sections` (notice the extra `-and` in the generated result). To better handle this, my second change uses the text between the last pair of slashes (`/`) to use as the filename.