Plugin / Jekyll Exporter
Ben BalterDescription
Description
Features
- Converts all posts, pages, and settings from WordPress for use in Jekyll
- 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 Extra (using Markdownify) - Converts all
post_meta
and fields within thewp_posts
table to YAML front matter for parsing by Jekyll - Generates a
_config.yml
with all settings in thewp_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.
Usage
- Place plugin in
/wp-content/plugins/
folder - Activate plugin in WordPress dashboard
- Select
Export to Jekyll
from theTools
menu
More information
Custom post types
To export custom post types, you’ll need to add a filter to do the following:
`php
add_filter( ‘jekyll_export_post_types’, 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
sudo apt-get update
sudo apt install composer
sudo apt install php7.0-xml
sudo apt install php7.0-mysql
sudo apt install php7.0-zip
sudo apt install php-mbstring
sudo apt install subversion
sudo apt install mysql-server
sudo apt install php-pear
sudo pear install PHP_CodeSniffer
Bootstrap & Setup
git clone https://github.com/benbalter/wordpress-to-jekyll-exporter
cd wordpress-to-jekyll-exporter
script/bootstrap
script/setup
Running tests
script/cibuild<h3>Command-line Usage</h3>
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.
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 5.6 (or the latest your host supports) as it’s the oldest supported version: https://en.wikipedia.org/wiki/PHP#Release_history
How to determine which version of PHP you’re running
- Try this plugin
- Follow WordPress’s tutorial or this wikihow
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.
Ratings
Rating breakdown
Details Information
Version
First Released
Total Downloads
Wordpress Version
Tested up to:
Require PHP Version:
Tags
Contributors
Languages
The plugin hasn't been transalated in any language other than English.
DIRECTORY DISCLAIMER
The information provided in this THEME/PLUGIN DIRECTORY is made available for information purposes only, and intended to serve as a resource to enable visitors to select a relevant theme or plugin. wpSocket gives no warranty of any kind, express or implied with regard to the information, including without limitation any warranty that the particular theme or plugin that you select is qualified on your situation.
The information in the individual theme or plugin displayed in the Directory is provided by the owners and contributors themselves. wpSocket gives no warranty as to the accuracy of the information and will not be liable to you for any loss or damage suffered by you as a consequence of your reliance on the information.
Links to respective sites are offered to assist in accessing additional information. The links may be outdated or broken. Connect to outside sites at your own risk. The Theme/Plugin Directory does not endorse the content or accuracy of any listing or external website.
While information is made available, no guarantee is given that the details provided are correct, complete or up-to-date.
wpSocket is not related to the theme or plugin, and also not responsible and expressly disclaims all liability for, damages of any kind, arising out of the use, reference to, or reliance on, any information or business listed throughout our site.