create-vanilla-html-site
v1.0.5
Published
CLI to scaffold a multi-page vanilla HTML project with Modern DX (Tailwind, Live Reload, Partials, etc.)
Maintainers
Readme
vanilla-html template
A Multi-Page Vanilla HTML Template with Modern DX (Tailwind, Live Reload, Partials, etc.)
vanilla-html is unopinionated - write plain HTML, JS, and CSS, ornpm install react react-dom if you prefer.
Commands
Create a new multi-page vanilla html site:
npm create vanilla-html-site@latestStart dev server with live reloading:
npm run devBuild for production, output to dist folder:
npm run buildPreview dist folder:
npm run previewDeploy to Cloudflare Pages:
npm run build && npx wrangler pages deploy distRouting
It uses file-based routing. Your src folder structure defines the URLs.
Organize your HTML, scripts, styles, and assets (images, videos) freely within src and its subfolders.
For example: this About page resides in the src/other/ folder.
<a href="./other/about.html">About page</a>Note the ./ at the beginning - it's a relative path.
HTML Components / Partials
vanilla-html uses posthtml-include to support HTML components.
Write your HTML components in src/components and include them in your HTML files like this:
<include src="./components/header.html"></include>To pass data to a partial (data must be in JSON, not JS object):
<include src="./components/header.html">
{ "title": "vanilla-html guide" }
</include>