Recover your markdown files from your static repository for your Hexo based site.
For those (like me) who were silly and did not back up their precompiled markdown files for their Hexo blog, hopefully this repo helps. The goal is to be able to clone your static repo with your compiled HTML files to convert them back into markdown and the proper pre-compiled directory structure.
This project requires Python 3.
This project can rebuild the following features:
- Directory structure found in your
- YAML front-matter (only title, date, and tags supported)
- Headers (h1, h2, h3 etc.)
- Images and their assets
Install the repo
git clone https://github.com/jtloong/hexo-recover-files cd hexo-recover-files pip install -r requirements.txt
Clone your static website repo with your compiled files
locations.jsonfile with the folder locations of your static repo:
static_foldervalue to the name of your repo
post_folderarray to the locations of your post folders
The extraction script will build a
posts/ directory with all of your pre-compiled markdown files and their assets.
I've only so far tested this on my static repo and it mostly works. Let me know if you run into any issues!
This project is licensed under the MIT License - see the LICENSE.md file for details