Skip to content

NodeJS script that takes a WordPress XML file and generates static files

Notifications You must be signed in to change notification settings

jorgepedret/wp2static

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WordPress Export to static files

NodeJS script that takes a WordPress XML file and generates files from its content

It removes the hassle to have to go through each one of your pages, creating files and pasting the content in. Really simple right now and not properly tested.

Problems it solves

  • Simplifies permalink structure to posts, pages & assets
  • Automatically creates files with the permalink url as the file name
  • Download all attachments to the assets directory

Problems you solve

It's up to you to:

  • Fix the content HTML (WordPress content is fucked up)
  • Update the inernal links in your posts to other pages or attachments (for now)

How to use it

git clone [email protected]:jorgepedret/wp2static.git
cd wp2static
./bin/wpexport [your xml file] -ext [html|jade|haml]

If you want the files in a specific location. Execute the CLI tool from the directory where you want the files. I.e:

cd ~/blog
~/Projects/wp2static/bin/wpexport [your xml file] -ext [html|jade|haml]

TODO

  • Improve CLI tool
  • Specify a different output directory
  • Convert WordPress "HTML" to Jade
  • Update attachments in posts/pages to their new location
  • Preserve file structure
  • Generate file with old routes mapped to the new routes
  • Ability to ignore post status (draft, closed, etc)

License

MIT

About

NodeJS script that takes a WordPress XML file and generates static files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published