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:
source/_posts
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
Edit the locations.json
file with the folder locations of your static repo:
static_folder
value to the name of your repopost_folder
array to the locations of your post foldersRun python extract.py
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