This project contains scripts to convert a local ghost website into a static website, which can then be uploaded to a static web host.
- Use
wget
to download target website into a static website- Recursively download the entire website
- Recursive download sitemaps by first downloading
/sitemap.xml
, parsing and downloading the individual sitemap files
- Remove query hash from
css
andjs
filename (ghost specific) - Replace query hash entities from
css
andjs
references inindex.html
files (ghost specific) - Replace http with https
- Replace localhost links with live domain
- Prettify url using directory name instead of index.html(e.g. /about instead of /about/index.html, / instead of /index.html)
Run ./build_static_website
, which prompts you for your localhost website and your live website.
Example
Enter the domain of your localhost server:
localhost:2368
Enter the domain of your live website:
mysite.com
A copy of the static website is written to the path ../ghost-static-generated/
.
Upload it to a static web host!