This generator transforms our WordPress site to a static version.
-
Run the latest version of WordPress locally or in e.g. AWS. Let's assume you have it running at
http://localhost:3000
. -
Run
node . http://localhost:3000
You can also test this generator by pointing it to
node . https://alvarcarto.com
. Beware that CloudFlare may have some scraping protections in place. -
cd ../alvarcarto.com
-
Commit changes and push to Github
-
Verify that QA site looks OK (auto-deployment enabled)
-
Deploy to production and lock the deployment
The currently working command is below. Link checker is broken: stevenvachon/broken-link-checker#76.
node . --no-check-broken-links -o ../alvarcarto.com https://alvarcarto-wordpress.herokuapp.com
-
Start alvarcarto-site with
docker-compose up
-
Run generator
node . --no-check-broken-links -o ../alvarcarto.com http://localhost:8080
-
npm install
-
cd .. && git clone [email protected]:kimmobrunfeldt/alvarcarto.com.git
Clone alvarcarto.com repository aside this repository. You should have e.g.
code/alvarcarto-site-generator
andcode/alvarcarto.com
repo directories.The generator will spit the files to
../alvarcarto.com
by default.
-
Scrape the WordPress site withnode-website-scraper.
The scraper should make almost 1-to-1 copy of the site. Directory structure and everything should match.
-
Download manual urls
Not all files are reachable via normal site links and scraping, so we have a whitelist of urls to manually download. For example sitemap files.
-
Copy everything from
files/*
on top of that
This is useful for e.g. Netlify-specific files or any possible manual overrides.
Some broken links are normal. They are configured in top-level site hosting instead of WP level.
BROKEN https://alvarcarto-wordpress.herokuapp.com/phone-background/ -> generator/
BROKEN https://alvarcarto-wordpress.herokuapp.com/phone-background/ -> generator/