This project demonstrates how to build a static site just like you build a dynamic server-based site with the following approach:
Build a regular server-based site and pre-render all possible routes to static HTML files (and just bundle up all of the other static front-end assets). Your site then becomes a dynamically generated static site and you will have infinite flexibility.
Demo URL: http://patrick-steele-idem.github.io/dynamically-generated-static-site/
Technologies used:
- Express - Server-side web "framework"
- Marko - Templating engine
- Lasso.js - Asset pipeline and JavaScript module bundler
git clone https://github.com/patrick-steele-idem/dynamically-generated-static-site.git
cd dynamically-generated-static-site
npm install
node server.js
Open http://localhost:8080/
in your browser to test it out
You can also use browser-refresh to start your server for instant page refreshes as you work on your site:
browser-refresh server.js
rm -rf build/ .cache/
NODE_ENV=production node build.js
./node_modules/.bin/http-server build/