hexo-migrator-wordpress
WordPress migrator plugin for Hexo
Last updated 3 months ago by curben .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install hexo-migrator-wordpress 
SYNC missed versions from official npm registry.

hexo-migrator-wordpress

Build Status NPM version

Migrate your blog from WordPress to Hexo.

Install

In your blog folder, add this npm dependencie to your project:

$ npm install hexo-migrator-wordpress --save

Usage

Export your WordPress in "Tools" → "Export" → "All Content" in your dashboard.

Execute the following command after installed. source is the file path or URL of WordPress export file.

$ hexo migrate wordpress <source> [--options]
  • alias: Populates the alias setting in the front-matter, for use with the hexo-generator-alias module. This is useful for generating redirects.
  • limit: Maximum number of posts to import from the input file. All posts are imported by default.
    • Example:
    $ hexo migrate wordpress /path/export.xml --limit 3
    
    • This doesn't apply to pages, all pages will be imported.
  • skipduplicate: Skip posts with similar title as existing ones.
    • If the input contains a post titled 'Foo Bar' and there is an existing post named 'Foo-Bar.md', then that post will not be migrated.
    • The comparison is case-insensitive; a post titled 'FOO BAR' will be skipped if 'foo-bar.md' exists.
    • Without this option (default), this plugin will continue to migrate that post and create a post named 'Foo-Bar-1.md'
  • import-image: Download all image attachments from your Wordpress.
    • Downloaded images will be saved based on the original directories.
      • Example: http://yourwordpress.com/wp-content/uploads/2020/07/image.jpg => source/2020/07/image.jpg => http://yourhexo.com/2020/07/image.jpg.
      • Image embed link will be automatically replaced with a new path.
        • Example: ![title](http://yourwordpress.com/wp-content/uploads/2020/07/image.jpg) => ![title](/2020/07/image.jpg)
    • If post_asset_folder is enabled before migration, images will be saved according to their associated post.
      • Example: http://yourwordpress.com/wp-content/uploads/2020/07/image.jpg is associated with http://yourwordpress.com/2020/07/04/foo-post/ post.
      • http://yourwordpress.com/wp-content/uploads/2020/07/image.jpg => source/_posts/foo-post/image.jpg => http://yourhexo.com/2020/07/04/foo-post/image.jpg.
      • Image embed link will be automatically replaced with a new path.
        • Example: ![title](http://yourwordpress.com/wp-content/uploads/2020/07/image.jpg) => ![title](image.jpg)
      • Note that the images are only valid when viewing individual post, not in index page. If you prefer to have them viewable on the index page too and you are using hexo-renderer-marked 3.1.0+, enables the postAsset: option.
    • Limited to JPEG, PNG, GIF and WebP images only.
    • This also applies to resized images.
      • Example: http://yourwordpress.com/wp-content/uploads/2020/07/image-500x300.jpg => source/2020/07/image-500x300.jpg => http://yourhexo.com/2020/07/image-500x300.jpg.
      • Compatible with post_asset_folder: http://yourwordpress.com/wp-content/uploads/2020/07/image-500x300.jpg => source/_posts/foo-post/image-500x300.jpg => http://yourhexo.com/2020/07/04/foo-post/image-500x300.jpg.
    • Usage: $ hexo migrate wordpress /path/export.xml --import_image
    • original: Download original image attachments only.
      • Resized image embed will be replaced with original-sized image.
      • Example: http://yourwordpress.com/wp-content/uploads/2020/07/image-500x300.jpg => source/2020/07/image.jpg => http://yourhexo.com/2020/07/image.jpg.
      • Usage: $ hexo migrate wordpress /path/export.xml --import_image original
  • paragraph-fix: If you used Wordpress classic editor to write posts, you may find imported posts do not have the original paragraphs. Use this option to restore the paragraphs.
  • default-category: Set a default category for posts without any category.
    • Usage: $ hexo migrate wordpress /path/export.xml --default-category 'unknown'
    • Defaults to the value set in user configuration:
    # _config.yml
    default_category: uncategorized
    

Current Tags

  • 2.1.2                                ...           latest (3 months ago)

14 Versions

  • 2.1.2                                ...           3 months ago
  • 2.1.1                                ...           3 months ago
  • 2.1.0                                ...           4 months ago
  • 2.0.0                                ...           5 months ago
  • 1.0.0                                ...           3 years ago
  • 0.1.2                                ...           6 years ago
  • 0.1.1                                ...           6 years ago
  • 0.1.0                                ...           7 years ago
  • 0.0.6                                ...           8 years ago
  • 0.0.5                                ...           8 years ago
  • 0.0.4                                ...           8 years ago
  • 0.0.3                                ...           8 years ago
  • 0.0.2                                ...           8 years ago
  • 0.0.1                                ...           8 years ago
Downloads
Today 0
This Week 10
This Month 46
Last Day 2
Last Week 9
Last Month 32
Dependencies (5)
Dev Dependencies (8)
Dependents (2)

Copyright 2014 - 2016 © taobao.org |