Skip to content

Instantly share code, notes, and snippets.

@linyiru
Last active April 4, 2019 13:29
Show Gist options
  • Save linyiru/c4d77c9d9e0c1ccbcc51d89e5ca89ca6 to your computer and use it in GitHub Desktop.
Save linyiru/c4d77c9d9e0c1ccbcc51d89e5ca89ca6 to your computer and use it in GitHub Desktop.
Import posts from Wordpress to Jekyll in Ruby.
require "jekyll-import";
JekyllImport::Importers::WordPress.run({
"dbname" => "YOUR_DB_NAME",
"user" => "root",
"password" => "root",
"socket" => "/Applications/MAMP/tmp/mysql/mysql.sock",
"table_prefix" => "wp_",
"site_prefix" => "",
"clean_entities" => true,
"comments" => true,
"categories" => true,
"tags" => true,
"more_excerpt" => true,
"more_anchor" => true,
"extension" => "html",
"status" => ["publish"]
})
require "jekyll-import"
JekyllImport::Importers::WordpressDotCom.run({
"source" => "wordpress.xml",
"no_fetch_images" => false,
"assets_folder" => "assets"
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment