Static website for RetroMMO with organized file structure and build process.
src/
├── template.mustache # Main HTML template
├── pages/ # Page content and metadata
│ ├── index.html # Page content (just the main section)
│ ├── index.json # Page metadata (title, description, etc.)
│ ├── play.html
│ ├── play.json
│ └── ...
└── static/ # Static assets (CSS, JS, images, fonts, etc.)
-
Install dependencies:
npm install
-
Build and start the server:
npm start
-
Visit
http://localhost:3000
The build process uses Mustache templating:
- Run build only:
npm run build - Copies static files from
src/static/toout/ - Uses
src/template.mustacheas the main template - Combines page content from
src/pages/*.htmlwith metadata fromsrc/pages/*.json - Generates final HTML files in
/out - The server serves files from
/out
- Add your content HTML file to
src/pages/(just the main content, no full HTML structure) - Add corresponding JSON file with metadata (title, description, css, etc.)
- Run
npm run buildto generate the final HTML - The server will automatically create a route for it
index.htmlserves at/, other files serve at/{filename}
Each page can use these variables in its JSON file:
title: Page titledescription: Meta descriptionkeywords: Meta keywordscanonical: Canonical URLcss: CSS file pathjs: JavaScript file path (optional)
The site automatically deploys to GitHub Pages when you push to the main branch:
- GitHub Actions runs the build process (
npm run build) - The
/outdirectory is deployed to GitHub Pages - The site is available at your GitHub Pages URL
For other hosting platforms:
- Run
npm run buildto generate the/outdirectory - Deploy the contents of
/outto your static hosting service
build.js: Build script that copiessrc/static/toout/package.json: npm scripts and dependencies.github/workflows/deploy.yml: GitHub Pages deployment configuration