How h5bp/html5-boilerplate works
1. What this repository is
- This is the authoring repo for HTML5 Boilerplate, a static front-end starter template.
- The real deliverable is the contents of /dist; the rest of the repo exists to build, validate, document, and publish that deliverable.
2. Primary architectural boundary: authoring vs published output
- src/ contains the editable source template.
- dist/ contains the distributable package that end users install or copy into their projects.
- In practice, the architecture is “source files in src → build pipeline → packaged assets in dist”.
3. Published asset set
- The template is mostly static site assets:
- index.html, 404.html
- css/style.css
- js/app.js
- img/
- robots.txt
- site.webmanifest
- These files form the baseline site shell and are intentionally framework-agnostic.
4. JavaScript and CSS structure
- The repo does not impose an application framework or SPA architecture.
- src/js/app.js is the application entry point for starter scripts.
- src/css is not present as a separate tree in the file list, which signals that the CSS is authored primarily in the template stylesheet and shipped as a minimal default.
- The project emphasizes progressive enhancement and “delete-key friendly” customization rather than complex internal layering.
5. Build and packaging pipeline
- Build orchestration is handled by gulpfile.mjs and Webpack configs in both src/ and dist/.
- The build system produces the publishable assets in dist/, likely bundling/minifying front-end resources and preparing a package that can be consumed via npm or copied directly.
- The presence of separate dev/prod webpack configs indicates distinct development and production build modes.
6. Distribution packaging
- The dist/ folder includes its own package.json, which indicates the published artifact is itself an npm-distributable package.
- This repo therefore serves both as a template source tree and as the build source for a packaged distribution artifact.
7. Documentation subsystem
- The docs/ directory contains the main project documentation, split into topics such as:
- HTML
- CSS
- JavaScript
- usage
- extension guidance
- FAQ and miscellany
- The docs are part of the repository’s product surface because the template is intended to be modified and extended by consumers.
8. Validation and tests
- The test/ directory contains checks like:
- content verification
- file existence verification
- This suggests the repo’s quality gate is centered on ensuring the generated template contains the expected baseline files and text, rather than testing runtime business logic.
9. Continuous integration and release flow
- GitHub Actions workflows cover build, test, dependency review, CodeQL, spellcheck, scorecard, and publish tasks.
- The release pipeline is important because this repo’s architecture includes a formal “build and publish the template” path, not just local development.
10. Project conventions and maintainability
- Tooling files such as ESLint, Prettier, cspell, and editor configs are used to keep the template and documentation consistent.
- These do not affect runtime behavior, but they matter for understanding how the repository is maintained and how changes are validated.
11. How to diagram the system
- Draw three main areas:
- Authoring source: src/, docs/, test/, and build scripts
- Build/CI layer: Gulp, Webpack, GitHub Actions
- Published artifact: dist/
- The only significant data flow is from source/template files through the build pipeline into the distributable static site package.
12. Overall architectural summary
- This is not a server-side application or a multi-service system.
- It is a static template repository with a clearly separated source tree, build tooling, and packaged output, designed to produce a reusable front-end boilerplate rather than run as a live application itself.
Main entry points: dist Distribution tree · src Source tree · gulpfile.mjs Gulp build · build-dist.yml GitHub Actions
Components 17
Authoring source
Editable template, docs, and validation
- Source tree · Editable starter template and package source
src - HTML shell · Primary site shell and fallback page
src/index.html - Starter JS · Default script entry point for progressive enhancement
src/js/app.js - Static assets · Images, robots rules, and web manifest
src - Source package · Package metadata for the source tree
src/package.json - Docs · Project guidance for HTML, CSS, JS, usage, and extension
docs - Checks · File-content and file-existence verification
test
Build and CI
Tooling that assembles, checks, and publishes the template
- Gulp build · Build coordination for source-to-dist packaging
gulpfile.mjs - Source webpack · Webpack configuration used from the source tree
src/webpack.common.js - Dist webpack · Webpack configuration shipped with the distributable package
dist/webpack.common.js - GitHub Actions · Build, test, analysis, spellcheck, and publish workflows
.github/workflows/build-dist.yml
Published artifact
Distributable static starter package
- Distribution tree · Build output consumed as the installable boilerplate
dist - Published HTML · Distributed HTML entry pages
dist/index.html - Published CSS · Distributed default styling
dist/css/style.css - Published JS · Distributed starter script
dist/js/app.js - Published assets · Images, robots rules, and manifest in the packaged output
dist - Dist package · npm metadata for the distributable artifact
dist/package.json
Connections 20
- Source tree → HTML shell: contains · Source tree includes the editable HTML shell
- Source tree → Starter JS: contains · Source tree includes starter JavaScript
- Source tree → Static assets: contains · Source tree includes static assets
- Source tree → Source package: packages · Source tree defines its package metadata
- Source tree → Source webpack: configured by · Source tree is built with webpack config
- Docs → Source tree: guides · Documentation explains how to use and extend the source template
- Checks → Source tree: verifies · Checks validate expected source files and content
- Gulp build → Distribution tree: builds · Gulp orchestrates creation of the distributable package
- Gulp build → Source tree: reads · Build pipeline consumes editable source files
- Gulp build → Source webpack: uses · Build pipeline uses source webpack configuration
- Distribution tree → Published HTML: contains · Distribution includes published HTML
- Distribution tree → Published CSS: contains · Distribution includes published CSS
- Distribution tree → Published JS: contains · Distribution includes published JavaScript
- Distribution tree → Published assets: contains · Distribution includes packaged static assets
- Distribution tree → Dist package: packages · Distribution is itself an npm package
- Distribution tree → Dist webpack: configured by · Published package carries its webpack config
- Source tree → Distribution tree: publishes to · Source template is transformed into the distributable output
- GitHub Actions → Gulp build: runs · CI workflows execute build orchestration
- GitHub Actions → Checks: runs · CI workflows execute repository checks
- GitHub Actions → Distribution tree: releases · Release workflow publishes the distributable artifact