该插件尚未通过WordPress的最新3个主要版本进行测试。 当与较新版本的WordPress一起使用时,可能不再受到维护或支持,并且可能会存在兼容性问题。

Jekyll Exporter

描述

产品特点

  • Converts all posts, pages, and settings from WordPress to Markdown and YAML for use in Jekyll (or Hugo or any other Markdown and YAML based site engine)
  • Export what your users see, not what the database stores (runs post content through the_content filter prior to export, allowing third-party plugins to modify the output)
  • Converts all post_content to Markdown
  • Converts all post_meta and fields within the wp_posts table to YAML front matter for parsing by Jekyll
  • Generates a _config.yml with all settings in the wp_options table
  • Outputs a single zip file with _config.yml, pages, and _posts folder containing .md files for each post in the proper Jekyll naming convention
  • No settings. Just a single click.

用法

  1. Place plugin in /wp-content/plugins/ folder
  2. Activate plugin in WordPress dashboard
  3. Select Export to Jekyll from the Tools menu

More information

See the full documentation:

Security Policy

To report a security vulnerability, please email ben@balter.com.

Where to get help or report an issue

  • For getting started and general documentation, please browse, and feel free to contribute to the project documentation.
  • For support questions (“How do I”, “I can’t seem to”, etc.) please search and if not already answered, open a thread in the Support Forums.
  • For technical issues (e.g., to submit a bug or feature request) please search and if not already filed, open an issue on GitHub.

Things to check before reporting an issue

  • Are you using the latest version of WordPress?
  • Are you using the latest version of the plugin?
  • Does the problem occur even when you deactivate all plugins and use the default theme?
  • Have you tried deactivating and reactivating the plugin?
  • Has your issue already been reported?

What to include in an issue

  • What steps can another user take to recreate the issue?
  • What is the expected outcome of that action?
  • What is the actual outcome of that action?
  • Are there any screenshots or screencasts that may be helpful to include?
  • Only include one bug per issue. If you have discovered two bugs, please file two issues.

Command-line Usage

If you’re having trouble with your web server timing out before the export is complete, or if you just like terminal better, you may enjoy the command-line tool.

It works just like the plugin, but produces the zipfile on STDOUT:

`

php jekyll-export-cli.php > jekyll-export.zip
`

If using this method, you must run first cd into the wordpress-to-jekyll-exporter directory.

Alternatively, if you have WP-CLI installed, you can run:

`

wp jekyll-export > export.zip
`

The WP-CLI version will provide greater compatibility for alternate WordPress environments, such as when wp-content isn’t in the usual location.

自定义文章类型

To export custom post types, you’ll need to add a filter to do the following:

`php

add_filter( ‘jekyll_export_post_types’, function() {
return array(‘posts’, ‘pages’, ‘you-custom-post-type’);
});
`

The custom post type will be exported as a Jekyll collection. You’ll need to initialize it in the resulting Jekyll site’s _config.yml.

Developing locally

Prerequisites

  1. sudo apt-get update
  2. sudo apt-get install composer
  3. sudo apt-get install php7.3-xml
  4. sudo apt-get install php7.3-mysql
  5. sudo apt-get install php7.3-zip
  6. sudo apt-get install php-mbstring
  7. sudo apt-get install subversion
  8. sudo apt-get install mysql-server
  9. sudo apt-get install php-pear
  10. sudo pear install PHP_CodeSniffer

Bootstrap & Setup

  1. git clone https://github.com/benbalter/wordpress-to-jekyll-exporter
  2. cd wordpress-to-jekyll-exporter
  3. script/bootstrap
  4. script/setup

Running tests

script/cibuild<h3>Testing locally via Docker</h3>

1. git clone https://github.com/benbalter/wordpress-to-jekyll-exporter
2. docker-compose up
3. open localhost:8088

Minimum required PHP version

Many shared hosts may use an outdated version of PHP by default. WordPress to Jekyll Export requires PHP 5.6 or greater.

If you get an error message that looks like unexpected T_STRING, unexpected '[' or expecting T_CONSTANT_ENCAPSED_STRING, you need to update your PHP version. In a shared hosting environment, you should be able to change the version of PHP used by simply toggling the setting in the host’s control panel.

PHP 5.4 lost support from the PHP project itself in 2015. You’ll need to be running at least PHP 5.5 which adds namespace support (the reason it’s breaking), but I’d recommend at least 7.3 (or the latest your host supports) as it’s the oldest supported version.

How to determine which version of PHP you’re running

How to upgrade your version of PHP

If you are using a shared hosting environment, upgrading to a newer version of PHP should be a matter of changing a setting in your host’s control panel. You’ll have to follow your host specific documentation to determine how to access it or where the setting lives. Check out this list of common hosts for more details.

评价

2022年8月14日
If you have a not so small WordPress site, it is very likely you won't have any success using this plugin within the WordPress interface, as I can read in the reviews and support messages. But the plugin offer a command line interface that does not have the timeout of the web version. Go inside the plugin folder and run the cli version : php jekyll-export-cli.php > jekyll-export.zip The GitHub does provide more information (WordPress forbid to include the link, but the project name seems to be benbalter/wordpress-to-jekyll-exporter) Not doing miracles with plugins, you will have some rework, but definitely working and very useful!
2022年3月17日
I wasn't expecting much because of the previous reviews indicating this was broken, but having just used it on an (admittedly somewhat small) WP site, I can confirm that it now works. Even with only a couple dozen posts and some pictures, it took a few minutes, so give it time, but the result was exactly as advertised: a .zip file containing all posts as Jekyll-formatted .md files, and the WP uploads directory with all the images. Thanks!
2020年1月8日 1 回复
It does not work anymore. I suppose it was good while it worked but I will never know.
2018年12月25日
I had to export to Hugo and used the plugin with cpanell. upload the zip file to wp-plugins and unpack there. activate and export as instructed. takes long. result has posts in _posts folder and the rest as files; these can easily be placed in correct folders for hugo or jekyll. thank you - saves a lot of time!
阅读所有11条评价

贡献者及开发者

“Jekyll Exporter” 是开源软件。 以下人员对此插件做出了贡献。

贡献者

将“Jekyll Exporter”翻译成您的语言。

对开发感兴趣吗?

您可以浏览代码,查看SVN仓库,或通过RSS订阅开发日志

更新日志

View Past Releases