Drupal to Static module exports Drupal 7 site content in the Markdown format for static site generators, such as Jekyll, Jigsaw, etc.
This is a fork of lukaswhite/Drupal-Jekyll-Export module which only supports Jekyll.
Disclaimer: I'm very familiar with Drupal Coding Standards and refactoring approaches but this time I have the goal of getting my own tasks done and allowing others to use the module, so the code can be not ideal. If you want it to be better, please do.
- PHP Zip extension
- [Optional] Markdownify module if you'd like to convert your HTML content to the Markdown format.
Copy/clone the module into your sites/all/modules/contrib
and enable it as usual from the admin panel or through drush.
-
Once you've installed the module, browse to
admin/config/development/drupal_to_static
-
Select the content types to export, enter the name of the layout, and hit "Run Export".
-
Download the ZIP file which the module produces for you. The archive should contain all the specified nodes in Markdown format.
-
Then copy the content of the archive into the
_posts
folder of your site generator setup.
Changes compared to lukaswhite/Drupal-Jekyll-Export
- Added GPLv2 license file
- Renamed the module from
jekyll_export
todrupal_to_static
- Changed configuration path to
admin/config/development/drupal_to_static
- Used version branch
7.x-1.x
instead ofmaster
- Removed "Include unpublished nodes?" option
- Made Markdownify optional
- Made dates in file names optional
- Fixed bug: File names of localized nodes are not correct
- Supported multilingualism. See also #16
- Fixed potential bug: Improper use of strrpos() - the position of an occurrence can be 0.
- Refactoring: extracted some code to separate functions.
- Implemented export of meta description from metatags module
- Applied Drupal's content filter to body field content before writing it to a file
- Added an option to skip adding language field for nodes in the default site language. See also #15
- Added support for layout fields of both Jekyll and Jigsaw
- Implemented export of node author name
- Implemented export of nid to be able to use it in Disqus identifier
Author: Lukas White (hello@lukaswhite.com)
Modified by: Konstantin Komelin
GNU GPL v2.0 (why?)