├── src ├── js │ ├── app.js │ └── vendor │ │ └── .gitkeep ├── img │ └── .gitkeep ├── icon.png ├── favicon.ico ├── robots.txt ├── .editorconfig ├── .gitignore ├── webpack.common.js ├── site.webmanifest ├── webpack.config.dev.js ├── icon.svg ├── package.json ├── webpack.config.prod.js ├── index.html ├── 404.html └── .gitattributes ├── dist ├── img │ └── .gitkeep ├── js │ ├── app.js │ └── vendor │ │ └── .gitkeep ├── icon.png ├── favicon.ico ├── robots.txt ├── .editorconfig ├── .gitignore ├── webpack.common.js ├── site.webmanifest ├── webpack.config.dev.js ├── icon.svg ├── package.json ├── webpack.config.prod.js ├── index.html ├── LICENSE.txt ├── 404.html ├── .gitattributes └── css │ └── style.css ├── .prettierignore ├── .npmrc ├── .gitignore ├── .github ├── SUPPORT.md ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── feature_request.yml │ └── bug_report.yml ├── dependabot.yml ├── workflows │ ├── dependency-review.yml │ ├── spellcheck.yml │ ├── codeql-analysis.yml │ ├── test.yml │ ├── ossf-scorecard.yml │ ├── push-to-template.yml │ ├── build-dist.yml │ └── publish.yml ├── PULL_REQUEST_TEMPLATE.md ├── CODE_OF_CONDUCT.md └── CONTRIBUTING.md ├── .vscode ├── extensions.json └── settings.json ├── .prettierrc.json ├── .editorconfig ├── .cspell.json ├── docs ├── js.md ├── faq.md ├── css.md ├── TOC.md ├── usage.md ├── misc.md ├── html.md ├── about-this-repo.md └── extend.md ├── eslint.config.mjs ├── .gitattributes ├── LICENSE.txt ├── package.json ├── test ├── file_content.mjs └── file_existence.mjs ├── gulpfile.mjs ├── README.md └── CHANGELOG.md /src/js/app.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dist/img/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dist/js/app.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/img/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dist/js/vendor/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/js/vendor/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | lockfile-version = 3 2 | registry = "https://registry.npmjs.org/" 3 | -------------------------------------------------------------------------------- /src/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/h5bp/html5-boilerplate/HEAD/src/icon.png -------------------------------------------------------------------------------- /dist/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/h5bp/html5-boilerplate/HEAD/dist/icon.png -------------------------------------------------------------------------------- /src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/h5bp/html5-boilerplate/HEAD/src/favicon.ico -------------------------------------------------------------------------------- /dist/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/h5bp/html5-boilerplate/HEAD/dist/favicon.ico -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **/.DS_Store 2 | archive 3 | node_modules 4 | packages 5 | dist/package-lock.json 6 | src/package-lock.json 7 | -------------------------------------------------------------------------------- /dist/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/ 2 | 3 | # Allow crawling of all content 4 | User-agent: * 5 | Disallow: 6 | -------------------------------------------------------------------------------- /src/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/ 2 | 3 | # Allow crawling of all content 4 | User-agent: * 5 | Disallow: 6 | -------------------------------------------------------------------------------- /.github/SUPPORT.md: -------------------------------------------------------------------------------- 1 | # Support 2 | 3 | For personal support requests with HTML5 Boilerplate please use Stack Overflow 4 | ([`html5boilerplate`](https://stackoverflow.com/questions/tagged/html5boilerplate) 5 | tag). 6 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "dbaeumer.vscode-eslint", 4 | "editorconfig.editorconfig", 5 | "esbenp.prettier-vscode", 6 | "streetsidesoftware.code-spell-checker" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /dist/.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | charset = utf-8 7 | end_of_line = lf 8 | indent_size = 2 9 | indent_style = space 10 | insert_final_newline = true 11 | trim_trailing_whitespace = true 12 | -------------------------------------------------------------------------------- /src/.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | 3 | root = true 4 | 5 | [*] 6 | charset = utf-8 7 | end_of_line = lf 8 | indent_size = 2 9 | indent_style = space 10 | insert_final_newline = true 11 | trim_trailing_whitespace = true 12 | -------------------------------------------------------------------------------- /dist/.gitignore: -------------------------------------------------------------------------------- 1 | # Include your project-specific ignores in this file 2 | # Read about how to use .gitignore: https://help.github.com/articles/ignoring-files 3 | # Useful .gitignore templates: https://github.com/github/gitignore 4 | node_modules 5 | dist 6 | .cache -------------------------------------------------------------------------------- /src/.gitignore: -------------------------------------------------------------------------------- 1 | # Include your project-specific ignores in this file 2 | # Read about how to use .gitignore: https://help.github.com/articles/ignoring-files 3 | # Useful .gitignore templates: https://github.com/github/gitignore 4 | node_modules 5 | dist 6 | .cache -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Ask the community 4 | url: https://github.com/h5bp/html5-boilerplate/discussions/new 5 | about: Ask and discuss questions with other HTML5 Boilerplate community members. 6 | -------------------------------------------------------------------------------- /dist/webpack.common.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | module.exports = { 4 | entry: { 5 | app: './js/app.js', 6 | }, 7 | output: { 8 | path: path.resolve(__dirname, 'dist'), 9 | clean: true, 10 | filename: './js/app.js', 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /src/webpack.common.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | module.exports = { 4 | entry: { 5 | app: './js/app.js', 6 | }, 7 | output: { 8 | path: path.resolve(__dirname, 'dist'), 9 | clean: true, 10 | filename: './js/app.js', 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "bracketSameLine": true, 3 | "embeddedLanguageFormatting": "off", 4 | "singleQuote": true, 5 | "overrides": [ 6 | { 7 | "files": "**/*.yml", 8 | "options": { 9 | "singleQuote": false 10 | } 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /dist/site.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "", 3 | "name": "", 4 | "icons": [{ 5 | "src": "icon.png", 6 | "type": "image/png", 7 | "sizes": "192x192" 8 | }], 9 | "start_url": "/?utm_source=homescreen", 10 | "background_color": "#fafafa", 11 | "theme_color": "#fafafa" 12 | } 13 | -------------------------------------------------------------------------------- /src/site.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "", 3 | "name": "", 4 | "icons": [{ 5 | "src": "icon.png", 6 | "type": "image/png", 7 | "sizes": "192x192" 8 | }], 9 | "start_url": "/?utm_source=homescreen", 10 | "background_color": "#fafafa", 11 | "theme_color": "#fafafa" 12 | } 13 | -------------------------------------------------------------------------------- /src/webpack.config.dev.js: -------------------------------------------------------------------------------- 1 | const { merge } = require('webpack-merge'); 2 | const common = require('./webpack.common.js'); 3 | 4 | module.exports = merge(common, { 5 | mode: 'development', 6 | devtool: 'inline-source-map', 7 | devServer: { 8 | liveReload: true, 9 | hot: true, 10 | open: true, 11 | static: ['./'], 12 | }, 13 | }); 14 | -------------------------------------------------------------------------------- /dist/webpack.config.dev.js: -------------------------------------------------------------------------------- 1 | const { merge } = require('webpack-merge'); 2 | const common = require('./webpack.common.js'); 3 | 4 | module.exports = merge(common, { 5 | mode: 'development', 6 | devtool: 'inline-source-map', 7 | devServer: { 8 | liveReload: true, 9 | hot: true, 10 | open: true, 11 | static: ['./'], 12 | }, 13 | }); 14 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # For more information about the properties used in 2 | # this file, please see the EditorConfig documentation: 3 | # https://editorconfig.org/ 4 | 5 | root = true 6 | 7 | [*] 8 | charset = utf-8 9 | end_of_line = lf 10 | indent_size = 2 11 | indent_style = space 12 | insert_final_newline = true 13 | trim_trailing_whitespace = true 14 | 15 | [*.md] 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /dist/icon.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/icon.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: npm 4 | directory: "/" 5 | schedule: 6 | interval: monthly 7 | versioning-strategy: increase 8 | - package-ecosystem: npm 9 | directory: "/src/" 10 | schedule: 11 | interval: monthly 12 | versioning-strategy: increase 13 | - package-ecosystem: github-actions 14 | directory: "/" 15 | schedule: 16 | interval: monthly 17 | -------------------------------------------------------------------------------- /.cspell.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2", 3 | "words": [ 4 | "codeql", 5 | "devdeps", 6 | "FOUC", 7 | "lighttpd", 8 | "mkdir", 9 | "modernizr", 10 | "robotstxt", 11 | "vuejs", 12 | "cpina" 13 | ], 14 | "language": "en,en-GB,en-US", 15 | "allowCompoundWords": true, 16 | "files": ["**/*.md"], 17 | "ignoreRegExpList": ["\\_\\w+", "\\#\\w+"], 18 | "ignorePaths": [".cspell.json"], 19 | "useGitignore": true 20 | } 21 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "[javascript][typescript][json][jsonc][markdown][yaml]": { 3 | "editor.defaultFormatter": "esbenp.prettier-vscode", 4 | "editor.formatOnSave": true 5 | }, 6 | "[javascript][typescript]": { 7 | "editor.codeActionsOnSave": { 8 | "source.fixAll.eslint": "explicit" 9 | } 10 | }, 11 | "eslint.validate": ["javascript", "typescript"], 12 | "editor.formatOnSave": true, 13 | "editor.renderWhitespace": "all", 14 | "files.trimTrailingWhitespace": true 15 | } 16 | -------------------------------------------------------------------------------- /docs/js.md: -------------------------------------------------------------------------------- 1 | [HTML5 Boilerplate homepage](https://html5boilerplate.com/) | [Documentation 2 | table of contents](TOC.md) 3 | 4 | # The JavaScript 5 | 6 | Information about the default JavaScript included in the project. 7 | 8 | ## app.js 9 | 10 | This file can be used to contain or reference your site/app JavaScript code. If 11 | you're working on something more advanced you might replace this file entirely. 12 | That's cool. 13 | 14 | ## vendor 15 | 16 | This directory can be used to contain all third-party library code. 17 | -------------------------------------------------------------------------------- /.github/workflows/dependency-review.yml: -------------------------------------------------------------------------------- 1 | name: "Dependency Review" 2 | on: [pull_request] 3 | 4 | permissions: 5 | contents: read 6 | 7 | jobs: 8 | dependency-review: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: "Checkout Repository" 12 | uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 13 | with: 14 | persist-credentials: false 15 | 16 | - name: "Dependency Review" 17 | uses: actions/dependency-review-action@595b5aeba73380359d98a5e087f648dbb0edce1b # v4.7.3 18 | -------------------------------------------------------------------------------- /docs/faq.md: -------------------------------------------------------------------------------- 1 | [HTML5 Boilerplate homepage](https://html5boilerplate.com/) | [Documentation 2 | table of contents](TOC.md) 3 | 4 | # Frequently asked questions 5 | 6 | ## Do I need to upgrade my site each time a new version of HTML5 Boilerplate is released? 7 | 8 | No, just as you don't normally replace the foundation of a house once it was 9 | built. However, there is nothing stopping you from trying to work in the latest 10 | changes, but you'll have to assess the costs/benefits of doing so. 11 | 12 | ## Where can I get help with support questions? 13 | 14 | Please ask for help on 15 | [Stack Overflow](https://stackoverflow.com/questions/tagged/html5boilerplate). 16 | -------------------------------------------------------------------------------- /dist/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": " ", 3 | "version": "0.0.1", 4 | "description": "", 5 | "private": true, 6 | "keywords": [ 7 | "" 8 | ], 9 | "license": "", 10 | "author": "", 11 | "scripts": { 12 | "test": "echo \"Error: no test specified\" && exit 1", 13 | "start": "webpack serve --open --config webpack.config.dev.js", 14 | "build": "webpack --config webpack.config.prod.js" 15 | }, 16 | "devDependencies": { 17 | "copy-webpack-plugin": "^13.0.1", 18 | "html-webpack-plugin": "^5.6.4", 19 | "webpack": "^5.101.3", 20 | "webpack-cli": "^6.0.1", 21 | "webpack-dev-server": "^5.2.2", 22 | "webpack-merge": "^6.0.1" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": " ", 3 | "version": "0.0.1", 4 | "description": "", 5 | "private": true, 6 | "keywords": [ 7 | "" 8 | ], 9 | "license": "", 10 | "author": "", 11 | "scripts": { 12 | "test": "echo \"Error: no test specified\" && exit 1", 13 | "start": "webpack serve --open --config webpack.config.dev.js", 14 | "build": "webpack --config webpack.config.prod.js" 15 | }, 16 | "devDependencies": { 17 | "copy-webpack-plugin": "^13.0.1", 18 | "html-webpack-plugin": "^5.6.4", 19 | "webpack": "^5.101.3", 20 | "webpack-cli": "^6.0.1", 21 | "webpack-dev-server": "^5.2.2", 22 | "webpack-merge": "^6.0.1" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /.github/workflows/spellcheck.yml: -------------------------------------------------------------------------------- 1 | name: "Check spelling" 2 | on: # rebuild any PRs and main branch changes 3 | push: 4 | branches-ignore: 5 | - "dependabot/**" 6 | pull_request: 7 | 8 | permissions: 9 | contents: read 10 | 11 | jobs: 12 | spellcheck: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 16 | with: 17 | persist-credentials: false 18 | 19 | - uses: streetsidesoftware/cspell-action@dcd03dc3e8a59ec2e360d0c62db517baa0b4bb6d # v7.2.0 20 | with: 21 | inline: warning 22 | strict: false 23 | incremental_files_only: true 24 | -------------------------------------------------------------------------------- /docs/css.md: -------------------------------------------------------------------------------- 1 | [HTML5 Boilerplate homepage](https://html5boilerplate.com/) | [Documentation 2 | table of contents](TOC.md) 3 | 4 | # The CSS 5 | 6 | HTML5 Boilerplate's CSS includes: 7 | 8 | - [style.css](#stylecss) 9 | 10 | ## style.css 11 | 12 | Several base styles are included. These styles: 13 | 14 | - provide basic typography settings that improve text readability 15 | - protect against unwanted `text-shadow` during text highlighting 16 | - tweak the default alignment of some elements (e.g.: `img`, `video`, 17 | `fieldset`, `textarea`) 18 | - style the prompt that is displayed to users using an outdated browser 19 | - and more... 20 | 21 | These styles are included in 22 | [style.css](https://github.com/h5bp/html5-boilerplate/blob/main/dist/css/style.css). 23 | -------------------------------------------------------------------------------- /eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import globals from 'globals'; 2 | import js from '@eslint/js'; 3 | import mocha from 'eslint-plugin-mocha'; 4 | import { defineConfig } from 'eslint/config'; 5 | 6 | export default defineConfig([ 7 | { 8 | files: ['**/*.js'], 9 | plugins: { 10 | js, 11 | mocha, 12 | }, 13 | languageOptions: { 14 | ecmaVersion: 2020, 15 | sourceType: 'module', 16 | globals: { 17 | ...globals.browser, 18 | ...globals.node, 19 | ...globals.mocha, 20 | }, 21 | }, 22 | extends: ['js/recommended'], 23 | rules: { 24 | // Your custom rules 25 | indent: ['error', 2], 26 | quotes: ['error', 'single'], 27 | semi: ['error', 'always'], 28 | }, 29 | }, 30 | ]); 31 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Automatically normalize line endings for all text-based files 2 | # https://git-scm.com/docs/gitattributes#_end_of_line_conversion 3 | 4 | * text=auto 5 | 6 | # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 7 | 8 | # For the following file types, normalize line endings to LF on 9 | # checkin and prevent conversion to CRLF when they are checked out 10 | # (this is required in order to prevent newline related issues like, 11 | # for example, after the build script is run) 12 | 13 | .* text eol=lf 14 | *.css text eol=lf 15 | *.html text eol=lf 16 | *.js text eol=lf 17 | *.json text eol=lf 18 | *.md text eol=lf 19 | *.mjs text eol=lf 20 | *.sh text eol=lf 21 | *.txt text eol=lf 22 | *.xml text eol=lf 23 | *.yml text eol=lf 24 | -------------------------------------------------------------------------------- /dist/webpack.config.prod.js: -------------------------------------------------------------------------------- 1 | const { merge } = require('webpack-merge'); 2 | const common = require('./webpack.common.js'); 3 | const HtmlWebpackPlugin = require('html-webpack-plugin'); 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = merge(common, { 7 | mode: 'production', 8 | plugins: [ 9 | new HtmlWebpackPlugin({ 10 | template: './index.html', 11 | }), 12 | new CopyPlugin({ 13 | patterns: [ 14 | { from: 'img', to: 'img' }, 15 | { from: 'css', to: 'css' }, 16 | { from: 'js/vendor', to: 'js/vendor' }, 17 | { from: 'icon.svg', to: 'icon.svg' }, 18 | { from: 'favicon.ico', to: 'favicon.ico' }, 19 | { from: 'robots.txt', to: 'robots.txt' }, 20 | { from: 'icon.png', to: 'icon.png' }, 21 | { from: '404.html', to: '404.html' }, 22 | { from: 'site.webmanifest', to: 'site.webmanifest' }, 23 | ], 24 | }), 25 | ], 26 | }); 27 | -------------------------------------------------------------------------------- /src/webpack.config.prod.js: -------------------------------------------------------------------------------- 1 | const { merge } = require('webpack-merge'); 2 | const common = require('./webpack.common.js'); 3 | const HtmlWebpackPlugin = require('html-webpack-plugin'); 4 | const CopyPlugin = require('copy-webpack-plugin'); 5 | 6 | module.exports = merge(common, { 7 | mode: 'production', 8 | plugins: [ 9 | new HtmlWebpackPlugin({ 10 | template: './index.html', 11 | }), 12 | new CopyPlugin({ 13 | patterns: [ 14 | { from: 'img', to: 'img' }, 15 | { from: 'css', to: 'css' }, 16 | { from: 'js/vendor', to: 'js/vendor' }, 17 | { from: 'icon.svg', to: 'icon.svg' }, 18 | { from: 'favicon.ico', to: 'favicon.ico' }, 19 | { from: 'robots.txt', to: 'robots.txt' }, 20 | { from: 'icon.png', to: 'icon.png' }, 21 | { from: '404.html', to: '404.html' }, 22 | { from: 'site.webmanifest', to: 'site.webmanifest' }, 23 | ], 24 | }), 25 | ], 26 | }); 27 | -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 7 |Hello world! This is HTML5 Boilerplate.
29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /dist/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |Hello world! This is HTML5 Boilerplate.
29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | name: "CodeQL" 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | - "!dependabot/**" 8 | pull_request: 9 | branches: 10 | - main 11 | - "!dependabot/**" 12 | workflow_dispatch: 13 | 14 | jobs: 15 | analyze: 16 | name: Analyze 17 | runs-on: ubuntu-latest 18 | permissions: 19 | actions: read 20 | contents: read 21 | security-events: write 22 | 23 | steps: 24 | - name: Checkout repository 25 | uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 26 | with: 27 | persist-credentials: false 28 | 29 | - name: Initialize CodeQL 30 | uses: github/codeql-action/init@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.30.5 31 | with: 32 | languages: "javascript" 33 | queries: +security-and-quality 34 | 35 | - name: Perform CodeQL Analysis 36 | uses: github/codeql-action/analyze@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.30.5 37 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) HTML5 Boilerplate 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 7 | of the Software, and to permit persons to whom the Software is furnished to do 8 | so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /dist/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) HTML5 Boilerplate 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 7 | of the Software, and to permit persons to whom the Software is furnished to do 8 | so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Build status 2 | 3 | on: 4 | push: 5 | branches: [main] 6 | pull_request: 7 | branches: [main] 8 | workflow_dispatch: 9 | 10 | permissions: 11 | contents: read 12 | 13 | jobs: 14 | build: 15 | runs-on: ${{ matrix.os }} 16 | strategy: 17 | matrix: 18 | node-version: 19 | - 20 20 | - 22 21 | - 24 22 | os: [ubuntu-latest, windows-latest] 23 | 24 | steps: 25 | - name: Get npm cache directory 26 | id: npm-cache 27 | run: | 28 | echo "dir=$(npm config get cache)" >> "$GITHUB_OUTPUT" 29 | - uses: actions/cache@2f8e54208210a422b2efd51efaa6bd6d7ca8920f # v3.4.3 30 | with: 31 | path: ${{ steps.npm-cache.outputs.dir }} 32 | key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} 33 | restore-keys: | 34 | ${{ runner.os }}-node- 35 | - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 36 | - name: Run tests ${{ matrix.node-version }} 37 | uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 38 | with: 39 | node-version: ${{ matrix.node-version }} 40 | - run: npm ci 41 | - run: npm test 42 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: Feature request 2 | description: Suggest new or updated features to include in HTML5 Boilerplate. 3 | title: "Suggest a new feature" 4 | labels: [feature] 5 | assignees: [] 6 | body: 7 | - type: checkboxes 8 | attributes: 9 | label: Prerequisites 10 | description: Take a couple minutes to help our maintainers work faster. 11 | options: 12 | - label: I have [searched](https://github.com/h5bp/html5-boilerplate/issues?utf8=%E2%9C%93&q=is%3Aissue) for duplicate or closed issues 13 | required: true 14 | - label: I have read the [contributing guidelines](https://github.com/h5bp/html5-boilerplate/blob/main/.github/CONTRIBUTING.md) 15 | required: true 16 | - type: textarea 17 | id: proposal 18 | attributes: 19 | label: Proposal 20 | description: Provide detailed information for what we should add, including relevant links to prior art, screenshots, or live demos whenever possible. 21 | validations: 22 | required: true 23 | - type: textarea 24 | id: motivation 25 | attributes: 26 | label: Motivation and context 27 | description: Tell us why this change is needed or helpful, and what problems it may help solve. 28 | validations: 29 | required: true 30 | -------------------------------------------------------------------------------- /dist/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |Sorry, but the page you were trying to view does not exist.
59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /src/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |Sorry, but the page you were trying to view does not exist.
59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Types of changes 2 | 3 | 4 | 5 | - [ ] Bug fix (non-breaking change which fixes an issue) 6 | - [ ] New feature (non-breaking change which adds functionality) 7 | - [ ] Breaking change (fix or feature that would cause existing functionality to change) 8 | 9 | ## Checklist: 10 | 11 | 12 | 13 | 14 | - [ ] My code follows the code style of this project. 15 | - [ ] My change requires a change to the documentation. 16 | - [ ] I have updated the documentation accordingly. 17 | - [ ] I have read the **[CONTRIBUTING](https://github.com/h5bp/html5-boilerplate/blob/main/.github/CONTRIBUTING.md)** document. 18 | - [ ] I have added tests to cover my changes. 19 | - [ ] All new and existing tests passed. 20 | 21 | Pull requests should be thought of as a conversation. There will be some back and forth when trying to get code merged into this or any other project. With all but the simplest changes you can and should expect that the maintainers of the project will request changes to your code. Please be aware of that and check in after you open your PR in order to get your code merged in cleanly. 22 | 23 | Thanks! 24 | -------------------------------------------------------------------------------- /.github/workflows/ossf-scorecard.yml: -------------------------------------------------------------------------------- 1 | name: Scorecard supply-chain security 2 | on: 3 | branch_protection_rule: 4 | schedule: 5 | - cron: '27 12 * * 2' 6 | push: 7 | branches: [ "main" ] 8 | 9 | permissions: read-all 10 | 11 | jobs: 12 | analysis: 13 | name: Scorecard analysis 14 | runs-on: ubuntu-latest 15 | if: github.event.repository.default_branch == github.ref_name || github.event_name == 'pull_request' 16 | permissions: 17 | security-events: write 18 | id-token: write 19 | 20 | steps: 21 | - name: "Checkout code" 22 | uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 23 | with: 24 | persist-credentials: false 25 | 26 | - name: "Run analysis" 27 | uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3 28 | with: 29 | results_file: results.sarif 30 | results_format: sarif 31 | publish_results: true 32 | 33 | - name: "Upload artifact" 34 | uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 35 | with: 36 | name: SARIF file 37 | path: results.sarif 38 | retention-days: 5 39 | 40 | - name: "Upload to code-scanning" 41 | uses: github/codeql-action/upload-sarif@3599b3baa15b485a2e49ef411a7a4bb2452e7f93 # v3.30.5 42 | with: 43 | sarif_file: results.sarif 44 | -------------------------------------------------------------------------------- /.github/workflows/push-to-template.yml: -------------------------------------------------------------------------------- 1 | name: Push to template repository 2 | 3 | on: 4 | push: 5 | branches: [main] 6 | 7 | permissions: 8 | contents: read 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Get npm cache directory 15 | id: npm-cache 16 | run: | 17 | echo "dir=$(npm config get cache)" >> "$GITHUB_OUTPUT" 18 | - uses: actions/cache@v3 19 | with: 20 | path: ${{ steps.npm-cache.outputs.dir }} 21 | key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} 22 | restore-keys: | 23 | ${{ runner.os }}-node- 24 | - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 25 | with: 26 | persist-credentials: false 27 | - name: Setup Node.js 28 | uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 29 | with: 30 | node-version: "lts/*" 31 | - name: Install dependencies 32 | run: npm ci 33 | - name: Build 34 | run: npm run build 35 | - name: Pushes to another repository 36 | uses: cpina/github-action-push-to-another-repository@main 37 | env: 38 | API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} 39 | with: 40 | source-directory: "dist" 41 | destination-github-username: "h5bp" 42 | destination-repository-name: "html5-boilerplate-template" 43 | user-name: "roblarsen" 44 | user-email: rob@htmlcssjavascript.com 45 | commit-message: "The latest and greatest from HTML5 Boilerplate" 46 | -------------------------------------------------------------------------------- /.github/workflows/build-dist.yml: -------------------------------------------------------------------------------- 1 | name: Build and PR dist changes 2 | 3 | on: 4 | push: 5 | branches: [main] 6 | 7 | jobs: 8 | build-and-pr-dist: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Checkout repository 12 | uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 13 | with: 14 | persist-credentials: false 15 | 16 | - name: Setup Node.js 17 | uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 18 | with: 19 | node-version: "lts/*" 20 | 21 | - name: Install dependencies 22 | run: npm ci 23 | 24 | - name: Build project 25 | run: npm run build 26 | 27 | - name: Check for dist changes 28 | id: git-diff 29 | run: | 30 | git config --global user.name "github-actions[bot]" 31 | git config --global user.email "github-actions[bot]@users.noreply.github.com" 32 | git add dist 33 | if git diff --cached --quiet; then 34 | echo "changed=false" >> $GITHUB_OUTPUT 35 | else 36 | echo "changed=true" >> $GITHUB_OUTPUT 37 | fi 38 | 39 | - name: Create Pull Request for dist changes 40 | if: steps.git-diff.outputs.changed == 'true' 41 | uses: peter-evans/create-pull-request@v6 42 | with: 43 | commit-message: "chore(dist): update dist folder after build" 44 | title: "chore(dist): update dist folder after build" 45 | body: "This PR updates the dist folder with the latest build output." 46 | branch: update-dist-after-build 47 | add-paths: dist 48 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "html5-boilerplate", 3 | "version": "9.0.1", 4 | "description": "A professional front-end template for building fast, robust, and adaptable web apps or sites.", 5 | "keywords": [ 6 | "h5bp", 7 | "template", 8 | "front-end" 9 | ], 10 | "homepage": "https://html5boilerplate.com/", 11 | "bugs": { 12 | "url": "https://github.com/h5bp/html5-boilerplate/issues" 13 | }, 14 | "repository": { 15 | "type": "git", 16 | "url": "https://github.com/h5bp/html5-boilerplate.git" 17 | }, 18 | "license": "MIT", 19 | "files": [ 20 | "CHANGELOG.md", 21 | "LICENSE.txt", 22 | "package.json", 23 | "dist/", 24 | "README.md" 25 | ], 26 | "scripts": { 27 | "build": "gulp build", 28 | "prettier": "prettier --write ./**/*.{js,json,md,mjs,yml}", 29 | "test": "gulp archive && mocha --reporter spec --timeout 5000" 30 | }, 31 | "devDependencies": { 32 | "@eslint/js": "^9.35.0", 33 | "archiver": "^7.0.1", 34 | "del": "^8.0.1", 35 | "eslint": "^9.35.0", 36 | "eslint-plugin-mocha": "^11.1.0", 37 | "glob": "^11.1.0", 38 | "globals": "^16.4.0", 39 | "gulp": "^5.0.1", 40 | "gulp-autoprefixer": "^9.0.0", 41 | "gulp-eslint-new": "^2.4.0", 42 | "gulp-header": "^2.0.9", 43 | "gulp-rename": "^2.1.0", 44 | "main.css": "3.0.0", 45 | "mocha": "^11.7.2", 46 | "prettier": "3.6.2" 47 | }, 48 | "engines": { 49 | "node": ">=20" 50 | }, 51 | "volta": { 52 | "node": "20.19.1" 53 | }, 54 | "h5bp-configs": { 55 | "directories": { 56 | "archive": "archive", 57 | "dist": "dist", 58 | "src": "src", 59 | "test": "test" 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /test/file_content.mjs: -------------------------------------------------------------------------------- 1 | import assert from 'assert'; 2 | import fs from 'fs'; 3 | import path from 'path'; 4 | import { createRequire } from 'module'; 5 | const require = createRequire(import.meta.url); 6 | const pkg = require('../package.json'); 7 | const dirs = pkg['h5bp-configs'].directories; 8 | 9 | // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 10 | 11 | function checkString(file, string, done) { 12 | let character = ''; 13 | let matchFound = false; 14 | let matchedPositions = 0; 15 | const readStream = fs.createReadStream(file, { encoding: 'utf8' }); 16 | 17 | readStream.on('close', done); 18 | readStream.on('error', done); 19 | readStream.on('readable', function () { 20 | // Read file until the string is found 21 | // or the whole file has been read 22 | while (matchFound !== true && (character = readStream.read(1)) !== null) { 23 | if (character === string.charAt(matchedPositions)) { 24 | matchedPositions += 1; 25 | } else { 26 | matchedPositions = 0; 27 | } 28 | 29 | if (matchedPositions === string.length) { 30 | matchFound = true; 31 | } 32 | } 33 | 34 | assert.equal(true, matchFound); 35 | this.close(); 36 | }); 37 | } 38 | 39 | // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 40 | 41 | function runTests() { 42 | const dir = dirs.dist; 43 | 44 | describe(`Test if the files from the "${dir}" directory have the expected content`, () => { 45 | it('"style.css" should contain a custom banner', function (done) { 46 | const string = `/*! HTML5 Boilerplate v${pkg.version} | ${pkg.license} License | ${pkg.homepage} */\n`; 47 | checkString(path.resolve(dir, 'css/style.css'), string, done); 48 | }); 49 | }); 50 | } 51 | 52 | runTests(); 53 | -------------------------------------------------------------------------------- /docs/TOC.md: -------------------------------------------------------------------------------- 1 | [HTML5 Boilerplate homepage](https://html5boilerplate.com/) 2 | 3 | ## Getting started 4 | 5 | - [Usage](usage.md) — Overview of the project contents. 6 | - [FAQ](faq.md) — Frequently asked questions along with their answers. 7 | 8 | ## HTML5 Boilerplate core 9 | 10 | - [HTML](html.md) — Guide to the default HTML. 11 | - [CSS](css.md) — Guide to the default CSS. 12 | - [JavaScript](js.md) — Guide to the default JavaScript. 13 | - [Everything else](misc.md). 14 | 15 | ## Development 16 | 17 | - [Extending and customizing HTML5 Boilerplate](extend.md) — Going further with 18 | the boilerplate. 19 | 20 | ## Related projects 21 | 22 | The [H5BP organization](https://github.com/h5bp) maintains several projects that 23 | complement HTML5 Boilerplate, projects that can help you improve different 24 | aspects of your website/web app (e.g.: the performance, security, etc.). 25 | 26 | - [Server Configs](https://github.com/h5bp/server-configs) — Fast and smart 27 | configurations for web servers such as Apache and Nginx. 28 | - [Apache](https://github.com/h5bp/server-configs-apache) 29 | - [Google App Engine (GAE)](https://github.com/h5bp/server-configs-gae) 30 | - [Internet Information Services 31 | (IIS)](https://github.com/h5bp/server-configs-iis) 32 | - [lighttpd](https://github.com/h5bp/server-configs-lighttpd) 33 | - [Nginx](https://github.com/h5bp/server-configs-nginx) 34 | - [Node.js](https://github.com/h5bp/server-configs-node) 35 | - [Front-end Developer Interview Questions](https://github.com/h5bp/Front-end-Developer-Interview-Questions) 36 | - [create-html5-boilerplate](https://github.com/h5bp/create-html5-boilerplate) — Quick start HTML5 Boilerplate development. 37 | - [main.css](https://github.com/h5bp/main.css) — the main.css file included (as style.css) with HTML5 Boilerplate. 38 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish 2 | 3 | on: 4 | push: 5 | tags: 6 | - "v*" 7 | 8 | permissions: 9 | contents: read 10 | 11 | jobs: 12 | build: 13 | permissions: 14 | contents: write # for actions/create-release to create a release 15 | name: Upload Release Asset 16 | runs-on: ubuntu-latest 17 | steps: 18 | - name: Checkout code 19 | uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 20 | with: 21 | persist-credentials: false 22 | - name: Get tag 23 | id: get_version 24 | run: echo VERSION=$(echo $GITHUB_REF | cut -d / -f 3) >> "$GITHUB_OUTPUT" 25 | - name: Create Zip Folder 26 | working-directory: dist 27 | run: zip -r ../html5-boilerplate_${{ steps.get_version.outputs.VERSION }}.zip ./ 28 | - name: Create Release 29 | id: create_release 30 | uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1.1.4 31 | env: 32 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 33 | with: 34 | tag_name: ${{ github.ref }} 35 | release_name: Release ${{ github.ref }} 36 | draft: false 37 | prerelease: false 38 | - name: Upload Release Asset 39 | id: upload-release-asset 40 | uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2 41 | env: 42 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 43 | with: 44 | upload_url: ${{ steps.create_release.outputs.upload_url }} 45 | asset_path: ./html5-boilerplate_${{ steps.get_version.outputs.VERSION }}.zip 46 | asset_name: html5-boilerplate_${{ steps.get_version.outputs.VERSION }}.zip 47 | asset_content_type: application/zip 48 | - name: Setup Node 49 | uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 50 | with: 51 | node-version: 20 52 | registry-url: https://registry.npmjs.org/ 53 | - name: publish npm 54 | run: npm publish 55 | env: 56 | NODE_AUTH_TOKEN: ${{secrets.npm_token}} 57 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: Report a bug 2 | description: Tell us about a bug or issue you may have identified in HTML5 Boilerplate. 3 | title: "Provide a general summary of the issue" 4 | labels: [bug] 5 | assignees: "-" 6 | body: 7 | - type: checkboxes 8 | attributes: 9 | label: Prerequisites 10 | description: Take a couple minutes to help our maintainers work faster. 11 | options: 12 | - label: I have [searched](https://github.com/h5bp/html5-boilerplate/issues?utf8=%E2%9C%93&q=is%3Aissue) for duplicate or closed issues 13 | required: true 14 | - label: I have read the [contributing guidelines](https://github.com/h5bp/html5-boilerplate/blob/main/.github/CONTRIBUTING.md) 15 | required: true 16 | - type: textarea 17 | id: what-happened 18 | attributes: 19 | label: Describe the issue 20 | description: Provide a summary of the issue and what you expected to happen, including specific steps to reproduce. 21 | validations: 22 | required: true 23 | - type: textarea 24 | id: reduced-test-case 25 | attributes: 26 | label: Reduced test cases 27 | description: Include links [reduced test case](https://css-tricks.com/reduced-test-cases/) links. 28 | validations: 29 | required: false 30 | - type: dropdown 31 | id: os 32 | attributes: 33 | label: What operating system(s) are you seeing the problem on? 34 | multiple: true 35 | options: 36 | - Windows 37 | - macOS 38 | - Android 39 | - iOS 40 | - Linux 41 | validations: 42 | required: true 43 | - type: dropdown 44 | id: browser 45 | attributes: 46 | label: What browser(s) are you seeing the problem on? 47 | multiple: true 48 | options: 49 | - Chrome 50 | - Safari 51 | - Firefox 52 | - Microsoft Edge 53 | - Opera 54 | - Development Environment 55 | - type: input 56 | id: version 57 | attributes: 58 | label: What version of HTML% Boilerplate are you using? 59 | placeholder: "e.g., v8.0.0 or v7.1.0" 60 | validations: 61 | required: true 62 | -------------------------------------------------------------------------------- /.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | - Using welcoming and inclusive language 12 | - Being respectful of differing viewpoints and experiences 13 | - Gracefully accepting constructive criticism 14 | - Focusing on what is best for the community 15 | - Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | - The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | - Trolling, insulting/derogatory comments, and personal or political attacks 21 | - Public or private harassment 22 | - Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | - Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at h5bp@htmlcssjavascript.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [https://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: https://contributor-covenant.org 46 | [version]: https://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /test/file_existence.mjs: -------------------------------------------------------------------------------- 1 | import assert from 'assert'; 2 | import fs from 'fs'; 3 | import path from 'path'; 4 | import { globSync } from 'glob'; 5 | import { createRequire } from 'module'; 6 | const require = createRequire(import.meta.url); 7 | const pkg = require('../package.json'); 8 | const dirs = pkg['h5bp-configs'].directories; 9 | 10 | const expectedFilesInArchiveDir = [`${pkg.name}_v${pkg.version}.zip`]; 11 | 12 | const expectedFilesInDistDir = [ 13 | '.editorconfig', 14 | '.gitattributes', 15 | '.gitignore', 16 | '404.html', 17 | 'package.json', 18 | 19 | 'webpack.common.js', 20 | 'webpack.config.dev.js', 21 | 'webpack.config.prod.js', 22 | 23 | 'css/', // for directories, a `/` character 24 | // should be included at the end 25 | 'css/style.css', 26 | 27 | 'favicon.ico', 28 | 29 | 'icon.png', 30 | 'icon.svg', 31 | 32 | 'img/', 33 | 'img/.gitkeep', 34 | 35 | 'index.html', 36 | 37 | 'js/', 38 | 'js/app.js', 39 | 'js/vendor/', 40 | 'js/vendor/.gitkeep', 41 | 'LICENSE.txt', 42 | 'robots.txt', 43 | 'site.webmanifest', 44 | ]; 45 | 46 | // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 47 | 48 | function checkFiles(directory, expectedFiles) { 49 | // Get the list of files from the specified directory 50 | const files = globSync('**/*', { 51 | cwd: directory, 52 | ignore: [ 53 | '**/node_modules/**', 54 | 'package-lock.json', 55 | '**/dist/**', 56 | '**/.cache/**', 57 | ], 58 | dot: true, // include hidden files 59 | mark: true, // add a `/` character to directory matches, 60 | posix: true, //https://github.com/isaacs/node-glob/issues/467 61 | }); 62 | 63 | // Check if all expected files are present in the 64 | // specified directory, and are of the expected type 65 | expectedFiles.forEach((file) => { 66 | let ok = false; 67 | const expectedFileType = 68 | file.slice(-1) !== '/' ? 'regular file' : 'directory'; 69 | 70 | // If file exists 71 | if (files.indexOf(file) !== -1) { 72 | // Check if the file is of the correct type 73 | if (file.slice(-1) !== '/') { 74 | // Check if the file is really a regular file 75 | ok = fs.statSync(path.resolve(directory, file)).isFile(); 76 | } else { 77 | // Check if the file is a directory 78 | // (Since glob adds the `/` character to directory matches, 79 | // we can simply check if the `/` character is present) 80 | ok = files[files.indexOf(file)].slice(-1) === '/'; 81 | } 82 | } 83 | 84 | it(`"${file}" should be present and it should be a ${expectedFileType}`, () => { 85 | assert.equal(true, ok); 86 | }); 87 | }); 88 | 89 | // List all files that should be NOT 90 | // be present in the specified directory 91 | files 92 | .filter((file) => { 93 | return expectedFiles.indexOf(file) === -1; 94 | }) 95 | .forEach((file) => { 96 | it(`"${file}" should NOT be present`, () => { 97 | assert(false); 98 | }); 99 | }); 100 | } 101 | 102 | // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 103 | 104 | function runTests() { 105 | describe('Test if all the expected files, and only them, are present in the build directories', () => { 106 | describe(dirs.archive, () => { 107 | checkFiles(dirs.archive, expectedFilesInArchiveDir); 108 | }); 109 | 110 | describe(dirs.dist, () => { 111 | checkFiles(dirs.dist, expectedFilesInDistDir); 112 | }); 113 | }); 114 | } 115 | 116 | runTests(); 117 | -------------------------------------------------------------------------------- /src/.gitattributes: -------------------------------------------------------------------------------- 1 | ## GITATTRIBUTES FOR WEB PROJECTS 2 | # 3 | # These settings are for any web project. 4 | # 5 | # Details per file setting: 6 | # text These files should be normalized (i.e. convert CRLF to LF). 7 | # binary These files are binary and should be left untouched. 8 | # 9 | # Note that binary is a macro for -text -diff. 10 | ###################################################################### 11 | 12 | ## AUTO-DETECT 13 | ## Handle line endings automatically for files detected as 14 | ## text and leave all files detected as binary untouched. 15 | ## This will handle all files NOT defined below. 16 | * text=auto 17 | 18 | ## SOURCE CODE 19 | *.bat text eol=crlf 20 | *.coffee text 21 | *.css text 22 | *.htm text 23 | *.html text 24 | *.inc text 25 | *.ini text 26 | *.js text 27 | *.json text 28 | *.jsx text 29 | *.less text 30 | *.od text 31 | *.onlydata text 32 | *.php text 33 | *.pl text 34 | *.py text 35 | *.rb text 36 | *.sass text 37 | *.scm text 38 | *.scss text 39 | *.sh text eol=lf 40 | *.sql text 41 | *.styl text 42 | *.tag text 43 | *.ts text 44 | *.tsx text 45 | *.xml text 46 | *.xhtml text 47 | 48 | ## DOCKER 49 | *.dockerignore text 50 | Dockerfile text 51 | 52 | ## DOCUMENTATION 53 | *.markdown text 54 | *.md text 55 | *.mdwn text 56 | *.mdown text 57 | *.mkd text 58 | *.mkdn text 59 | *.mdtxt text 60 | *.mdtext text 61 | *.txt text 62 | AUTHORS text 63 | CHANGELOG text 64 | CHANGES text 65 | CONTRIBUTING text 66 | COPYING text 67 | copyright text 68 | *COPYRIGHT* text 69 | INSTALL text 70 | license text 71 | LICENSE text 72 | NEWS text 73 | readme text 74 | *README* text 75 | TODO text 76 | 77 | ## TEMPLATES 78 | *.dot text 79 | *.ejs text 80 | *.haml text 81 | *.handlebars text 82 | *.hbs text 83 | *.hbt text 84 | *.jade text 85 | *.latte text 86 | *.mustache text 87 | *.njk text 88 | *.phtml text 89 | *.tmpl text 90 | *.tpl text 91 | *.twig text 92 | 93 | ## LINTERS 94 | .babelrc text 95 | .csslintrc text 96 | .eslintrc text 97 | .htmlhintrc text 98 | .jscsrc text 99 | .jshintrc text 100 | .jshintignore text 101 | .prettierrc text 102 | .stylelintrc text 103 | 104 | ## CONFIGS 105 | *.bowerrc text 106 | *.cnf text 107 | *.conf text 108 | *.config text 109 | .browserslistrc text 110 | .editorconfig text 111 | .gitattributes text 112 | .gitconfig text 113 | .gitignore text 114 | .htaccess text 115 | *.npmignore text 116 | *.yaml text 117 | *.yml text 118 | browserslist text 119 | Makefile text 120 | makefile text 121 | 122 | ## HEROKU 123 | Procfile text 124 | .slugignore text 125 | 126 | ## GRAPHICS 127 | *.ai binary 128 | *.bmp binary 129 | *.eps binary 130 | *.gif binary 131 | *.ico binary 132 | *.jng binary 133 | *.jp2 binary 134 | *.jpg binary 135 | *.jpeg binary 136 | *.jpx binary 137 | *.jxr binary 138 | *.pdf binary 139 | *.png binary 140 | *.psb binary 141 | *.psd binary 142 | *.svg text 143 | *.svgz binary 144 | *.tif binary 145 | *.tiff binary 146 | *.wbmp binary 147 | *.webp binary 148 | 149 | ## AUDIO 150 | *.kar binary 151 | *.m4a binary 152 | *.mid binary 153 | *.midi binary 154 | *.mp3 binary 155 | *.ogg binary 156 | *.ra binary 157 | 158 | ## VIDEO 159 | *.3gpp binary 160 | *.3gp binary 161 | *.as binary 162 | *.asf binary 163 | *.asx binary 164 | *.fla binary 165 | *.flv binary 166 | *.m4v binary 167 | *.mng binary 168 | *.mov binary 169 | *.mp4 binary 170 | *.mpeg binary 171 | *.mpg binary 172 | *.ogv binary 173 | *.swc binary 174 | *.swf binary 175 | *.webm binary 176 | 177 | ## ARCHIVES 178 | *.7z binary 179 | *.gz binary 180 | *.jar binary 181 | *.rar binary 182 | *.tar binary 183 | *.zip binary 184 | 185 | ## FONTS 186 | *.ttf binary 187 | *.eot binary 188 | *.otf binary 189 | *.woff binary 190 | *.woff2 binary 191 | 192 | ## EXECUTABLES 193 | *.exe binary 194 | *.pyc binary 195 | -------------------------------------------------------------------------------- /dist/.gitattributes: -------------------------------------------------------------------------------- 1 | ## GITATTRIBUTES FOR WEB PROJECTS 2 | # 3 | # These settings are for any web project. 4 | # 5 | # Details per file setting: 6 | # text These files should be normalized (i.e. convert CRLF to LF). 7 | # binary These files are binary and should be left untouched. 8 | # 9 | # Note that binary is a macro for -text -diff. 10 | ###################################################################### 11 | 12 | ## AUTO-DETECT 13 | ## Handle line endings automatically for files detected as 14 | ## text and leave all files detected as binary untouched. 15 | ## This will handle all files NOT defined below. 16 | * text=auto 17 | 18 | ## SOURCE CODE 19 | *.bat text eol=crlf 20 | *.coffee text 21 | *.css text 22 | *.htm text 23 | *.html text 24 | *.inc text 25 | *.ini text 26 | *.js text 27 | *.json text 28 | *.jsx text 29 | *.less text 30 | *.od text 31 | *.onlydata text 32 | *.php text 33 | *.pl text 34 | *.py text 35 | *.rb text 36 | *.sass text 37 | *.scm text 38 | *.scss text 39 | *.sh text eol=lf 40 | *.sql text 41 | *.styl text 42 | *.tag text 43 | *.ts text 44 | *.tsx text 45 | *.xml text 46 | *.xhtml text 47 | 48 | ## DOCKER 49 | *.dockerignore text 50 | Dockerfile text 51 | 52 | ## DOCUMENTATION 53 | *.markdown text 54 | *.md text 55 | *.mdwn text 56 | *.mdown text 57 | *.mkd text 58 | *.mkdn text 59 | *.mdtxt text 60 | *.mdtext text 61 | *.txt text 62 | AUTHORS text 63 | CHANGELOG text 64 | CHANGES text 65 | CONTRIBUTING text 66 | COPYING text 67 | copyright text 68 | *COPYRIGHT* text 69 | INSTALL text 70 | license text 71 | LICENSE text 72 | NEWS text 73 | readme text 74 | *README* text 75 | TODO text 76 | 77 | ## TEMPLATES 78 | *.dot text 79 | *.ejs text 80 | *.haml text 81 | *.handlebars text 82 | *.hbs text 83 | *.hbt text 84 | *.jade text 85 | *.latte text 86 | *.mustache text 87 | *.njk text 88 | *.phtml text 89 | *.tmpl text 90 | *.tpl text 91 | *.twig text 92 | 93 | ## LINTERS 94 | .babelrc text 95 | .csslintrc text 96 | .eslintrc text 97 | .htmlhintrc text 98 | .jscsrc text 99 | .jshintrc text 100 | .jshintignore text 101 | .prettierrc text 102 | .stylelintrc text 103 | 104 | ## CONFIGS 105 | *.bowerrc text 106 | *.cnf text 107 | *.conf text 108 | *.config text 109 | .browserslistrc text 110 | .editorconfig text 111 | .gitattributes text 112 | .gitconfig text 113 | .gitignore text 114 | .htaccess text 115 | *.npmignore text 116 | *.yaml text 117 | *.yml text 118 | browserslist text 119 | Makefile text 120 | makefile text 121 | 122 | ## HEROKU 123 | Procfile text 124 | .slugignore text 125 | 126 | ## GRAPHICS 127 | *.ai binary 128 | *.bmp binary 129 | *.eps binary 130 | *.gif binary 131 | *.ico binary 132 | *.jng binary 133 | *.jp2 binary 134 | *.jpg binary 135 | *.jpeg binary 136 | *.jpx binary 137 | *.jxr binary 138 | *.pdf binary 139 | *.png binary 140 | *.psb binary 141 | *.psd binary 142 | *.svg text 143 | *.svgz binary 144 | *.tif binary 145 | *.tiff binary 146 | *.wbmp binary 147 | *.webp binary 148 | 149 | ## AUDIO 150 | *.kar binary 151 | *.m4a binary 152 | *.mid binary 153 | *.midi binary 154 | *.mp3 binary 155 | *.ogg binary 156 | *.ra binary 157 | 158 | ## VIDEO 159 | *.3gpp binary 160 | *.3gp binary 161 | *.as binary 162 | *.asf binary 163 | *.asx binary 164 | *.fla binary 165 | *.flv binary 166 | *.m4v binary 167 | *.mng binary 168 | *.mov binary 169 | *.mp4 binary 170 | *.mpeg binary 171 | *.mpg binary 172 | *.ogv binary 173 | *.swc binary 174 | *.swf binary 175 | *.webm binary 176 | 177 | ## ARCHIVES 178 | *.7z binary 179 | *.gz binary 180 | *.jar binary 181 | *.rar binary 182 | *.tar binary 183 | *.zip binary 184 | 185 | ## FONTS 186 | *.ttf binary 187 | *.eot binary 188 | *.otf binary 189 | *.woff binary 190 | *.woff2 binary 191 | 192 | ## EXECUTABLES 193 | *.exe binary 194 | *.pyc binary 195 | -------------------------------------------------------------------------------- /gulpfile.mjs: -------------------------------------------------------------------------------- 1 | import fs from 'fs'; 2 | import path from 'path'; 3 | import gulp from 'gulp'; 4 | import gulpAutoPrefixer from 'gulp-autoprefixer'; 5 | import gulpEslint from 'gulp-eslint-new'; 6 | import gulpHeader from 'gulp-header'; 7 | import gulpRename from 'gulp-rename'; 8 | import archiver from 'archiver'; 9 | import { globSync } from 'glob'; 10 | import { deleteSync } from 'del'; 11 | import { createRequire } from 'module'; 12 | const require = createRequire(import.meta.url); 13 | const pkg = require('./package.json'); 14 | 15 | const dirs = pkg['h5bp-configs'].directories; 16 | 17 | // --------------------------------------------------------------------- 18 | // | Helper tasks | 19 | // --------------------------------------------------------------------- 20 | 21 | gulp.task('archive:create_archive_dir', (done) => { 22 | fs.mkdirSync(path.resolve(dirs.archive), '0755'); 23 | done(); 24 | }); 25 | 26 | gulp.task('archive:zip', (done) => { 27 | const archiveName = path.resolve( 28 | dirs.archive, 29 | `${pkg.name}_v${pkg.version}.zip`, 30 | ); 31 | const zip = archiver('zip'); 32 | const files = globSync('**/*.*', { 33 | cwd: dirs.dist, 34 | ignore: [ 35 | '**/node_modules/**', 36 | 'package-lock.json', 37 | '**/dist/**', 38 | '**/.cache/**', 39 | ], 40 | dot: true, // include hidden files 41 | }); 42 | const output = fs.createWriteStream(archiveName); 43 | 44 | zip.on('error', (error) => { 45 | done(); 46 | throw error; 47 | }); 48 | 49 | output.on('close', done); 50 | 51 | files.forEach((file) => { 52 | const filePath = path.resolve(dirs.dist, file); 53 | 54 | // `zip.bulk` does not maintain the file 55 | // permissions, so we need to add files individually 56 | zip.append(fs.createReadStream(filePath), { 57 | name: file, 58 | mode: fs.statSync(filePath).mode, 59 | }); 60 | }); 61 | 62 | zip.pipe(output); 63 | zip.finalize(); 64 | done(); 65 | }); 66 | 67 | gulp.task('clean', (done) => { 68 | deleteSync([dirs.archive, dirs.dist]); 69 | done(); 70 | }); 71 | 72 | gulp.task('copy:index.html', () => { 73 | return gulp.src(`${dirs.src}/index.html`).pipe(gulp.dest(dirs.dist)); 74 | }); 75 | 76 | gulp.task('copy:license', () => 77 | gulp.src('LICENSE.txt').pipe(gulp.dest(dirs.dist)), 78 | ); 79 | 80 | gulp.task('copy:style', () => { 81 | const banner = `/*! HTML5 Boilerplate v${pkg.version} | ${pkg.license} License | ${pkg.homepage} */\n\n`; 82 | 83 | return gulp 84 | .src('node_modules/main.css/dist/main.css') 85 | .pipe(gulpHeader(banner)) 86 | .pipe( 87 | gulpAutoPrefixer({ 88 | cascade: false, 89 | }), 90 | ) 91 | .pipe( 92 | gulpRename({ 93 | basename: 'style', 94 | }), 95 | ) 96 | .pipe(gulp.dest(`${dirs.dist}/css`)); 97 | }); 98 | 99 | gulp.task('copy:misc', () => 100 | gulp 101 | .src( 102 | [ 103 | // Copy all files 104 | `${dirs.src}/**/*`, 105 | 106 | // Exclude the following files 107 | // (other tasks will handle the copying of these files) 108 | `!${dirs.src}/css/main.css`, 109 | `!${dirs.src}/index.html`, 110 | `!**/.DS_Store`, 111 | ], 112 | { 113 | encoding: false, 114 | // Include hidden files by default 115 | dot: true, 116 | }, 117 | ) 118 | .pipe(gulp.dest(dirs.dist)), 119 | ); 120 | 121 | gulp.task('lint:js', () => 122 | gulp 123 | .src([`${dirs.src}/js/*.js`, `${dirs.src}/*.js`, `${dirs.test}/*.mjs`]) 124 | .pipe(gulpEslint()) 125 | .pipe(gulpEslint.failOnError()), 126 | ); 127 | 128 | // --------------------------------------------------------------------- 129 | // | Main tasks | 130 | // --------------------------------------------------------------------- 131 | gulp.task( 132 | 'copy', 133 | gulp.series('copy:index.html', 'copy:license', 'copy:style', 'copy:misc'), 134 | ); 135 | 136 | gulp.task('build', gulp.series(gulp.parallel('clean', 'lint:js'), 'copy')); 137 | 138 | gulp.task( 139 | 'archive', 140 | gulp.series('build', 'archive:create_archive_dir', 'archive:zip'), 141 | ); 142 | 143 | gulp.task('default', gulp.series('build')); 144 | -------------------------------------------------------------------------------- /docs/usage.md: -------------------------------------------------------------------------------- 1 | [HTML5 Boilerplate homepage](https://html5boilerplate.com/) | [Documentation 2 | table of contents](TOC.md) 3 | 4 | # Usage 5 | 6 | The most basic usage of HTML5 Boilerplate is to create a static site or simple 7 | app. Once you've downloaded or cloned the project, that process looks something 8 | like this: 9 | 10 | 1. Set up the basic structure of the site. 11 | 2. Add some content, style, and functionality. 12 | 3. Run your site locally to see how it looks. 13 | 4. Deploy your site. 14 | 15 | Cool, right? _It is_. That said, the smart defaults, baseline elements, default 16 | attribute values and various other utilities that HTML5 Boilerplate offers can 17 | serve as the foundation for whatever you're interested in building. 18 | 19 | Even the basic use-case of a simple static site can be enhanced by manipulating 20 | the code through an automated build process. Moving up in complexity HTML5 21 | Boilerplate can be integrated with whatever front-end framework, CMS or 22 | e-commerce platform you're working with. Mix-and-match to your heart's content. 23 | Use what you need (toss it in a blender if you need to) and discard the rest. 24 | HTML5 Boilerplate is a starting point, not a destination. 25 | 26 | ## Basic structure 27 | 28 | A basic HTML5 Boilerplate site initially looks something like this: 29 | 30 | ``` 31 | . 32 | ├── css 33 | │ └── style.css 34 | ├── doc 35 | ├── img 36 | ├── js 37 | │ ├── app.js 38 | └── vendor 39 | ├── .editorconfig 40 | ├── 404.html 41 | ├── favicon.ico 42 | ├── icon.png 43 | ├── icon.svg 44 | ├── index.html 45 | ├── package.json 46 | ├── robots.txt 47 | ├── site.webmanifest 48 | └── webpack.common.js 49 | └── webpack.config.dev.js 50 | └── webpack.config.prod.js 51 | ``` 52 | 53 | What follows is a general overview of each major part and how to use them. 54 | 55 | ### css 56 | 57 | This directory should contain all your project's CSS files. It includes some 58 | initial CSS to help get you started from a solid foundation. [About the 59 | CSS](css.md). 60 | 61 | ### doc 62 | 63 | This directory contains all the HTML5 Boilerplate documentation. You can use it 64 | as the location and basis for your own project's documentation. 65 | 66 | ### js 67 | 68 | This directory should contain all your project's JS files. Libraries, plugins, 69 | and custom code can all be included here. It includes some initial JS to help 70 | get you started. [About the JavaScript](js.md). 71 | 72 | ### 404.html 73 | 74 | A helpful custom 404 to get you started. 75 | 76 | ### .editorconfig 77 | 78 | The `.editorconfig` file is provided in order to encourage and help you and your 79 | team to maintain consistent coding styles between different editors and IDEs. 80 | [Read more about the `.editorconfig` file](misc.md#editorconfig). 81 | 82 | ### index.html 83 | 84 | This is the default HTML skeleton that should form the basis of all pages on 85 | your site. If you are using a server-side templating framework, then you will 86 | need to integrate this starting HTML with your setup. 87 | 88 | Make sure that you update the URLs for the referenced CSS and JavaScript if you 89 | modify the directory structure at all. 90 | 91 | ### package.json 92 | 93 | Edit this file to describe your application, add dependencies, scripts and 94 | other properties related to node based development and the npm registry 95 | 96 | ### robots.txt 97 | 98 | Edit this file to include any pages you need hidden from search engines. 99 | 100 | ### Icons 101 | 102 | Replace the default `favicon.ico` and Apple Touch Icon with your own. 103 | 104 | If you want to use different Apple Touch Icons for different resolutions please 105 | refer to the [according documentation](extend.md#apple-touch-icons). 106 | 107 | ### Webpack 108 | 109 | The project contains a simple [webpack](https://webpack.js.org/) configuration. 110 | 111 | To get started developing a site with a development server, run the following 112 | commands from within the `/dist/` folder in the project's repo or within the 113 | root folder of the dowloaded project files, the folder created by `npm install` 114 | or the project folder created by running [create\-html5\-boilerplate](https://github.com/h5bp/create-html5-boilerplate) 115 | 116 | ``` 117 | npm install 118 | npm run start 119 | ``` 120 | 121 | This will start a Webpack development server with hot reloading of edited files. 122 | 123 | To package a site for production run 124 | 125 | ``` 126 | npm run build 127 | ``` 128 | 129 | This command will bundle up the site's JavaScript and copy over static assets to 130 | the newly created `dist` folder. 131 | 132 | There are three files: 133 | 134 | #### webpack.common.js 135 | 136 | Both the production and development scripts inherit from this common script. 137 | 138 | #### webpack.config.dev.js 139 | 140 | This development configuration defines the behavior of development server. 141 | 142 | #### webpack.config.prod.js 143 | 144 | This production configuration defines the behavior of the production build. 145 | 146 | It copies the following files and folders to the dist folder: 147 | 148 | - css 149 | - img 150 | - js/vendor 151 | - 404.html 152 | - favicon.ico 153 | - icon.png 154 | - icon.svg 155 | - index.html 156 | - robots.txt 157 | - site.webmanifest 158 | 159 | `js/vendor` is copied over in order to allow you to use unprocessed JS files 160 | in addition to the files bundled based on the project's entry point `app.js.` 161 | -------------------------------------------------------------------------------- /docs/misc.md: -------------------------------------------------------------------------------- 1 | [HTML5 Boilerplate homepage](https://html5boilerplate.com/) | [Documentation 2 | table of contents](TOC.md) 3 | 4 | # Miscellaneous 5 | 6 | - [.gitignore](#gitignore) 7 | - [.editorconfig](#editorconfig) 8 | - [robots.txt](#robotstxt) 9 | - [package.json](#packagejson) 10 | 11 | -- 12 | 13 | ## .gitignore 14 | 15 | HTML5 Boilerplate includes a basic project-level `.gitignore`. This should 16 | primarily be used to avoid certain project-level files and directories from 17 | being kept under source control. Different development-environments will 18 | benefit from different collections of ignores. 19 | 20 | OS-specific and editor-specific files should be ignored using a "global 21 | ignore" that applies to all repositories on your system. 22 | 23 | For example, add the following to your `~/.gitconfig`, where the `.gitignore` 24 | in your HOME directory contains the files and directories you'd like to 25 | globally ignore: 26 | 27 | ```gitignore 28 | [core] 29 | excludesfile = ~/.gitignore 30 | ``` 31 | 32 | - More on global ignores: [https://help.github.com/articles/ignoring-files/](https://help.github.com/en/github/using-git/ignoring-files) 33 | - Comprehensive set of ignores on GitHub: https://github.com/github/gitignore 34 | 35 | ## .editorconfig 36 | 37 | The `.editorconfig` file is provided in order to encourage and help you and 38 | your team define and maintain consistent coding styles between different 39 | editors and IDEs. 40 | 41 | By default, `.editorconfig` includes some basic 42 | [properties](https://editorconfig.org/#supported-properties) that reflect the 43 | coding styles from the files provided by default, but you can easily change 44 | them to better suit your needs. 45 | 46 | In order for your editor/IDE to apply the 47 | [properties](https://editorconfig.org/#supported-properties) from the 48 | `.editorconfig` file, you may need to [install a 49 | plugin](https://editorconfig.org/#download). 50 | 51 | **N.B.** If you aren't using the server configurations provided by HTML5 52 | Boilerplate, we highly encourage you to configure your server to block 53 | access to `.editorconfig` files, as they can disclose sensitive information! 54 | 55 | For more details, please refer to the [EditorConfig 56 | project](https://editorconfig.org/). 57 | 58 | ## robots.txt 59 | 60 | The `robots.txt` file is used to give instructions to web robots on what can 61 | be crawled from the website. 62 | 63 | By default, the file provided by this project includes the next two lines: 64 | 65 | - `User-agent: *` - the following rules apply to all web robots 66 | - `Disallow:` - everything on the website is allowed to be crawled 67 | 68 | If you want to disallow certain pages you will need to specify the path in a 69 | `Disallow` directive (e.g.: `Disallow: /path`) or, if you want to disallow 70 | crawling of all content, use `Disallow: /`. 71 | 72 | The `/robots.txt` file is not intended for access control, so don't try to 73 | use it as such. Think of it as a "No Entry" sign, rather than a locked door. 74 | URLs disallowed by the `robots.txt` file might still be indexed without being 75 | crawled, and the content from within the `robots.txt` file can be viewed by 76 | anyone, potentially disclosing the location of your private content! So, if 77 | you want to block access to private content, use proper authentication instead. 78 | 79 | For more information about `robots.txt`, please see: 80 | 81 | - [robotstxt.org](https://www.robotstxt.org/) 82 | - [How Google handles the `robots.txt` file](https://developers.google.com/search/reference/robots_txt) 83 | 84 | ## package.json 85 | 86 | `package.json` is used to define attributes of your site or application for 87 | use in modern JavaScript development. [The full documentation is available](https://docs.npmjs.com/files/package.json) 88 | if you're interested. The fields we provide are as follows: 89 | 90 | - `title` - the title of your project. If you expect to publish your application 91 | to npm, then the name needs to follow [certain guidelines](https://docs.npmjs.com/files/package.json#name) 92 | and be unique. 93 | - `version` - indicates the version of your site application using semantic 94 | versioning ([SemVer](https://semver.org/)) 95 | - `description` - describes your site. 96 | - `scripts` - is a JavaScript object containing commands that can be run in a 97 | node environment. There are many [built-in keys](https://docs.npmjs.com/misc/scripts) 98 | related to the package lifecycle that node understands automatically. You can 99 | also define custom scripts for use with your application development. We 100 | provide three custom scripts that work with webpack to get you up and running 101 | quickly with a bundler for your assets and a simple development server. 102 | 103 | - `start` serves your `index.html` with a simple development server 104 | 105 | - `keywords` - an array of keywords used to discover your app in the npm 106 | registry 107 | - `author` - defines the author of a package. There is also an alternative 108 | [contributors](https://docs.npmjs.com/files/package.json#people-fields-author-contributors) 109 | field if there's more than one author. 110 | - `license` - the license for your application. Must conform to 111 | [specific rules](https://docs.npmjs.com/files/package.json#license) 112 | - `devDependencies` - development dependencies for your package. In our case 113 | we have several dependencies used by webpack, which we use as a simple development server. 114 | -------------------------------------------------------------------------------- /docs/html.md: -------------------------------------------------------------------------------- 1 | [HTML5 Boilerplate homepage](https://html5boilerplate.com/) | [Documentation 2 | table of contents](TOC.md) 3 | 4 | # The HTML 5 | 6 | By default, HTML5 Boilerplate provides two `html` pages: 7 | 8 | - [`index.html`](#indexhtml) - a default HTML skeleton that should form the 9 | basis of all pages on your website 10 | - `404.html` - a placeholder 404 error page 11 | 12 | ## `index.html` 13 | 14 | ### Language Attribute 15 | 16 | Please consider specifying the language of your content by adding a 17 | [value](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry) 18 | to the `lang` attribute in the `` as in this example: 19 | 20 | ```html 21 | 22 | ``` 23 | 24 | ### The order of the `