Modular build system for static landing pages with automatic optimization.
WebP conversion, minification, cache busting, and complete SEO out of the box. Each page lives in its own isolated folder with HTML, SCSS, and JavaScript. Production-ready performance from day one.
- π¨ SCSS compilation with automatic minification
- β‘ JavaScript bundling with esbuild
- πΌοΈ Image optimization - Auto-converts to WebP + optimized originals
- π Cache busting - MD5 hashes on all assets
- π SEO automation - Meta tags, Open Graph, Twitter Cards, Structured Data (JSON-LD)
- π Auto-generated sitemap.xml and robots.txt
- π Live reload with BrowserSync
- π― Modular structure - One folder per page
Before you begin, make sure you have installed:
git clone https://github.com/yourusername/site-forge.git
cd site-forgenpm installReplace the example values with your own:
{
"site": {
"url": "https://yoursite.com", // β Your site URL
"name": "Your Site Name", // β Your site name
"defaultImage": "/assets/og-default.png"
},
"googleAnalytics": {
"measurementId": "G-XXXXXXXXXX" // β Your GA4 ID (optional)
},
"robots": {
"disallow": ["/admin/"]
},
"favicons": {
"enabled": true,
"basePath": "/assets"
},
"seo": {
"autoInject": true,
"includeOpenGraph": true,
"includeTwitterCard": true
}
}{
"name": "Your App Name", // β Your app full name
"short_name": "YourApp", // β Your app short name
"icons": [
{
"src": "/assets/web-app-manifest-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "/assets/web-app-manifest-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
],
"theme_color": "#ffffff", // β Your theme color
"background_color": "#ffffff", // β Your background color
"display": "standalone"
}Search for all occurrences of https://example.com in your project and replace with your actual site URL:
In VS Code:
- Press
Ctrl+Shift+H(Windows/Linux) orCmd+Shift+H(Mac) - Type
https://example.comin the search field - Type your URL (e.g.,
https://yoursite.com) in the replace field - Click "Replace All"
Files that may contain this URL:
config.jsonsrc/home/meta.jsonsrc/404/meta.json- Any other
meta.jsonfiles you create
Replace the placeholder images in src/assets/ with your own:
| File | Purpose | Recommended Size |
|---|---|---|
favicon.ico |
Browser tab icon (legacy) | 32x32px or 48x48px |
favicon.svg |
Browser tab icon (modern) | Vector SVG |
favicon-96x96.png |
Browser tab icon | 96x96px |
apple-touch-icon.png |
iOS home screen icon | 180x180px |
web-app-manifest-192x192.png |
Web app icon (small) | 192x192px |
web-app-manifest-512x512.png |
Web app icon (large) | 512x512px |
og-default.png |
Social share image (default) | 1200x630px |
og-image.png |
Social share image (home) | 1200x630px |
logo.png |
General logo | Your preference |
How to generate favicons:
You can use online tools like:
- Favicon.io - Generate from text, image, or emoji
- RealFaviconGenerator - Comprehensive favicon generator
Tips:
- Keep favicons simple and recognizable at small sizes
- Use high contrast colors
- Test how they look on both light and dark backgrounds
- For Open Graph images (og-*.png), use 1200x630px for best results on all platforms
npm startThis will:
- Clean the
public/folder - Build all assets (SCSS, JS, images)
- Generate HTML with optimizations
- Start development server with live reload
- Open your browser at
http://localhost:3000
site-forge/
βββ src/ # Source files
β βββ home/ # Home page
β β βββ index.html # HTML structure
β β βββ meta.json # SEO metadata
β β βββ styles.scss # Page styles
β β βββ script.js # Page JavaScript (optional)
β β
β βββ 404/ # 404 error page
β β βββ index.html
β β βββ meta.json
β β βββ styles.scss
β β
β βββ assets/ # Static assets
β βββ images/ # Images (auto-optimized)
β βββ favicon.ico
β βββ favicon.svg
β βββ site.webmanifest
β
βββ scripts/ # Build scripts
β βββ build-html.js
β βββ build-scss.js
β βββ build-js.js
β βββ optimize-images.js
β βββ hash-assets.js
β βββ ...
β
βββ public/ # Generated files (gitignored)
β βββ index.html
β βββ 404.html
β βββ css/
β βββ js/
β βββ assets/
β βββ sitemap.xml
β βββ robots.txt
β
βββ config.json # Site configuration
βββ package.json
βββ .editorconfig
βββ .prettierrc
βββ README.md
Each page lives in its own folder inside src/. Here's how to create one:
mkdir src/about<!-- Minimal structure -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body>
<!-- Your body here -->
</body>
</html>{
"title": "About Us - Your Site Name",
"description": "Learn more about our company and mission.",
"keywords": "about, company, mission",
"author": "Your Name",
"image": "/assets/images/about-og.jpg",
"type": "website",
"siteName": "Your Site Name",
"locale": "en_US",
"twitterCard": "summary_large_image",
"sitemap": {
"priority": "0.8",
"changefreq": "monthly"
},
"structuredData": {
"type": "WebPage",
"name": "About Us",
"description": "Learn more about our company and mission."
}
}body {
font-family:
system-ui,
-apple-system,
sans-serif;
padding: 2rem;
max-width: 800px;
margin: 0 auto;
}
h1 {
color: #333;
margin-bottom: 1rem;
}console.log("About page loaded!");npm run buildYour new page will be available at:
- Development:
http://localhost:3000/about/ - Production:
https://yoursite.com/about/
npm start # Build + watch + live reload (recommended)
npm run dev # Watch + live reload only (no initial build)npm run build # Full production build
npm run clean # Clean public/ folder
npm run build:scss # Compile SCSS only
npm run build:js # Minify JS only
npm run optimize:images # Optimize images only
npm run hash:assets # Add cache-busting hashes
npm run build:html # Process HTML with injectionsnpm run format # Format all files (auto-fix)
npm run format:check # Check formatting (no changes)Update in multiple places:
config.json- Update theme color if neededsrc/assets/site.webmanifest- Updatetheme_colorandbackground_color- Your SCSS files - Update color variables
- Get your GA4 Measurement ID from Google Analytics
- Update
config.json:
{
"googleAnalytics": {
"measurementId": "G-XXXXXXXXXX" // β Paste your ID here
}
}The build script will automatically inject the tracking code.
Edit config.json:
{
"googleAnalytics": {
"measurementId": "" // β Leave empty to disable
},
"favicons": {
"enabled": false // β Disable favicon injection
},
"seo": {
"autoInject": false, // β Disable all SEO auto-injection
"includeOpenGraph": false,
"includeTwitterCard": false
}
}All images in src/assets/ are automatically:
- Converted to WebP (85% quality)
- Optimized in original format (85% quality)
- Hashed for cache busting
- Wrapped in
<picture>tags in HTML
.jpg/.jpeg.png.webp
Input: src/assets/images/hero.jpg
Output:
public/assets/images/hero.a1b2c3d4.jpg(optimized)public/assets/images/hero.a1b2c3d4.webp(WebP version)
In HTML:
<!-- Automatically generated -->
<picture>
<source srcset="/assets/images/hero.a1b2c3d4.webp" type="image/webp" />
<img src="/assets/images/hero.a1b2c3d4.jpg" alt="Hero image" />
</picture>meta.json- Contains all SEO metadata- Social share image - Recommended size: 1200x630px
{
"title": "Page Title - Site Name",
"description": "A compelling description under 160 characters.",
"keywords": "keyword1, keyword2, keyword3",
"author": "Your Name",
"image": "/assets/images/page-og.jpg",
"type": "website",
"siteName": "Your Site Name",
"locale": "en_US",
"twitterCard": "summary_large_image",
"twitterCreator": "@yourusername",
"sitemap": {
"priority": "0.8",
"changefreq": "weekly"
},
"structuredData": {
"type": "WebPage",
"name": "Page Title",
"description": "Page description for search engines."
}
}You can use any Schema.org type. Common examples:
- WebPage - Default for most pages
- Person - About/bio pages
- SoftwareApplication - Product pages
- FAQPage - FAQ sections
npm run buildThis creates optimized files in public/ folder.
- Connect your GitHub repo
- Build command:
npm run build - Publish directory:
public
- Import your GitHub repo
- Framework preset: Other
- Build command:
npm run build - Output directory:
public
- Build locally:
npm run build - Copy
public/contents to your gh-pages branch - Or use GitHub Actions for automatic deployment
- Build locally:
npm run build - Upload contents of
public/folder to your web server - Point your domain to the uploaded folder
The project includes .vscode/extensions.json with recommended extensions:
- Prettier - Code formatter
- EditorConfig - Maintain consistent coding styles
- ESLint - JavaScript linting
- Stylelint - CSS/SCSS linting
VS Code will prompt you to install these when you open the project.
Already configured in .vscode/settings.json! Just press Ctrl+S (or Cmd+S on Mac) and your code will auto-format.
Change the port in package.json:
"browser-sync": "browser-sync start --server public --files \"public/**/*\" --no-notify --port 3001"Make sure Sharp is installed correctly:
npm install sharp --save-devIf issues persist on Windows, you may need to install build tools:
npm install --global windows-build-toolsCheck that your SCSS syntax is valid. The build will show errors in the console.
- Delete
node_modules/andpackage-lock.json - Run
npm installagain - Try
npm run buildagain
The project uses Prettier and EditorConfig for consistent code style.
npm run formatnpm run format:checkAlready configured! Just save your file and it will auto-format.
MIT License - feel free to use this project for personal or commercial purposes.
Contributions are welcome! Feel free to:
- Report bugs
- Suggest features
- Submit pull requests
Need help? Create an issue on GitHub or reach out to the community.
- Update
config.jsonwith your information - Update
src/assets/site.webmanifestwith your app name - Replace
https://example.comwith your URL - Replace all brand assets in
src/assets/(favicons, OG images, logo) - Create your first page in
src/ - Customize styles in SCSS files
- Add your content
- Build and deploy! π
Made with β€οΈ by Samuel CaetitΓ©