Add Prettier (#3011)

Consistent code formatting!
(it fixed a few minor bugs too)
This commit is contained in:
Christian Oliff
2023-09-08 05:20:47 +09:00
committed by GitHub
parent c0084e2c57
commit 29d7d8054b
30 changed files with 536 additions and 557 deletions

View File

@@ -13,15 +13,8 @@
], ],
"language": "en,en-GB,en-US", "language": "en,en-GB,en-US",
"allowCompoundWords": true, "allowCompoundWords": true,
"files": [ "files": ["**/*.md"],
"**/*.md" "ignoreRegExpList": ["\\_\\w+", "\\#\\w+"],
], "ignorePaths": [".cspell.json"],
"ignoreRegExpList": [
"\\_\\w+",
"\\#\\w+"
],
"ignorePaths": [
".cspell.json"
],
"useGitignore": true "useGitignore": true
} }

View File

@@ -3,17 +3,17 @@ module.exports = {
browser: true, browser: true,
es6: true, es6: true,
mocha: true, mocha: true,
node : true node: true,
}, },
plugins: ['mocha'], plugins: ['mocha'],
extends: 'eslint:recommended', extends: 'eslint:recommended',
parserOptions: { parserOptions: {
'ecmaVersion': 2020, ecmaVersion: 2020,
'sourceType': 'module' sourceType: 'module',
}, },
rules: { rules: {
indent: ['error', 2], indent: ['error', 2],
quotes: ['error', 'single'], quotes: ['error', 'single'],
semi: ['error', 'always'] semi: ['error', 'always'],
} },
}; };

View File

@@ -8,19 +8,19 @@ In the interest of fostering an open and welcoming environment, we as contributo
Examples of behavior that contributes to creating a positive environment include: Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language - Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences - Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism - Gracefully accepting constructive criticism
* Focusing on what is best for the community - Focusing on what is best for the community
* Showing empathy towards other community members - Showing empathy towards other community members
Examples of unacceptable behavior by participants include: Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances - The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks - Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment - Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission - Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting - Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities ## Our Responsibilities

View File

@@ -12,7 +12,6 @@ the developers managing and developing this open source project. In return,
they should reciprocate that respect in addressing your issue or assessing they should reciprocate that respect in addressing your issue or assessing
patches and features. patches and features.
## Using the issue tracker ## Using the issue tracker
The [issue tracker](https://github.com/h5bp/html5-boilerplate/issues) is The [issue tracker](https://github.com/h5bp/html5-boilerplate/issues) is
@@ -20,19 +19,19 @@ the preferred channel for [bug reports](#bugs), [features requests](#features)
and [submitting pull requests](#pull-requests), but please respect the following and [submitting pull requests](#pull-requests), but please respect the following
restrictions: restrictions:
* Please **do not** use the issue tracker for personal support requests (use - Please **do not** use the issue tracker for personal support requests (use
[Stack Overflow](https://stackoverflow.com/questions/tagged/html5boilerplate)). [Stack Overflow](https://stackoverflow.com/questions/tagged/html5boilerplate)).
* Please **do not** derail or troll issues. Keep the discussion on topic and - Please **do not** derail or troll issues. Keep the discussion on topic and
respect the opinions of others. respect the opinions of others.
* Please **do not** open issues or pull requests regarding the code in - Please **do not** open issues or pull requests regarding the code in
[`.htaccess`](https://github.com/h5bp/server-configs-apache), [`.htaccess`](https://github.com/h5bp/server-configs-apache),
[`Normalize.css`](https://github.com/necolas/normalize.css) (open them in [`Normalize.css`](https://github.com/necolas/normalize.css) (open them in
their respective repositories). their respective repositories).
<a name="bugs"></a> <a name="bugs"></a>
## Bug reports ## Bug reports
A bug is a _demonstrable problem_ that is caused by the code in the repository. A bug is a _demonstrable problem_ that is caused by the code in the repository.
@@ -73,17 +72,17 @@ Example:
> causing the bug, and potential solutions (and your opinions on their > causing the bug, and potential solutions (and your opinions on their
> merits). > merits).
<a name="features"></a> <a name="features"></a>
## Feature requests ## Feature requests
Feature requests are welcome. But take a moment to find out whether your idea Feature requests are welcome. But take a moment to find out whether your idea
fits with the scope and aims of the project. It's up to *you* to make a strong fits with the scope and aims of the project. It's up to _you_ to make a strong
case to convince the project's developers of the merits of this feature. Please case to convince the project's developers of the merits of this feature. Please
provide as much detail and context as possible. provide as much detail and context as possible.
<a name="pull-requests"></a> <a name="pull-requests"></a>
## Pull requests ## Pull requests
Good pull requests - patches, improvements, new features - are a fantastic Good pull requests - patches, improvements, new features - are a fantastic
@@ -146,7 +145,7 @@ included in the project:
``` ```
7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) 7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/)
with a clear title and description. with a clear title and description.
**IMPORTANT**: By submitting a patch, you agree to allow the project **IMPORTANT**: By submitting a patch, you agree to allow the project
owners to license your work under the terms of the [MIT License](LICENSE.txt). owners to license your work under the terms of the [MIT License](LICENSE.txt).

View File

@@ -1,12 +1,16 @@
## Types of changes ## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
- [ ] Bug fix (non-breaking change which fixes an issue) - [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality) - [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Breaking change (fix or feature that would cause existing functionality to change)
## Checklist: ## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
- [ ] My code follows the code style of this project. - [ ] My code follows the code style of this project.
- [ ] My change requires a change to the documentation. - [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly. - [ ] I have updated the documentation accordingly.

4
.github/SUPPORT.md vendored
View File

@@ -4,5 +4,5 @@ For personal support requests with HTML5 Boilerplate please use Stack Overflow
([`html5boilerplate`](https://stackoverflow.com/questions/tagged/html5boilerplate) tag). ([`html5boilerplate`](https://stackoverflow.com/questions/tagged/html5boilerplate) tag).
Please check the respective repository/website for support regarding the code in Please check the respective repository/website for support regarding the code in
[`.htaccess`](https://github.com/h5bp/server-configs-apache), [`.htaccess`](https://github.com/h5bp/server-configs-apache),
[`Normalize.css`](https://github.com/necolas/normalize.css). [`Normalize.css`](https://github.com/necolas/normalize.css).

View File

@@ -14,4 +14,3 @@ updates:
directory: "/" directory: "/"
schedule: schedule:
interval: monthly interval: monthly

View File

@@ -20,13 +20,13 @@ jobs:
security-events: write security-events: write
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@v2 uses: github/codeql-action/init@v2
with: with:
languages: 'javascript' languages: "javascript"
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2 uses: github/codeql-action/analyze@v2

View File

@@ -1,4 +1,4 @@
name: 'Dependency Review' name: "Dependency Review"
on: [pull_request] on: [pull_request]
permissions: permissions:
@@ -8,7 +8,7 @@ jobs:
dependency-review: dependency-review:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: 'Checkout Repository' - name: "Checkout Repository"
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: 'Dependency Review' - name: "Dependency Review"
uses: actions/dependency-review-action@v3 uses: actions/dependency-review-action@v3

View File

@@ -1,4 +1,4 @@
name: 'Check spelling' name: "Check spelling"
on: # rebuild any PRs and main branch changes on: # rebuild any PRs and main branch changes
push: push:
branches-ignore: branches-ignore:

2
.npmrc Normal file
View File

@@ -0,0 +1,2 @@
lockfile-version = 3
registry = "https://registry.npmjs.org/"

1
.prettierignore Normal file
View File

@@ -0,0 +1 @@
dist/

13
.prettierrc.json Normal file
View File

@@ -0,0 +1,13 @@
{
"bracketSameLine": true,
"embeddedLanguageFormatting": "off",
"singleQuote": true,
"overrides": [
{
"files": "**/*.yml",
"options": {
"singleQuote": false
}
}
]
}

View File

@@ -2,377 +2,377 @@
## 9.0.0 (TBD) ## 9.0.0 (TBD)
* Rename CSS file [#2342](https://github.com/h5bp/html5-boilerplate/pull/2342) and JS file [#2341](https://github.com/h5bp/html5-boilerplate/pull/2341) - Rename CSS file [#2342](https://github.com/h5bp/html5-boilerplate/pull/2342) and JS file [#2341](https://github.com/h5bp/html5-boilerplate/pull/2341)
## 8.0.0 (June 04, 2020) ## 8.0.0 (June 04, 2020)
* Add a sample package.json with basic Parcel commands ([#2227](https://github.com/h5bp/html5-boilerplate/pull/2229)), ([231e047](https://github.com/h5bp/html5-boilerplate/commit/231e047d270316b454156dc261e6e04da660e2a2)) - Add a sample package.json with basic Parcel commands ([#2227](https://github.com/h5bp/html5-boilerplate/pull/2229)), ([231e047](https://github.com/h5bp/html5-boilerplate/commit/231e047d270316b454156dc261e6e04da660e2a2))
* Add sample Open Graph metadata ([#2235](https://github.com/h5bp/html5-boilerplate/pull/2235)) - Add sample Open Graph metadata ([#2235](https://github.com/h5bp/html5-boilerplate/pull/2235))
* Update Modernizr to 3.11.2 ([84ae9cc](https://github.com/h5bp/html5-boilerplate/commit/84ae9cc91188bea4edb8ec91e2a25a2a7f7837a6)) - Update Modernizr to 3.11.2 ([84ae9cc](https://github.com/h5bp/html5-boilerplate/commit/84ae9cc91188bea4edb8ec91e2a25a2a7f7837a6))
* Remove jQuery ([#2225](https://github.com/h5bp/html5-boilerplate/pull/2225)) - Remove jQuery ([#2225](https://github.com/h5bp/html5-boilerplate/pull/2225))
* Set anonymizeIp to true in Google Analytics snippet ([#2219](https://github.com/h5bp/html5-boilerplate/pull/2219)) - Set anonymizeIp to true in Google Analytics snippet ([#2219](https://github.com/h5bp/html5-boilerplate/pull/2219))
* Update main.css to 2.1.0 ([#2234](https://github.com/h5bp/html5-boilerplate/pull/2234)) - Update main.css to 2.1.0 ([#2234](https://github.com/h5bp/html5-boilerplate/pull/2234))
* Remove Browser Upgrade Prompt ([23c4112](https://github.com/h5bp/html5-boilerplate/commit/23c4112db067262c715ebad861ec892c29c3cdaa)) - Remove Browser Upgrade Prompt ([23c4112](https://github.com/h5bp/html5-boilerplate/commit/23c4112db067262c715ebad861ec892c29c3cdaa))
* Create new publish action ([#2260](https://github.com/h5bp/html5-boilerplate/pull/2260)), ([#2241](https://github.com/h5bp/html5-boilerplate/pull/2241)) - Create new publish action ([#2260](https://github.com/h5bp/html5-boilerplate/pull/2260)), ([#2241](https://github.com/h5bp/html5-boilerplate/pull/2241))
* Docs updates ([#2251](https://github.com/h5bp/html5-boilerplate/pull/2251)), ([#2253](https://github.com/h5bp/html5-boilerplate/pull/2253)), ([#2245](https://github.com/h5bp/html5-boilerplate/pull/2245)), ([#2220](https://github.com/h5bp/html5-boilerplate/pull/2220)), ([#2263](https://github.com/h5bp/html5-boilerplate/pull/2263)), ([#2262](https://github.com/h5bp/html5-boilerplate/pull/2262)) - Docs updates ([#2251](https://github.com/h5bp/html5-boilerplate/pull/2251)), ([#2253](https://github.com/h5bp/html5-boilerplate/pull/2253)), ([#2245](https://github.com/h5bp/html5-boilerplate/pull/2245)), ([#2220](https://github.com/h5bp/html5-boilerplate/pull/2220)), ([#2263](https://github.com/h5bp/html5-boilerplate/pull/2263)), ([#2262](https://github.com/h5bp/html5-boilerplate/pull/2262))
## 7.3.0 (November 19, 2019) ## 7.3.0 (November 19, 2019)
* Update Modernizr to 3.8 ([2b2bb45](https://github.com/h5bp/html5-boilerplate/commit/2b2bb453916b4b09a6f0929340290dc2505f7ce9)) - Update Modernizr to 3.8 ([2b2bb45](https://github.com/h5bp/html5-boilerplate/commit/2b2bb453916b4b09a6f0929340290dc2505f7ce9))
* Update to Gulp 4 ([#2151](https://github.com/h5bp/html5-boilerplate/pull/2151)) - Update to Gulp 4 ([#2151](https://github.com/h5bp/html5-boilerplate/pull/2151))
* Update package.json ([#2162](https://github.com/h5bp/html5-boilerplate/pull/#2162)) and enable package-lock.json ([abe2087](https://github.com/h5bp/html5-boilerplate/commit/abe20877fdb569c84aa0a1f8ae12c51c51e41250)),([#2145](https://github.com/h5bp/html5-boilerplate/pull/#2145)) - Update package.json ([#2162](https://github.com/h5bp/html5-boilerplate/pull/#2162)) and enable package-lock.json ([abe2087](https://github.com/h5bp/html5-boilerplate/commit/abe20877fdb569c84aa0a1f8ae12c51c51e41250)),([#2145](https://github.com/h5bp/html5-boilerplate/pull/#2145))
* Remove redundant rules from .editorconfig ([#2157](https://github.com/h5bp/html5-boilerplate/pull/2157)) - Remove redundant rules from .editorconfig ([#2157](https://github.com/h5bp/html5-boilerplate/pull/2157))
* Small docs maintenance updates ([#2155](https://github.com/h5bp/html5-boilerplate/pull/2155)), ([#2164](https://github.com/h5bp/html5-boilerplate/pull/2164)), ([#2165](https://github.com/h5bp/html5-boilerplate/pull/2165)), ([#2167](https://github.com/h5bp/html5-boilerplate/pull/2167)) & ([#2168](https://github.com/h5bp/html5-boilerplate/pull/2168)) - Small docs maintenance updates ([#2155](https://github.com/h5bp/html5-boilerplate/pull/2155)), ([#2164](https://github.com/h5bp/html5-boilerplate/pull/2164)), ([#2165](https://github.com/h5bp/html5-boilerplate/pull/2165)), ([#2167](https://github.com/h5bp/html5-boilerplate/pull/2167)) & ([#2168](https://github.com/h5bp/html5-boilerplate/pull/2168))
* Bump lowest supported version of node to 8.x ([#2142](https://github.com/h5bp/html5-boilerplate/pull/2142)) - Bump lowest supported version of node to 8.x ([#2142](https://github.com/h5bp/html5-boilerplate/pull/2142))
* Remove .jscsrc config and remove gulp-jscs from package.json ([#2153](https://github.com/h5bp/html5-boilerplate/pull/2153)) - Remove .jscsrc config and remove gulp-jscs from package.json ([#2153](https://github.com/h5bp/html5-boilerplate/pull/2153))
## 7.2.0 (June 4, 2019) ## 7.2.0 (June 4, 2019)
* Remove `defer` from Google Analytics snippet ([#2132](https://github.com/h5bp/html5-boilerplate/pull/2132)) - Remove `defer` from Google Analytics snippet ([#2132](https://github.com/h5bp/html5-boilerplate/pull/2132))
* Update jQuery to v3.4.1 ([#2126](https://github.com/h5bp/html5-boilerplate/pull/2126)) - Update jQuery to v3.4.1 ([#2126](https://github.com/h5bp/html5-boilerplate/pull/2126))
* Update Apache Server Configs to 3.2.1 ([#2128](https://github.com/h5bp/html5-boilerplate/pull/2128)) - Update Apache Server Configs to 3.2.1 ([#2128](https://github.com/h5bp/html5-boilerplate/pull/2128))
* Update main.css to v2.0.0 ([#2135](https://github.com/h5bp/html5-boilerplate/pull/2135)) - Update main.css to v2.0.0 ([#2135](https://github.com/h5bp/html5-boilerplate/pull/2135))
* Docs updates ([#2122](https://github.com/h5bp/html5-boilerplate/pull/2122)), ([#2125](https://github.com/h5bp/html5-boilerplate/pull/2125)), ([#2134](https://github.com/h5bp/html5-boilerplate/pull/2134)), ([#2137](https://github.com/h5bp/html5-boilerplate/pull/2137)), ([#2138](https://github.com/h5bp/html5-boilerplate/pull/2138)) - Docs updates ([#2122](https://github.com/h5bp/html5-boilerplate/pull/2122)), ([#2125](https://github.com/h5bp/html5-boilerplate/pull/2125)), ([#2134](https://github.com/h5bp/html5-boilerplate/pull/2134)), ([#2137](https://github.com/h5bp/html5-boilerplate/pull/2137)), ([#2138](https://github.com/h5bp/html5-boilerplate/pull/2138))
## 7.1.0 (March 18, 2019) ## 7.1.0 (March 18, 2019)
* Update Modernizr to 3.7.1 ([#2121](https://github.com/h5bp/html5-boilerplate/pull/2121)) - Update Modernizr to 3.7.1 ([#2121](https://github.com/h5bp/html5-boilerplate/pull/2121))
* Update Analytics docs and snippet ([#2118](https://github.com/h5bp/html5-boilerplate/pull/2118)) - Update Analytics docs and snippet ([#2118](https://github.com/h5bp/html5-boilerplate/pull/2118))
* Minor docs updates ([#2115](https://github.com/h5bp/html5-boilerplate/pull/2115)) - Minor docs updates ([#2115](https://github.com/h5bp/html5-boilerplate/pull/2115))
* Minor devdeps updates ([#2114](https://github.com/h5bp/html5-boilerplate/pull/2114)) - Minor devdeps updates ([#2114](https://github.com/h5bp/html5-boilerplate/pull/2114))
* More succinct way of writing the IE conditional statement ([#2113](https://github.com/h5bp/html5-boilerplate/pull/2113)) - More succinct way of writing the IE conditional statement ([#2113](https://github.com/h5bp/html5-boilerplate/pull/2113))
## 7.0.1 (February 11, 2019) ## 7.0.1 (February 11, 2019)
* Bumps main.css to current version ([#2112](https://github.com/h5bp/html5-boilerplate/pull/2112)) - Bumps main.css to current version ([#2112](https://github.com/h5bp/html5-boilerplate/pull/2112))
## 7.0.0 (February 8, 2019) ## 7.0.0 (February 8, 2019)
* Drop support for IE9/IE10 (usage of these versions is tiny and Microsoft officially ended support back in 2016. ([#2074](https://github.com/h5bp/html5-boilerplate/pull/2074)) - Drop support for IE9/IE10 (usage of these versions is tiny and Microsoft officially ended support back in 2016. ([#2074](https://github.com/h5bp/html5-boilerplate/pull/2074))
* Move the CSS to a separate repo ([#2066](https://github.com/h5bp/html5-boilerplate/pull/2066)) - Move the CSS to a separate repo ([#2066](https://github.com/h5bp/html5-boilerplate/pull/2066))
* Add theme-color meta tag to index.html ([#2074](https://github.com/h5bp/html5-boilerplate/pull/2074)) - Add theme-color meta tag to index.html ([#2074](https://github.com/h5bp/html5-boilerplate/pull/2074))
* Add 'install with yarn' steps to README ([#2063](https://github.com/h5bp/html5-boilerplate/pull/2063)) - Add 'install with yarn' steps to README ([#2063](https://github.com/h5bp/html5-boilerplate/pull/2063))
* Improved Webmanifest ([#2060](https://github.com/h5bp/html5-boilerplate/pull/2060)) - Improved Webmanifest ([#2060](https://github.com/h5bp/html5-boilerplate/pull/2060))
* Upgrade Normalize to 8.0.1 ([#2104](https://github.com/h5bp/html5-boilerplate/pull/2104)) - Upgrade Normalize to 8.0.1 ([#2104](https://github.com/h5bp/html5-boilerplate/pull/2104))
* Update .htaccess ([#2110](https://github.com/h5bp/html5-boilerplate/pull/2110)) - Update .htaccess ([#2110](https://github.com/h5bp/html5-boilerplate/pull/2110))
* Remove instances of `shrink-to-fit=no` ([#2103](https://github.com/h5bp/html5-boilerplate/pull/2103)) - Remove instances of `shrink-to-fit=no` ([#2103](https://github.com/h5bp/html5-boilerplate/pull/2103))
* Removes "display": "standalone" from manifest ([#2096](https://github.com/h5bp/html5-boilerplate/pull/2096)) - Removes "display": "standalone" from manifest ([#2096](https://github.com/h5bp/html5-boilerplate/pull/2096))
* Big Docs update - Fixed links, removed IE9/IE10 specific info, made touch icons section more concise, add details on security.txt and more tidying up ([#2074](https://github.com/h5bp/html5-boilerplate/pull/2031), [#2065](https://github.com/h5bp/html5-boilerplate/pull/2065), [#2062](https://github.com/h5bp/html5-boilerplate/pull/2062)) - Big Docs update - Fixed links, removed IE9/IE10 specific info, made touch icons section more concise, add details on security.txt and more tidying up ([#2074](https://github.com/h5bp/html5-boilerplate/pull/2031), [#2065](https://github.com/h5bp/html5-boilerplate/pull/2065), [#2062](https://github.com/h5bp/html5-boilerplate/pull/2062))
## 6.1.0 (May 1, 2018) ## 6.1.0 (May 1, 2018)
* [Update Apache Server Configs to `v3.0.0`.](https://github.com/h5bp/html5-boilerplate/pull/2042) - [Update Apache Server Configs to `v3.0.0`.](https://github.com/h5bp/html5-boilerplate/pull/2042)
* Migrate to eslint ([#2037](https://github.com/h5bp/html5-boilerplate/pull/2037)) - Migrate to eslint ([#2037](https://github.com/h5bp/html5-boilerplate/pull/2037))
* Update to jQuery 3.3.1 ([#2018](https://github.com/h5bp/html5-boilerplate/pull/2018)) - Update to jQuery 3.3.1 ([#2018](https://github.com/h5bp/html5-boilerplate/pull/2018))
* Update to Modernizr v3.6 and Normalize v8 ([#2028](https://github.com/h5bp/html5-boilerplate/pull/2028)) - Update to Modernizr v3.6 and Normalize v8 ([#2028](https://github.com/h5bp/html5-boilerplate/pull/2028))
* Update Dev Dependencies ([#2032](https://github.com/h5bp/html5-boilerplate/pull/2032)) ([#2017](https://github.com/h5bp/html5-boilerplate/pull/2017)) ([#2010](https://github.com/h5bp/html5-boilerplate/pull/2010)) ([#2009](https://github.com/h5bp/html5-boilerplate/pull/2009)) - Update Dev Dependencies ([#2032](https://github.com/h5bp/html5-boilerplate/pull/2032)) ([#2017](https://github.com/h5bp/html5-boilerplate/pull/2017)) ([#2010](https://github.com/h5bp/html5-boilerplate/pull/2010)) ([#2009](https://github.com/h5bp/html5-boilerplate/pull/2009))
* Replace 'node-sri' with 'ssri' ([#2031](https://github.com/h5bp/html5-boilerplate/pull/2031)) - Replace 'node-sri' with 'ssri' ([#2031](https://github.com/h5bp/html5-boilerplate/pull/2031))
* Add .babelrc and .prettierrc to .gitattributes ([#2030](https://github.com/h5bp/html5-boilerplate/pull/2030)) - Add .babelrc and .prettierrc to .gitattributes ([#2030](https://github.com/h5bp/html5-boilerplate/pull/2030))
* Update .htaccess ([#2003](https://github.com/h5bp/html5-boilerplate/pull/2003)) - Update .htaccess ([#2003](https://github.com/h5bp/html5-boilerplate/pull/2003))
* Fixed JSHint errors ([#1994](https://github.com/h5bp/html5-boilerplate/pull/1994)) - Fixed JSHint errors ([#1994](https://github.com/h5bp/html5-boilerplate/pull/1994))
* Add CODE_OF_CONDUCT.md ([#2011](https://github.com/h5bp/html5-boilerplate/pull/2011)) - Add CODE_OF_CONDUCT.md ([#2011](https://github.com/h5bp/html5-boilerplate/pull/2011))
* Update Documentation ([#2029](https://github.com/h5bp/html5-boilerplate/pull/2029)) ([#2015](https://github.com/h5bp/html5-boilerplate/pull/2015)) ([#2007](https://github.com/h5bp/html5-boilerplate/pull/2007)) ([#2006](https://github.com/h5bp/html5-boilerplate/pull/2006)) ([#1996](https://github.com/h5bp/html5-boilerplate/pull/1996)) - Update Documentation ([#2029](https://github.com/h5bp/html5-boilerplate/pull/2029)) ([#2015](https://github.com/h5bp/html5-boilerplate/pull/2015)) ([#2007](https://github.com/h5bp/html5-boilerplate/pull/2007)) ([#2006](https://github.com/h5bp/html5-boilerplate/pull/2006)) ([#1996](https://github.com/h5bp/html5-boilerplate/pull/1996))
## 6.0.1 (August 20, 2017) ## 6.0.1 (August 20, 2017)
* Reverts .visuallyhidden (see [#1985](https://github.com/h5bp/html5-boilerplate/issues/1985)) - Reverts .visuallyhidden (see [#1985](https://github.com/h5bp/html5-boilerplate/issues/1985))
## 6.0.0 (August 17, 2017) ## 6.0.0 (August 17, 2017)
* Fix Bug: .visuallyhidden on macOS VO fixes #1985 ([#1989](https://github.com/h5bp/html5-boilerplate/pull/1989)) - Fix Bug: .visuallyhidden on macOS VO fixes #1985 ([#1989](https://github.com/h5bp/html5-boilerplate/pull/1989))
* Adds web app manifest file ([#1963](https://github.com/h5bp/html5-boilerplate/pull/1963)) - Adds web app manifest file ([#1963](https://github.com/h5bp/html5-boilerplate/pull/1963))
* Update to jQuery 3.2.1 ([#1942](https://github.com/h5bp/html5-boilerplate/pull/1942)) - Update to jQuery 3.2.1 ([#1942](https://github.com/h5bp/html5-boilerplate/pull/1942))
* Improve ::selection documentation which became confusing after c7057be ([#1955](https://github.com/h5bp/html5-boilerplate/pull/1955)) - Improve ::selection documentation which became confusing after c7057be ([#1955](https://github.com/h5bp/html5-boilerplate/pull/1955))
* refactor(html): update browsehappy to https instead of http ([#1952](https://github.com/h5bp/html5-boilerplate/pull/1952)) - refactor(html): update browsehappy to https instead of http ([#1952](https://github.com/h5bp/html5-boilerplate/pull/1952))
* Fix links to CONTRIBUTING.md ([#1951](https://github.com/h5bp/html5-boilerplate/pull/1951)) - Fix links to CONTRIBUTING.md ([#1951](https://github.com/h5bp/html5-boilerplate/pull/1951))
* Adds .github folder and contents Fixes ([#1948](https://github.com/h5bp/html5-boilerplate/pull/1948)) - Adds .github folder and contents Fixes ([#1948](https://github.com/h5bp/html5-boilerplate/pull/1948))
* Modernizr 3, modernizr.config and ([#1940](https://github.com/h5bp/html5-boilerplate/pull/1940)) - Modernizr 3, modernizr.config and ([#1940](https://github.com/h5bp/html5-boilerplate/pull/1940))
* Housekeeping by @coliff (#1968 #1969 #1965 #1964 #1958 #1957 #1956) - Housekeeping by @coliff (#1968 #1969 #1965 #1964 #1958 #1957 #1956)
* Update .gitattributes for Web Projects ([#1935](https://github.com/h5bp/html5-boilerplate/pull/1935)) - Update .gitattributes for Web Projects ([#1935](https://github.com/h5bp/html5-boilerplate/pull/1935))
* Add the link for useful .gitignore templates ([#1936](https://github.com/h5bp/html5-boilerplate/pull/1936)) - Add the link for useful .gitignore templates ([#1936](https://github.com/h5bp/html5-boilerplate/pull/1936))
* Node plumbing updated ([#1925](https://github.com/h5bp/html5-boilerplate/pull/1925)) ([#1928](https://github.com/h5bp/html5-boilerplate/pull/1928)) ([#1931](https://github.com/h5bp/html5-boilerplate/pull/1931)) - Node plumbing updated ([#1925](https://github.com/h5bp/html5-boilerplate/pull/1925)) ([#1928](https://github.com/h5bp/html5-boilerplate/pull/1928)) ([#1931](https://github.com/h5bp/html5-boilerplate/pull/1931))
* Use es2015 syntax in mocha tests ([#1788](https://github.com/h5bp/html5-boilerplate/pull/1788)) - Use es2015 syntax in mocha tests ([#1788](https://github.com/h5bp/html5-boilerplate/pull/1788))
* Scope :first-letter selector for print styles ([#1904](https://github.com/h5bp/html5-boilerplate/pull/1904)) - Scope :first-letter selector for print styles ([#1904](https://github.com/h5bp/html5-boilerplate/pull/1904))
* Add SRI Hash for jQuery ([#1904](https://github.com/h5bp/html5-boilerplate/pull/1904)) - Add SRI Hash for jQuery ([#1904](https://github.com/h5bp/html5-boilerplate/pull/1904))
* Update .jshintrc ([#1903](https://github.com/h5bp/html5-boilerplate/pull/1903)) - Update .jshintrc ([#1903](https://github.com/h5bp/html5-boilerplate/pull/1903))
* Improve accessibility with visuallyhidden content ([#1900](https://github.com/h5bp/html5-boilerplate/pull/1900)) - Improve accessibility with visuallyhidden content ([#1900](https://github.com/h5bp/html5-boilerplate/pull/1900))
* Tell users that IE 8 and 9 are outdated - Tell users that IE 8 and 9 are outdated
([#1747](https://github.com/h5bp/html5-boilerplate/issues/1747)). ([#1747](https://github.com/h5bp/html5-boilerplate/issues/1747)).
* Removed IE8 Support (upgrades jQuery and normalize.css to latest) - Removed IE8 Support (upgrades jQuery and normalize.css to latest)
([#1524](https://github.com/h5bp/html5-boilerplate/issues/1524)). ([#1524](https://github.com/h5bp/html5-boilerplate/issues/1524)).
* Fix print styles for Internet Explorer 11 - Fix print styles for Internet Explorer 11
([#1799](https://github.com/h5bp/html5-boilerplate/issues/1799)). ([#1799](https://github.com/h5bp/html5-boilerplate/issues/1799)).
* Update doc links to https - Update doc links to https
([#1889](https://github.com/h5bp/html5-boilerplate/issues/1889)). ([#1889](https://github.com/h5bp/html5-boilerplate/issues/1889)).
* Delete crossdomain.xml - Delete crossdomain.xml
([#1881](https://github.com/h5bp/html5-boilerplate/issues/1881)). ([#1881](https://github.com/h5bp/html5-boilerplate/issues/1881)).
* Adds pre-wrap to PRE - Adds pre-wrap to PRE
([#1742](https://github.com/h5bp/html5-boilerplate/issues/1742)). ([#1742](https://github.com/h5bp/html5-boilerplate/issues/1742)).
* Change license format to SPDX format - Change license format to SPDX format
([#1814](https://github.com/h5bp/html5-boilerplate/pull/1814)). ([#1814](https://github.com/h5bp/html5-boilerplate/pull/1814)).
* Simplify the Google Analytics snippet using `async` & `defer` ([#1660](https://github.com/h5bp/html5-boilerplate/pull/1660#issuecomment-89285678)). - Simplify the Google Analytics snippet using `async` & `defer` ([#1660](https://github.com/h5bp/html5-boilerplate/pull/1660#issuecomment-89285678)).
## 5.3.0 (January 12, 2016) ## 5.3.0 (January 12, 2016)
* Update jQuery to `v1.12.0`. - Update jQuery to `v1.12.0`.
* Fetch `jQuery` from jQuery's CDN instead of Google's - Fetch `jQuery` from jQuery's CDN instead of Google's
([#1737](https://github.com/h5bp/html5-boilerplate/issues/1737), ([#1737](https://github.com/h5bp/html5-boilerplate/issues/1737),
[#1739](https://github.com/h5bp/html5-boilerplate/issues/1739)). [#1739](https://github.com/h5bp/html5-boilerplate/issues/1739)).
* Change print color for `:first-letter` and `:first-line` - Change print color for `:first-letter` and `:first-line`
pseudo-elements pseudo-elements
([#1715](https://github.com/h5bp/html5-boilerplate/pull/1715)). ([#1715](https://github.com/h5bp/html5-boilerplate/pull/1715)).
## 5.2.0 (May 1, 2015) ## 5.2.0 (May 1, 2015)
* Update jQuery to `v1.11.3` - Update jQuery to `v1.11.3`
([#1699](https://github.com/h5bp/html5-boilerplate/issues/1699)). ([#1699](https://github.com/h5bp/html5-boilerplate/issues/1699)).
* Deprecate protocol-relative URLs - Deprecate protocol-relative URLs
([#1694](https://github.com/h5bp/html5-boilerplate/issues/1694)). ([#1694](https://github.com/h5bp/html5-boilerplate/issues/1694)).
* Update high resolution media query - Update high resolution media query
([#1474](https://github.com/h5bp/html5-boilerplate/issues/1474)). ([#1474](https://github.com/h5bp/html5-boilerplate/issues/1474)).
* Update Apache Server Configs to `v2.14.0`. - Update Apache Server Configs to `v2.14.0`.
## 5.1.0 (April 1, 2015) ## 5.1.0 (April 1, 2015)
* Update Normalize.css to `v3.0.3`. - Update Normalize.css to `v3.0.3`.
* Use `https://` in the Google Universal Analytics snippet - Use `https://` in the Google Universal Analytics snippet
([eee759b](https://github.com/h5bp/html5-boilerplate/commit/eee759bfe175e850bbc8e4ad0682ec4fe4bd05d6)). ([eee759b](https://github.com/h5bp/html5-boilerplate/commit/eee759bfe175e850bbc8e4ad0682ec4fe4bd05d6)).
* Remove the `visibility: hidden` declaration from `.hidden` - Remove the `visibility: hidden` declaration from `.hidden`
([#1663](https://github.com/h5bp/html5-boilerplate/issues/1663)). ([#1663](https://github.com/h5bp/html5-boilerplate/issues/1663)).
* Use `<meta http-equiv="x-ua-compatible" content="ie=edge">`<br> - Use `<meta http-equiv="x-ua-compatible" content="ie=edge">`<br>
instead of `<meta http-equiv="X-UA-Compatible" content="IE=edge">` instead of `<meta http-equiv="X-UA-Compatible" content="IE=edge">`
([#1656](https://github.com/h5bp/html5-boilerplate/issues/1656)). ([#1656](https://github.com/h5bp/html5-boilerplate/issues/1656)).
* Update Apache Server Configs to `v2.13.0`. - Update Apache Server Configs to `v2.13.0`.
## 5.0.0 (February 1, 2015) ## 5.0.0 (February 1, 2015)
* Update to jQuery 1.11.2. - Update to jQuery 1.11.2.
* Update Apache Server Configs to v2.11.0. - Update Apache Server Configs to v2.11.0.
* Rename Apple touch icon to `apple-touch-icon.png` and add - Rename Apple touch icon to `apple-touch-icon.png` and add
`<link>` in `index.html` `<link>` in `index.html`
([#1622](https://github.com/h5bp/html5-boilerplate/issues/1622)). ([#1622](https://github.com/h5bp/html5-boilerplate/issues/1622)).
* Add vertical centering for `iframe` - Add vertical centering for `iframe`
([#1613](https://github.com/h5bp/html5-boilerplate/issues/1613)). ([#1613](https://github.com/h5bp/html5-boilerplate/issues/1613)).
* Change the outdated browser prompt classname to `browserupgrade` - Change the outdated browser prompt classname to `browserupgrade`
([#1608](https://github.com/h5bp/html5-boilerplate/issues/1608)). ([#1608](https://github.com/h5bp/html5-boilerplate/issues/1608)).
* Update to Normalize.css 3.0.2. - Update to Normalize.css 3.0.2.
([#1050](https://github.com/h5bp/html5-boilerplate/issues/1050)). ([#1050](https://github.com/h5bp/html5-boilerplate/issues/1050)).
* Update `apple-touch-icon-precomposed.png` and the _"Apple touch - Update `apple-touch-icon-precomposed.png` and the _"Apple touch
icons"_ related documentation icons"_ related documentation
([#1599](https://github.com/h5bp/html5-boilerplate/pull/1599)). ([#1599](https://github.com/h5bp/html5-boilerplate/pull/1599)).
* Add pseudo-elements to universal selector in print media query - Add pseudo-elements to universal selector in print media query
([#1585](https://github.com/h5bp/html5-boilerplate/pull/1585)). ([#1585](https://github.com/h5bp/html5-boilerplate/pull/1585)).
* Update to Modernizr 2.8.3. - Update to Modernizr 2.8.3.
* Remove need to readjust margins in `404.html` - Remove need to readjust margins in `404.html`
([#1567](https://github.com/h5bp/html5-boilerplate/pull/1567)). ([#1567](https://github.com/h5bp/html5-boilerplate/pull/1567)).
* Add `/.editorconfig` file - Add `/.editorconfig` file
([#1561](https://github.com/h5bp/html5-boilerplate/issues/1561), ([#1561](https://github.com/h5bp/html5-boilerplate/issues/1561),
[#1564](https://github.com/h5bp/html5-boilerplate/issues/1564)). [#1564](https://github.com/h5bp/html5-boilerplate/issues/1564)).
* Add `auto` to the Google Universal Analytics tracker create method - Add `auto` to the Google Universal Analytics tracker create method
([#1562](https://github.com/h5bp/html5-boilerplate/issues/1562)). ([#1562](https://github.com/h5bp/html5-boilerplate/issues/1562)).
* Add `timeline` and `timelineEnd` to the list of `console` methods - Add `timeline` and `timelineEnd` to the list of `console` methods
([#1559](https://github.com/h5bp/html5-boilerplate/issues/1559)). ([#1559](https://github.com/h5bp/html5-boilerplate/issues/1559)).
* Add `lang=""` to `<html>` - Add `lang=""` to `<html>`
([#1542](https://github.com/h5bp/html5-boilerplate/issues/1542)). ([#1542](https://github.com/h5bp/html5-boilerplate/issues/1542)).
* Use `<!doctype html>` instead of `<!DOCTYPE html>` - Use `<!doctype html>` instead of `<!DOCTYPE html>`
([#1522](https://github.com/h5bp/html5-boilerplate/issues/1522)). ([#1522](https://github.com/h5bp/html5-boilerplate/issues/1522)).
* Add `/browserconfig.xml` file and tile images - Add `/browserconfig.xml` file and tile images
([#1481](https://github.com/h5bp/html5-boilerplate/issues/1481)). ([#1481](https://github.com/h5bp/html5-boilerplate/issues/1481)).
* Add `Disallow:` to `robots.txt` - Add `Disallow:` to `robots.txt`
([#1487](https://github.com/h5bp/html5-boilerplate/issues/1487)). ([#1487](https://github.com/h5bp/html5-boilerplate/issues/1487)).
* Remove default foreground color from form elements - Remove default foreground color from form elements
([#1390](https://github.com/h5bp/html5-boilerplate/issues/1390)). ([#1390](https://github.com/h5bp/html5-boilerplate/issues/1390)).
* Remove default margin from print styles - Remove default margin from print styles
([#1477](https://github.com/h5bp/html5-boilerplate/issues/1477)). ([#1477](https://github.com/h5bp/html5-boilerplate/issues/1477)).
* Remove image replacement helper class `.ir` - Remove image replacement helper class `.ir`
([#1472](https://github.com/h5bp/html5-boilerplate/issues/1472), ([#1472](https://github.com/h5bp/html5-boilerplate/issues/1472),
[#1475](https://github.com/h5bp/html5-boilerplate/issues/1475)). [#1475](https://github.com/h5bp/html5-boilerplate/issues/1475)).
* Add vertical centering for `svg` - Add vertical centering for `svg`
([#1453](https://github.com/h5bp/html5-boilerplate/issues/1453)). ([#1453](https://github.com/h5bp/html5-boilerplate/issues/1453)).
* Redesign 404 page - Redesign 404 page
([#1443](https://github.com/h5bp/html5-boilerplate/pull/1443)). ([#1443](https://github.com/h5bp/html5-boilerplate/pull/1443)).
* Remove IE 6/7 hacks from `main.css` - Remove IE 6/7 hacks from `main.css`
([#1050](https://github.com/h5bp/html5-boilerplate/issues/1050)). ([#1050](https://github.com/h5bp/html5-boilerplate/issues/1050)).
* Remove IE conditional classes - Remove IE conditional classes
([#1187](https://github.com/h5bp/html5-boilerplate/issues/1187), ([#1187](https://github.com/h5bp/html5-boilerplate/issues/1187),
[#1290](https://github.com/h5bp/html5-boilerplate/issues/1290)). [#1290](https://github.com/h5bp/html5-boilerplate/issues/1290)).
## 4.3.0 (September 10, 2013) ## 4.3.0 (September 10, 2013)
* Use one `apple-touch-icon` instead of six - Use one `apple-touch-icon` instead of six
([#1367](https://github.com/h5bp/html5-boilerplate/issues/1367)). ([#1367](https://github.com/h5bp/html5-boilerplate/issues/1367)).
* Move font-related declarations from `body` to `html` - Move font-related declarations from `body` to `html`
([#1411](https://github.com/h5bp/html5-boilerplate/issues/1411)). ([#1411](https://github.com/h5bp/html5-boilerplate/issues/1411)).
* Update to Apache Server Configs 1.1.0. - Update to Apache Server Configs 1.1.0.
* Add `initial-scale=1` to the viewport `meta` - Add `initial-scale=1` to the viewport `meta`
([#1398](https://github.com/h5bp/html5-boilerplate/pull/1398)). ([#1398](https://github.com/h5bp/html5-boilerplate/pull/1398)).
* Vertical centering for audio, canvas and video-tags - Vertical centering for audio, canvas and video-tags
([#1326](https://github.com/h5bp/html5-boilerplate/issues/1326)). ([#1326](https://github.com/h5bp/html5-boilerplate/issues/1326)).
* Remove Google Chrome Frame related code - Remove Google Chrome Frame related code
([#1379](https://github.com/h5bp/html5-boilerplate/pull/1379), ([#1379](https://github.com/h5bp/html5-boilerplate/pull/1379),
[#1396](https://github.com/h5bp/html5-boilerplate/pull/1396)). [#1396](https://github.com/h5bp/html5-boilerplate/pull/1396)).
* Update to Google Universal Analytics - Update to Google Universal Analytics
([#1347](https://github.com/h5bp/html5-boilerplate/issues/1347)). ([#1347](https://github.com/h5bp/html5-boilerplate/issues/1347)).
* Update to jQuery 1.10.2. - Update to jQuery 1.10.2.
* Update to Normalize.css 1.1.3. - Update to Normalize.css 1.1.3.
## 4.2.0 (April 8, 2013) ## 4.2.0 (April 8, 2013)
* Remove Google Analytics protocol check - Remove Google Analytics protocol check
([#1319](https://github.com/h5bp/html5-boilerplate/pull/1319)). ([#1319](https://github.com/h5bp/html5-boilerplate/pull/1319)).
* Update to Normalize.css 1.1.1. - Update to Normalize.css 1.1.1.
* Update Apache configurations to include the latest changes in the - Update Apache configurations to include the latest changes in the
canonical [`.htaccess`](https://github.com/h5bp/server-configs-apache) canonical [`.htaccess`](https://github.com/h5bp/server-configs-apache)
file. file.
* Use a protocol relative URL for the 404 template script. - Use a protocol relative URL for the 404 template script.
* Update to jQuery 1.9.1. - Update to jQuery 1.9.1.
## 4.1.0 (January 21, 2013) ## 4.1.0 (January 21, 2013)
* Update to Normalize.css 1.1.0. - Update to Normalize.css 1.1.0.
* Update to jQuery 1.9.0. - Update to jQuery 1.9.0.
## 4.0.3 (January 12, 2013) ## 4.0.3 (January 12, 2013)
* Use 32x32 favicon.ico - Use 32x32 favicon.ico
([#1286](https://github.com/h5bp/html5-boilerplate/pull/1286)). ([#1286](https://github.com/h5bp/html5-boilerplate/pull/1286)).
* Remove named function expression in plugins.js - Remove named function expression in plugins.js
([#1280](https://github.com/h5bp/html5-boilerplate/pull/1280)). ([#1280](https://github.com/h5bp/html5-boilerplate/pull/1280)).
* Adjust CSS image-replacement code - Adjust CSS image-replacement code
([#1239](https://github.com/h5bp/html5-boilerplate/issues/1239)). ([#1239](https://github.com/h5bp/html5-boilerplate/issues/1239)).
* Update HiDPI example media query - Update HiDPI example media query
([#1127](https://github.com/h5bp/html5-boilerplate/issues/1127)). ([#1127](https://github.com/h5bp/html5-boilerplate/issues/1127)).
## 4.0.2 (December 9, 2012) ## 4.0.2 (December 9, 2012)
* Update placeholder icons. - Update placeholder icons.
* Update to Normalize.css 1.0.2. - Update to Normalize.css 1.0.2.
* Update to jQuery 1.8.3. - Update to jQuery 1.8.3.
## 4.0.1 (October 20, 2012) ## 4.0.1 (October 20, 2012)
* Further improvements to `console` method stubbing - Further improvements to `console` method stubbing
([#1206](https://github.com/h5bp/html5-boilerplate/issues/1206), ([#1206](https://github.com/h5bp/html5-boilerplate/issues/1206),
[#1229](https://github.com/h5bp/html5-boilerplate/pull/1229)). [#1229](https://github.com/h5bp/html5-boilerplate/pull/1229)).
* Update to jQuery 1.8.2. - Update to jQuery 1.8.2.
* Update to Modernizr 2.6.2. - Update to Modernizr 2.6.2.
* Minor additions to the documentation. - Minor additions to the documentation.
## 4.0.0 (August 28, 2012) ## 4.0.0 (August 28, 2012)
* Improve the Apache compression configuration - Improve the Apache compression configuration
([#1012](https://github.com/h5bp/html5-boilerplate/issues/1012), ([#1012](https://github.com/h5bp/html5-boilerplate/issues/1012),
[#1173](https://github.com/h5bp/html5-boilerplate/issues/1173)). [#1173](https://github.com/h5bp/html5-boilerplate/issues/1173)).
* Add a HiDPI example media query - Add a HiDPI example media query
([#1127](https://github.com/h5bp/html5-boilerplate/issues/1127)). ([#1127](https://github.com/h5bp/html5-boilerplate/issues/1127)).
* Add bundled docs - Add bundled docs
([#1154](https://github.com/h5bp/html5-boilerplate/issues/1154)). ([#1154](https://github.com/h5bp/html5-boilerplate/issues/1154)).
* Add MIT license - Add MIT license
([#1139](https://github.com/h5bp/html5-boilerplate/issues/1139)). ([#1139](https://github.com/h5bp/html5-boilerplate/issues/1139)).
* Update to Normalize.css 1.0.1. - Update to Normalize.css 1.0.1.
* Separate Normalize.css from the rest of the CSS - Separate Normalize.css from the rest of the CSS
([#1160](https://github.com/h5bp/html5-boilerplate/issues/1160)). ([#1160](https://github.com/h5bp/html5-boilerplate/issues/1160)).
* Improve `console.log` protection - Improve `console.log` protection
([#1107](https://github.com/h5bp/html5-boilerplate/issues/1107)). ([#1107](https://github.com/h5bp/html5-boilerplate/issues/1107)).
* Replace hot pink text selection color with a neutral color. - Replace hot pink text selection color with a neutral color.
* Change image replacement technique - Change image replacement technique
([#1149](https://github.com/h5bp/html5-boilerplate/issues/1149)). ([#1149](https://github.com/h5bp/html5-boilerplate/issues/1149)).
* Code format and consistency changes - Code format and consistency changes
([#1112](https://github.com/h5bp/html5-boilerplate/issues/1112)). ([#1112](https://github.com/h5bp/html5-boilerplate/issues/1112)).
* Rename CSS file and rename JS files and subdirectories. - Rename CSS file and rename JS files and subdirectories.
* Update to jQuery 1.8 - Update to jQuery 1.8
([#1161](https://github.com/h5bp/html5-boilerplate/issues/1161)). ([#1161](https://github.com/h5bp/html5-boilerplate/issues/1161)).
* Update to Modernizr 2.6.1 - Update to Modernizr 2.6.1
([#1086](https://github.com/h5bp/html5-boilerplate/issues/1086)). ([#1086](https://github.com/h5bp/html5-boilerplate/issues/1086)).
* Remove uncompressed jQuery - Remove uncompressed jQuery
([#1153](https://github.com/h5bp/html5-boilerplate/issues/1153)). ([#1153](https://github.com/h5bp/html5-boilerplate/issues/1153)).
* Remove superfluous inline comments - Remove superfluous inline comments
([#1150](https://github.com/h5bp/html5-boilerplate/issues/1150)). ([#1150](https://github.com/h5bp/html5-boilerplate/issues/1150)).
## 3.0.2 (February 19, 2012) ## 3.0.2 (February 19, 2012)
* Update to Modernizr 2.5.3. - Update to Modernizr 2.5.3.
## 3.0.1 (February 08, 2012) ## 3.0.1 (February 08, 2012)
* Update to Modernizr 2.5.2 (includes html5shiv 3.3). - Update to Modernizr 2.5.2 (includes html5shiv 3.3).
## 3.0.0 (February 06, 2012) ## 3.0.0 (February 06, 2012)
* Improvements to `.htaccess`. - Improvements to `.htaccess`.
* Improve 404 design. - Improve 404 design.
* Simplify JS folder structure. - Simplify JS folder structure.
* Change `html` IE class names changed to target ranges rather than - Change `html` IE class names changed to target ranges rather than
specific versions of IE. specific versions of IE.
* Update CSS to include latest normalize.css changes and better - Update CSS to include latest normalize.css changes and better
typographic defaults typographic defaults
([#825](https://github.com/h5bp/html5-boilerplate/issues/825)). ([#825](https://github.com/h5bp/html5-boilerplate/issues/825)).
* Update to Modernizr 2.5 (includes yepnope 1.5 and html5shiv 3.2). - Update to Modernizr 2.5 (includes yepnope 1.5 and html5shiv 3.2).
* Update to jQuery 1.7.1. - Update to jQuery 1.7.1.
* Revert to async snippet for the Google Analytics script. - Revert to async snippet for the Google Analytics script.
* Remove the ant build script - Remove the ant build script
([#826](https://github.com/h5bp/html5-boilerplate/issues/826)). ([#826](https://github.com/h5bp/html5-boilerplate/issues/826)).
* Remove Respond.js - Remove Respond.js
([#816](https://github.com/h5bp/html5-boilerplate/issues/816)). ([#816](https://github.com/h5bp/html5-boilerplate/issues/816)).
* Remove the `demo/` directory - Remove the `demo/` directory
([#808](https://github.com/h5bp/html5-boilerplate/issues/808)). ([#808](https://github.com/h5bp/html5-boilerplate/issues/808)).
* Remove the `test/` directory - Remove the `test/` directory
([#808](https://github.com/h5bp/html5-boilerplate/issues/808)). ([#808](https://github.com/h5bp/html5-boilerplate/issues/808)).
* Remove Google Chrome Frame script for IE6 users; replace with links - Remove Google Chrome Frame script for IE6 users; replace with links
to Chrome Frame and options for alternative browsers. to Chrome Frame and options for alternative browsers.
* Remove `initial-scale=1` from the viewport `meta` - Remove `initial-scale=1` from the viewport `meta`
([#824](https://github.com/h5bp/html5-boilerplate/issues/824)). ([#824](https://github.com/h5bp/html5-boilerplate/issues/824)).
* Remove `defer` from all scripts to avoid legacy IE bugs. - Remove `defer` from all scripts to avoid legacy IE bugs.
* Remove explicit Site Speed tracking for Google Analytics. It's now - Remove explicit Site Speed tracking for Google Analytics. It's now
enabled by default. enabled by default.
## 2.0.0 (August 10, 2011) ## 2.0.0 (August 10, 2011)
* Change starting CSS to be based on normalize.css instead of reset.css - Change starting CSS to be based on normalize.css instead of reset.css
([#500](https://github.com/h5bp/html5-boilerplate/issues/500)). ([#500](https://github.com/h5bp/html5-boilerplate/issues/500)).
* Add Respond.js media query polyfill. - Add Respond.js media query polyfill.
* Add Google Chrome Frame script prompt for IE6 users. - Add Google Chrome Frame script prompt for IE6 users.
* Simplify the `html` conditional comments for modern browsers and add - Simplify the `html` conditional comments for modern browsers and add
an `oldie` class. an `oldie` class.
* Update clearfix to use "micro clearfix". - Update clearfix to use "micro clearfix".
* Add placeholder CSS MQs for mobile-first approach. - Add placeholder CSS MQs for mobile-first approach.
* Add `textarea { resize: vertical; }` to only allow vertical resizing. - Add `textarea { resize: vertical; }` to only allow vertical resizing.
* Add `img { max-width: 100%; }` to the print styles; prevents images - Add `img { max-width: 100%; }` to the print styles; prevents images
being truncated. being truncated.
* Add Site Speed tracking for Google Analytics. - Add Site Speed tracking for Google Analytics.
* Update to jQuery 1.6.2 (and use minified by default). - Update to jQuery 1.6.2 (and use minified by default).
* Update to Modernizr 2.0 Complete, Production minified (includes - Update to Modernizr 2.0 Complete, Production minified (includes
yepnope, html5shiv, and Respond.js). yepnope, html5shiv, and Respond.js).
* Use `Modernizr.load()` to load the Google Analytics script. - Use `Modernizr.load()` to load the Google Analytics script.
* Much faster build process. - Much faster build process.
* Add build script options for CSSLint, JSLint, JSHint tools. - Add build script options for CSSLint, JSLint, JSHint tools.
* Build script now compresses all images in subfolders. - Build script now compresses all images in subfolders.
* Build script now versions files by SHA hash. - Build script now versions files by SHA hash.
* Many `.htaccess` improvements including: disable directory browsing, - Many `.htaccess` improvements including: disable directory browsing,
improved support for all versions of Apache, more robust and extensive improved support for all versions of Apache, more robust and extensive
HTTP compression rules. HTTP compression rules.
* Remove `handheld.css` as it has very poor device support. - Remove `handheld.css` as it has very poor device support.
* Remove touch-icon `link` elements from the HTML and include improved - Remove touch-icon `link` elements from the HTML and include improved
touch-icon support. touch-icon support.
* Remove the cache-busting query parameters from files references in - Remove the cache-busting query parameters from files references in
the HTML. the HTML.
* Remove IE6 PNGFix. - Remove IE6 PNGFix.
## 1.0.0 (March 21, 2011) ## 1.0.0 (March 21, 2011)
* Rewrite build script to make it more customizable and flexible. - Rewrite build script to make it more customizable and flexible.
* Add a humans.txt. - Add a humans.txt.
* Numerous `.htaccess` improvements (including inline documentation). - Numerous `.htaccess` improvements (including inline documentation).
* Move the alternative server configurations to the H5BP server configs - Move the alternative server configurations to the H5BP server configs
repo. repo.
* Use a protocol-relative url to reference jQuery and prevent mixed - Use a protocol-relative url to reference jQuery and prevent mixed
content warnings. content warnings.
* Optimize the Google Analytics snippet. - Optimize the Google Analytics snippet.
* Use Eric Meyer's recent CSS reset update and the HTML5 Doctor reset. - Use Eric Meyer's recent CSS reset update and the HTML5 Doctor reset.
* More robust `sub`/`sup` CSS styles. - More robust `sub`/`sup` CSS styles.
* Add keyboard `.focusable` helper class that extends `.visuallyhidden`. - Add keyboard `.focusable` helper class that extends `.visuallyhidden`.
* Print styles no longer print hash or JavaScript links. - Print styles no longer print hash or JavaScript links.
* Add a print reset for IE's proprietary filters. - Add a print reset for IE's proprietary filters.
* Remove IE9-specific conditional class on the `html` element. - Remove IE9-specific conditional class on the `html` element.
* Remove margins from lists within `nav` elements. - Remove margins from lists within `nav` elements.
* Remove YUI profiling. - Remove YUI profiling.

View File

@@ -2,19 +2,19 @@
## Getting started ## Getting started
* [Usage](usage.md) — Overview of the project contents. - [Usage](usage.md) — Overview of the project contents.
* [FAQ](faq.md) — Frequently asked questions along with their answers. - [FAQ](faq.md) — Frequently asked questions along with their answers.
## HTML5 Boilerplate core ## HTML5 Boilerplate core
* [HTML](html.md) — Guide to the default HTML. - [HTML](html.md) — Guide to the default HTML.
* [CSS](css.md) — Guide to the default CSS. - [CSS](css.md) — Guide to the default CSS.
* [JavaScript](js.md) — Guide to the default JavaScript. - [JavaScript](js.md) — Guide to the default JavaScript.
* [Everything else](misc.md). - [Everything else](misc.md).
## Development ## Development
* [Extending and customizing HTML5 Boilerplate](extend.md) — Going further with - [Extending and customizing HTML5 Boilerplate](extend.md) — Going further with
the boilerplate. the boilerplate.
## Related projects ## Related projects
@@ -23,15 +23,15 @@ The [H5BP organization](https://github.com/h5bp) maintains several projects that
complement HTML5 Boilerplate, projects that can help you improve different complement HTML5 Boilerplate, projects that can help you improve different
aspects of your website/web app (e.g.: the performance, security, etc.). aspects of your website/web app (e.g.: the performance, security, etc.).
* [Server Configs](https://github.com/h5bp/server-configs) — Fast and smart - [Server Configs](https://github.com/h5bp/server-configs) — Fast and smart
configurations for web servers such as Apache and Nginx. configurations for web servers such as Apache and Nginx.
* [Apache](https://github.com/h5bp/server-configs-apache) - [Apache](https://github.com/h5bp/server-configs-apache)
* [Google App Engine (GAE)](https://github.com/h5bp/server-configs-gae) - [Google App Engine (GAE)](https://github.com/h5bp/server-configs-gae)
* [Internet Information Services - [Internet Information Services
(IIS)](https://github.com/h5bp/server-configs-iis) (IIS)](https://github.com/h5bp/server-configs-iis)
* [lighttpd](https://github.com/h5bp/server-configs-lighttpd) - [lighttpd](https://github.com/h5bp/server-configs-lighttpd)
* [Nginx](https://github.com/h5bp/server-configs-nginx) - [Nginx](https://github.com/h5bp/server-configs-nginx)
* [Node.js](https://github.com/h5bp/server-configs-node) - [Node.js](https://github.com/h5bp/server-configs-node)
* [Front-end Developer Interview Questions](https://github.com/h5bp/Front-end-Developer-Interview-Questions) - [Front-end Developer Interview Questions](https://github.com/h5bp/Front-end-Developer-Interview-Questions)
* [create-html5-boilerplate](https://github.com/h5bp/create-html5-boilerplate) — Quick start HTML5 Boilerplate development. - [create-html5-boilerplate](https://github.com/h5bp/create-html5-boilerplate) — Quick start HTML5 Boilerplate development.
* [main.css](https://github.com/h5bp/main.css) — the main.css file included (as style.css) with HTML5 Boilerplate. - [main.css](https://github.com/h5bp/main.css) — the main.css file included (as style.css) with HTML5 Boilerplate.

View File

@@ -8,34 +8,34 @@ to be learned from the way we run the show here.
## GitHub configuration ## GitHub configuration
This section will go through the way we configure the repo in GitHub. This section will go through the way we configure the repo in GitHub.
Open source projects get the full power of the platform and as a project Open source projects get the full power of the platform and as a project
we like to experiment with new GitHub features. Our current configuration we like to experiment with new GitHub features. Our current configuration
might help you figure out some things you want to do in your own projects. might help you figure out some things you want to do in your own projects.
### General Configuration ### General Configuration
This section outlines the basic configuration options we use. This section outlines the basic configuration options we use.
* We have a stub of a Wiki still, so we have wikis turned on. The most - We have a stub of a Wiki still, so we have wikis turned on. The most
interesting page that remains is a history of the project written several interesting page that remains is a history of the project written several
years ago. years ago.
* We use the Issues feature heavily. We don't yet have Issue Templates set - We use the Issues feature heavily. We don't yet have Issue Templates set
up, but we do have adding them as an issue, so we'll take advantage of them up, but we do have adding them as an issue, so we'll take advantage of them
at some point. at some point.
* Discussions are enabled, but they haven't been very useful so far. - Discussions are enabled, but they haven't been very useful so far.
### Pull Requests ### Pull Requests
The most visible portion of our configuration is the way we handle pull The most visible portion of our configuration is the way we handle pull
requests. At the most basic level, we require pull requests to add code requests. At the most basic level, we require pull requests to add code
to the repo and require a review to merge code. In addition we run several to the repo and require a review to merge code. In addition we run several
code quality checks on every pull request to make sure we're not introducing code quality checks on every pull request to make sure we're not introducing
anything we don't want into the codebase. anything we don't want into the codebase.
We take advantage of the "draft" feature for PRs. This way we have visibility We take advantage of the "draft" feature for PRs. This way we have visibility
throughout the life of the PR. throughout the life of the PR.
Let's take a look at how we configure our `main` branch. Let's take a look at how we configure our `main` branch.
#### `main` #### `main`
@@ -45,73 +45,71 @@ configurations might require a long-running, similarly protected, `development`
branch but for us the single protected `main` branch is enough for our branch but for us the single protected `main` branch is enough for our
purposes. purposes.
Our branch protection rules are as follows: Our branch protection rules are as follows:
* We require a pull request (PR) with one approving reviewer to merge code - We require a pull request (PR) with one approving reviewer to merge code
* In addition to the PR and approving reviewer, we require three status checks - In addition to the PR and approving reviewer, we require three status checks
to pass before code can be merged to pass before code can be merged
* Build with Node 18 _ Build with Node 18
* Build with Node 16 _ Build with Node 16 \* LGTM analysis: JavaScript
* LGTM analysis: JavaScript - We _allow_ force pushes for project admins. While force pushes can create
* We *allow* force pushes for project admins. While force pushes can create some head scratching moments for people who have cloned the repo and update
some head scratching moments for people who have cloned the repo and update before and after the force push, the ability to clean up the `HEAD` of a
before and after the force push, the ability to clean up the `HEAD` of a public branch like this in an emergency is useful.
public branch like this in an emergency is useful.
#### GitHub Actions and Other Checks That Run on `main` #### GitHub Actions and Other Checks That Run on `main`
* We run a simple *build status* check. This is the most basic test you can run - We run a simple _build status_ check. This is the most basic test you can run
and is absolutely vital. If you can't build your project you're in trouble. and is absolutely vital. If you can't build your project you're in trouble.
Currently we're testing against Node 16 and 18. Currently we're testing against Node 16 and 18.
* We take advantage of our access to *CodeQL analysis* Free for research and - We take advantage of our access to _CodeQL analysis_ Free for research and
open source don't you know :) We don't have a ton of surface area to cover, open source don't you know :) We don't have a ton of surface area to cover,
but it's nice to have this powerful code scanning tool available to us. but it's nice to have this powerful code scanning tool available to us.
* We run a *dependency review* scan to see if any newly added dependencies add - We run a _dependency review_ scan to see if any newly added dependencies add
known security flaws. This is important for even us, but for a project that known security flaws. This is important for even us, but for a project that
uses a larger number of third party dependencies, this sort of check is vital. uses a larger number of third party dependencies, this sort of check is vital.
* Since we're fan of the "belt and suspenders" approach to security, we also - Since we're fan of the "belt and suspenders" approach to security, we also
run a *LGTM.com* scan as well as the CodeQL scans. This tool, built on top of run a _LGTM.com_ scan as well as the CodeQL scans. This tool, built on top of
CodeQl can shake out different issues so it's nice to have the pair. CodeQl can shake out different issues so it's nice to have the pair.
* We push any changes to `main` to our [HTML5\-Boilerplate Template Repo](https://github.com/h5bp/html5-boilerplate-template) - We push any changes to `main` to our [HTML5\-Boilerplate Template Repo](https://github.com/h5bp/html5-boilerplate-template)
Since we've talked about some of our Actions, let's look at the full configuration Since we've talked about some of our Actions, let's look at the full configuration
of our `.github` folder. of our `.github` folder.
### .github Folder ### .github Folder
* workflows - workflows
* `build-dist.yaml` is currently broken. We can't push to `main` without a - `build-dist.yaml` is currently broken. We can't push to `main` without a
code review, so this task is blocked. What I would like, (are you there, code review, so this task is blocked. What I would like, (are you there,
GitHub, it's me, Rob) is to allow Actions to bypass branch protection GitHub, it's me, Rob) is to allow Actions to bypass branch protection
rules. I think we'll have to basically write a mini-bot that opens a PR rules. I think we'll have to basically write a mini-bot that opens a PR
whenever there are changes to `main` and then pushes to the same branch whenever there are changes to `main` and then pushes to the same branch
until the PR is closed. In some ways that will be better as it will be less until the PR is closed. In some ways that will be better as it will be less
noisy in terms of bot pushes to main. noisy in terms of bot pushes to main.
* `codeql-analysis.yml` controls our CodeQL action. We use the defaults. If - `codeql-analysis.yml` controls our CodeQL action. We use the defaults. If
you're building something with more JAvaScript footprint, you can tweak you're building something with more JAvaScript footprint, you can tweak
the settings for this job. the settings for this job.
* `dependency-review.yml` does what it says on the tin- it tests newly - `dependency-review.yml` does what it says on the tin- it tests newly
introduced dependencies for vulnerabilities. introduced dependencies for vulnerabilities.
* `publish.yaml` is the action that publishes all the various versions of - `publish.yaml` is the action that publishes all the various versions of
the project. When we create a new tag and push it to GitHub, this script the project. When we create a new tag and push it to GitHub, this script
publishes our npm package and creates a GitHub release and attaches a zip publishes our npm package and creates a GitHub release and attaches a zip
file of our `dist` folder. file of our `dist` folder.
* `push-to-template.yaml` pushes the `HEAD` of `main` to our template repo - `push-to-template.yaml` pushes the `HEAD` of `main` to our template repo
* `spellcheck.yml` automatically checks markdown files for typos with cSpell. - `spellcheck.yml` automatically checks markdown files for typos with cSpell.
* `test.yaml` runs our test suite. - `test.yaml` runs our test suite.
* `CODE_OF_CONDUCT.md` is our Code of Conduct, based on - `CODE_OF_CONDUCT.md` is our Code of Conduct, based on
[Contributor Covenant.](https://www.contributor-covenant.org/) [Contributor Covenant.](https://www.contributor-covenant.org/)
* `CONTRIBUTING.md` contains our contribution guidelines. - `CONTRIBUTING.md` contains our contribution guidelines.
* `ISSUE_TEMPLATE.md` is our new issue boilerplate. - `ISSUE_TEMPLATE.md` is our new issue boilerplate.
* `PULL_REQUEST_TEMPLATE.md` is our new PR boilerplate. - `PULL_REQUEST_TEMPLATE.md` is our new PR boilerplate.
* `SUPPORT.md` points people to different (non-HTML5-Boilerplate) support - `SUPPORT.md` points people to different (non-HTML5-Boilerplate) support
resources resources
* `dependabot.yml` is our Dependabot configuration. We do `npm`, monthly on - `dependabot.yml` is our Dependabot configuration. We do `npm`, monthly on
two separate `package.json` files, one in `src` and one in project root. two separate `package.json` files, one in `src` and one in project root.
--- ---
That covers most of the interesting GitHub features and functionality that we That covers most of the interesting GitHub features and functionality that we
use. We're going to continue to keep this document up to date as we change use. We're going to continue to keep this document up to date as we change
things or new GitHub features. things or new GitHub features.

View File

@@ -5,8 +5,8 @@ table of contents](TOC.md)
HTML5 Boilerplate's CSS includes: HTML5 Boilerplate's CSS includes:
* [Normalize.css](#normalizecss) - [Normalize.css](#normalizecss)
* [style.css](#stylecss) - [style.css](#stylecss)
## Normalize.css ## Normalize.css
@@ -16,12 +16,12 @@ to CSS resets.
As opposed to CSS resets, Normalize.css: As opposed to CSS resets, Normalize.css:
* targets only the styles that need normalizing - targets only the styles that need normalizing
* preserves useful browser defaults rather than erasing them - preserves useful browser defaults rather than erasing them
* corrects bugs and common browser inconsistencies - corrects bugs and common browser inconsistencies
* improves usability with subtle improvements - improves usability with subtle improvements
* doesn't clutter the debugging tools - doesn't clutter the debugging tools
* has better documentation - has better documentation
For more information about Normalize.css, please refer to its [project For more information about Normalize.css, please refer to its [project
page](https://necolas.github.io/normalize.css/). page](https://necolas.github.io/normalize.css/).
@@ -30,12 +30,12 @@ page](https://necolas.github.io/normalize.css/).
Several base styles are included that build upon `Normalize.css`. These styles: Several base styles are included that build upon `Normalize.css`. These styles:
* provide basic typography settings that improve text readability - provide basic typography settings that improve text readability
* protect against unwanted `text-shadow` during text highlighting - protect against unwanted `text-shadow` during text highlighting
* tweak the default alignment of some elements (e.g.: `img`, `video`, - tweak the default alignment of some elements (e.g.: `img`, `video`,
`fieldset`, `textarea`) `fieldset`, `textarea`)
* style the prompt that is displayed to users using an outdated browser - style the prompt that is displayed to users using an outdated browser
* and more... - and more...
These styles are included in These styles are included in
[style.css](https://github.com/h5bp/html5-boilerplate/blob/main/dist/css/style.css) [style.css](https://github.com/h5bp/html5-boilerplate/blob/main/dist/css/style.css)

View File

@@ -7,17 +7,16 @@ Here is some useful advice for how you can make your project with HTML5
Boilerplate even better. We don't want to include it all by default, as not Boilerplate even better. We don't want to include it all by default, as not
everything fits with everyone's needs. everything fits with everyone's needs.
* [Server Configuration](#server-configuration) - [Server Configuration](#server-configuration)
* [App Stores](#app-stores) - [App Stores](#app-stores)
* [DNS prefetching](#dns-prefetching) - [DNS prefetching](#dns-prefetching)
* [Miscellaneous](#miscellaneous) - [Miscellaneous](#miscellaneous)
* [News Feeds](#news-feeds) - [News Feeds](#news-feeds)
* [Search](#search) - [Search](#search)
* [Social Networks](#social-networks) - [Social Networks](#social-networks)
* [URLs](#urls) - [URLs](#urls)
* [Web Apps](#web-apps) - [Web Apps](#web-apps)
* [security.txt](#security.txt) - [security.txt](#security.txt)
## Server Configuration ## Server Configuration
@@ -83,12 +82,10 @@ Charset](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#attr-cha
element (which should go right at the top of the `head`), so the browser can act element (which should go right at the top of the `head`), so the browser can act
on them ASAP. on them ASAP.
### Further reading about DNS prefetching ### Further reading about DNS prefetching
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-DNS-Prefetch-Control - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-DNS-Prefetch-Control
* https://dev.chromium.org/developers/design-documents/dns-prefetching - https://dev.chromium.org/developers/design-documents/dns-prefetching
## Search ## Search
@@ -97,11 +94,13 @@ on them ASAP.
After creating a [sitemap](https://www.sitemaps.org/protocol.html) After creating a [sitemap](https://www.sitemaps.org/protocol.html)
Submit it to search engine tool: Submit it to search engine tool:
* [Google](https://www.google.com/webmasters/tools/sitemap-list)
* [Bing](https://www.bing.com/toolbox/webmaster) - [Google](https://www.google.com/webmasters/tools/sitemap-list)
* [Yandex](https://webmaster.yandex.com/) - [Bing](https://www.bing.com/toolbox/webmaster)
* [Baidu](https://zhanzhang.baidu.com/) OR Insert the following line anywhere in - [Yandex](https://webmaster.yandex.com/)
- [Baidu](https://zhanzhang.baidu.com/) OR Insert the following line anywhere in
your robots.txt file, specifying the path to your sitemap: your robots.txt file, specifying the path to your sitemap:
``` ```
Sitemap: https://example.com/sitemap_location.xml Sitemap: https://example.com/sitemap_location.xml
``` ```
@@ -129,29 +128,27 @@ plugin](https://developer.mozilla.org/en-US/docs/Web/OpenSearch).
<link rel="search" title="" type="application/opensearchdescription+xml" href=""> <link rel="search" title="" type="application/opensearchdescription+xml" href="">
``` ```
## Miscellaneous ## Miscellaneous
* Use [Microformats](http://microformats.org/wiki/Main_Page) (via - Use [Microformats](http://microformats.org/wiki/Main_Page) (via
[microdata](http://microformats.org/wiki/microdata)) for optimum search [microdata](http://microformats.org/wiki/microdata)) for optimum search
results results
[visibility](https://webmasters.googleblog.com/2009/05/introducing-rich-snippets.html). [visibility](https://webmasters.googleblog.com/2009/05/introducing-rich-snippets.html).
* If you want to disable the translation prompt in Chrome or block Google - If you want to disable the translation prompt in Chrome or block Google
Translate from translating your web page, use [`<meta name="google" Translate from translating your web page, use [`<meta name="google"
content="notranslate">`](https://support.google.com/webmasters/answer/79812). content="notranslate">`](https://support.google.com/webmasters/answer/79812).
To disable translation for a particular section of the web page, add To disable translation for a particular section of the web page, add
[`class="notranslate"`](https://support.google.com/translate/?hl=en#2641276). [`class="notranslate"`](https://support.google.com/translate/?hl=en#2641276).
* If you want to disable the automatic detection and formatting of possible - If you want to disable the automatic detection and formatting of possible
phone numbers in Safari on iOS, use [`<meta name="format-detection" phone numbers in Safari on iOS, use [`<meta name="format-detection"
content="telephone=no">`](https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html). content="telephone=no">`](https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html).
* Avoid development/stage websites "leaking" into SERPs (search engine results - Avoid development/stage websites "leaking" into SERPs (search engine results
page) by [implementing X-Robots-tag page) by [implementing X-Robots-tag
headers](https://github.com/h5bp/html5-boilerplate/issues/804). headers](https://github.com/h5bp/html5-boilerplate/issues/804).
## News Feeds ## News Feeds
### RSS ### RSS
@@ -167,7 +164,7 @@ scratch](https://www.rssboard.org/rss-specification)?
Atom is similar to RSS, and you might prefer to use it instead of or in addition Atom is similar to RSS, and you might prefer to use it instead of or in addition
to it. [See what Atom's all to it. [See what Atom's all
about](https://en.wikipedia.org/wiki/Atom_(Web_standard)). about](<https://en.wikipedia.org/wiki/Atom_(Web_standard)>).
```html ```html
<link rel="alternate" type="application/atom+xml" title="Atom" href="/atom.xml"> <link rel="alternate" type="application/atom+xml" title="Atom" href="/atom.xml">
@@ -182,15 +179,13 @@ should contain the location of your pingback service.
<link rel="pingback" href=""> <link rel="pingback" href="">
``` ```
* High-level explanation: - High-level explanation:
https://codex.wordpress.org/Introduction_to_Blogging#Pingbacks https://codex.wordpress.org/Introduction_to_Blogging#Pingbacks
* Step-by-step example case: - Step-by-step example case:
https://www.hixie.ch/specs/pingback/pingback-1.0#TOC5 https://www.hixie.ch/specs/pingback/pingback-1.0#TOC5
* PHP pingback service: - PHP pingback service:
https://web.archive.org/web/20131211032834/http://blog.perplexedlabs.com/2009/07/15/xmlrpc-pingbacks-using-php/ https://web.archive.org/web/20131211032834/http://blog.perplexedlabs.com/2009/07/15/xmlrpc-pingbacks-using-php/
## Social Networks ## Social Networks
### Facebook Open Graph data ### Facebook Open Graph data
@@ -285,7 +280,7 @@ the cleaner, more accurate `https://www.example.com/cart.html`.
There are a couple of meta tags that provide information about a web app when There are a couple of meta tags that provide information about a web app when
added to the Home Screen on iOS: added to the Home Screen on iOS:
* Adding `apple-mobile-web-app-capable` will make your web app chrome-less and - Adding `apple-mobile-web-app-capable` will make your web app chrome-less and
provide the default iOS app view. You can control the color scheme of the provide the default iOS app view. You can control the color scheme of the
default view by adding `apple-mobile-web-app-status-bar-style`. default view by adding `apple-mobile-web-app-status-bar-style`.
@@ -294,7 +289,7 @@ added to the Home Screen on iOS:
<meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="apple-mobile-web-app-status-bar-style" content="black">
``` ```
* You can use `apple-mobile-web-app-title` to add a specific sites name for the - You can use `apple-mobile-web-app-title` to add a specific sites name for the
Home Screen icon. Home Screen icon.
```html ```html
@@ -305,7 +300,6 @@ For further information please read the [official
documentation](https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html) documentation](https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html)
on Apple's site. on Apple's site.
### Apple Touch Icons ### Apple Touch Icons
Apple touch icons are used as icons when a user adds your webapp to the home Apple touch icons are used as icons when a user adds your webapp to the home
@@ -322,7 +316,6 @@ Though the dimensions of the icon can vary between iOS devices and versions one
For a more comprehensive overview, please refer to Mathias' [article on Touch For a more comprehensive overview, please refer to Mathias' [article on Touch
Icons](https://mathiasbynens.be/notes/touch-icons). Icons](https://mathiasbynens.be/notes/touch-icons).
### Apple Touch Startup Image ### Apple Touch Startup Image
Apart from that it is possible to add start-up screens for web apps on iOS. This Apart from that it is possible to add start-up screens for web apps on iOS. This
@@ -335,7 +328,6 @@ for an iPhone:
<link rel="apple-touch-startup-image" media="(max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)" href="img/startup.png"> <link rel="apple-touch-startup-image" media="(max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)" href="img/startup.png">
``` ```
### Theme Color ### Theme Color
You can add the [`theme-color` meta You can add the [`theme-color` meta

View File

@@ -3,9 +3,9 @@ table of contents](TOC.md)
# Frequently asked questions # Frequently asked questions
* [Do I need to upgrade my site each time a new version of HTML5 Boilerplate is - [Do I need to upgrade my site each time a new version of HTML5 Boilerplate is
released?](#do-i-need-to-upgrade-my-site-each-time-a-new-version-of-html5-boilerplate-is-released) released?](#do-i-need-to-upgrade-my-site-each-time-a-new-version-of-html5-boilerplate-is-released)
* [Where can I get help with support - [Where can I get help with support
questions?](#where-can-i-get-help-with-support-questions) questions?](#where-can-i-get-help-with-support-questions)
## Do I need to upgrade my site each time a new version of HTML5 Boilerplate is released? ## Do I need to upgrade my site each time a new version of HTML5 Boilerplate is released?

View File

@@ -5,9 +5,9 @@ table of contents](TOC.md)
By default, HTML5 Boilerplate provides two `html` pages: By default, HTML5 Boilerplate provides two `html` pages:
* [`index.html`](#indexhtml) - a default HTML skeleton that should form the - [`index.html`](#indexhtml) - a default HTML skeleton that should form the
basis of all pages on your website basis of all pages on your website
* `404.html` - a placeholder 404 error page - `404.html` - a placeholder 404 error page
## `index.html` ## `index.html`
@@ -52,8 +52,7 @@ documentation has useful tips on creating an effective description.
### Mobile Viewport ### Mobile Viewport
There are a few different options that you can use with the There are a few different options that you can use with the
[`viewport` meta tag](https://docs.google.com/present/view?id=dkx3qtm_22dxsrgcf4 [`viewport` meta tag](https://docs.google.com/present/view?id=dkx3qtm_22dxsrgcf4 "Viewport and Media Queries - The Complete Idiot's Guide").
"Viewport and Media Queries - The Complete Idiot's Guide").
You can find out more in [ You can find out more in [
the MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Viewport_meta_tag). the MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Viewport_meta_tag).
HTML5 Boilerplate comes with a simple setup that strikes a good balance for general use cases. HTML5 Boilerplate comes with a simple setup that strikes a good balance for general use cases.
@@ -135,5 +134,3 @@ of these docs.
The central part of the boilerplate template is pretty much empty. This is The central part of the boilerplate template is pretty much empty. This is
intentional, in order to make the boilerplate suitable for both web page and web intentional, in order to make the boilerplate suitable for both web page and web
app development. app development.

View File

@@ -3,11 +3,11 @@ table of contents](TOC.md)
# Miscellaneous # Miscellaneous
* [.gitignore](#gitignore) - [.gitignore](#gitignore)
* [.editorconfig](#editorconfig) - [.editorconfig](#editorconfig)
* [Server Configuration](#server-configuration) - [Server Configuration](#server-configuration)
* [robots.txt](#robotstxt) - [robots.txt](#robotstxt)
* [package.json](#packagejson) - [package.json](#packagejson)
-- --
@@ -30,8 +30,8 @@ globally ignore:
excludesfile = ~/.gitignore excludesfile = ~/.gitignore
``` ```
* More on global ignores: [https://help.github.com/articles/ignoring-files/](https://help.github.com/en/github/using-git/ignoring-files) - More on global ignores: [https://help.github.com/articles/ignoring-files/](https://help.github.com/en/github/using-git/ignoring-files)
* Comprehensive set of ignores on GitHub: https://github.com/github/gitignore - Comprehensive set of ignores on GitHub: https://github.com/github/gitignore
## .editorconfig ## .editorconfig
@@ -47,9 +47,9 @@ them to better suit your needs.
In order for your editor/IDE to apply the In order for your editor/IDE to apply the
[properties](https://editorconfig.org/#supported-properties) from the [properties](https://editorconfig.org/#supported-properties) from the
`.editorconfig` file, you may need to [install a `.editorconfig` file, you may need to [install a
plugin]( https://editorconfig.org/#download). plugin](https://editorconfig.org/#download).
__N.B.__ If you aren't using the server configurations provided by HTML5 **N.B.** If you aren't using the server configurations provided by HTML5
Boilerplate, we highly encourage you to configure your server to block Boilerplate, we highly encourage you to configure your server to block
access to `.editorconfig` files, as they can disclose sensitive information! access to `.editorconfig` files, as they can disclose sensitive information!
@@ -63,8 +63,8 @@ be crawled from the website.
By default, the file provided by this project includes the next two lines: By default, the file provided by this project includes the next two lines:
* `User-agent: *` - the following rules apply to all web robots - `User-agent: *` - the following rules apply to all web robots
* `Disallow:` - everything on the website is allowed to be crawled - `Disallow:` - everything on the website is allowed to be crawled
If you want to disallow certain pages you will need to specify the path in a If you want to disallow certain pages you will need to specify the path in a
`Disallow` directive (e.g.: `Disallow: /path`) or, if you want to disallow `Disallow` directive (e.g.: `Disallow: /path`) or, if you want to disallow
@@ -79,8 +79,8 @@ you want to block access to private content, use proper authentication instead.
For more information about `robots.txt`, please see: For more information about `robots.txt`, please see:
* [robotstxt.org](https://www.robotstxt.org/) - [robotstxt.org](https://www.robotstxt.org/)
* [How Google handles the `robots.txt` file](https://developers.google.com/search/reference/robots_txt) - [How Google handles the `robots.txt` file](https://developers.google.com/search/reference/robots_txt)
## package.json ## package.json
@@ -88,27 +88,27 @@ For more information about `robots.txt`, please see:
use in modern JavaScript development. [The full documentation is available](https://docs.npmjs.com/files/package.json) use in modern JavaScript development. [The full documentation is available](https://docs.npmjs.com/files/package.json)
if you're interested. The fields we provide are as follows: if you're interested. The fields we provide are as follows:
* `title` - the title of your project. If you expect to publish your application - `title` - the title of your project. If you expect to publish your application
to npm, then the name needs to follow [certain guidelines](https://docs.npmjs.com/files/package.json#name) to npm, then the name needs to follow [certain guidelines](https://docs.npmjs.com/files/package.json#name)
and be unique. and be unique.
* `version` - indicates the version of your site application using semantic - `version` - indicates the version of your site application using semantic
versioning ([SemVer](https://semver.org/)) versioning ([SemVer](https://semver.org/))
* `description` - describes your site. - `description` - describes your site.
* `scripts` - is a JavaScript object containing commands that can be run in a - `scripts` - is a JavaScript object containing commands that can be run in a
node environment. There are many [built-in keys](https://docs.npmjs.com/misc/scripts) node environment. There are many [built-in keys](https://docs.npmjs.com/misc/scripts)
related to the package lifecycle that node understands automatically. You can related to the package lifecycle that node understands automatically. You can
also define custom scripts for use with your application development. We also define custom scripts for use with your application development. We
provide three custom scripts that work with webpack to get you up and running provide three custom scripts that work with webpack to get you up and running
quickly with a bundler for your assets and a simple development server. quickly with a bundler for your assets and a simple development server.
* `start` serves your `index.html` with a simple development server - `start` serves your `index.html` with a simple development server
* `keywords` - an array of keywords used to discover your app in the npm - `keywords` - an array of keywords used to discover your app in the npm
registry registry
* `author` - defines the author of a package. There is also an alternative - `author` - defines the author of a package. There is also an alternative
[contributors](https://docs.npmjs.com/files/package.json#people-fields-author-contributors) [contributors](https://docs.npmjs.com/files/package.json#people-fields-author-contributors)
field if there's more than one author. field if there's more than one author.
* `license` - the license for your application. Must conform to - `license` - the license for your application. Must conform to
[specific rules](https://docs.npmjs.com/files/package.json#license) [specific rules](https://docs.npmjs.com/files/package.json#license)
* `devDependencies` - development dependencies for your package. In our case - `devDependencies` - development dependencies for your package. In our case
we have several dependencies used by webpack, which we use as a simple development server. we have several dependencies used by webpack, which we use as a simple development server.

View File

@@ -110,29 +110,28 @@ refer to the [according documentation](extend.md#apple-touch-icons).
### Webpack ### Webpack
The project contains a simple [webpack](https://webpack.js.org/) configuration. The project contains a simple [webpack](https://webpack.js.org/) configuration.
To get started developing a site with a development server, run the following To get started developing a site with a development server, run the following
commands from within the `/dist/` folder in the project's repo or within the commands from within the `/dist/` folder in the project's repo or within the
root folder of the dowloaded project files, the folder created by `npm install` root folder of the dowloaded project files, the folder created by `npm install`
or the project folder created by running [create\-html5\-boilerplate](https://github.com/h5bp/create-html5-boilerplate) or the project folder created by running [create\-html5\-boilerplate](https://github.com/h5bp/create-html5-boilerplate)
``` ```
npm install npm install
npm run start npm run start
``` ```
This will start a Webpack development server with hot reloading of edited files. This will start a Webpack development server with hot reloading of edited files.
To package a site for production run To package a site for production run
``` ```
npm run build npm run build
``` ```
This command will bundle up the site's JavaScript and copy over static assets to This command will bundle up the site's JavaScript and copy over static assets to
the newly created `dist` folder. the newly created `dist` folder.
There are three files: There are three files:
@@ -146,22 +145,22 @@ This development configuration defines the behavior of development server.
#### webpack.config.prod.js #### webpack.config.prod.js
This production configuration defines the behavior of the production build. This production configuration defines the behavior of the production build.
It copies the following files and folders to the dist folder: It copies the following files and folders to the dist folder:
* css - css
* img - img
* js/vendor - js/vendor
* 404.html - 404.html
* favicon.ico - favicon.ico
* icon.png - icon.png
* icon.svg - icon.svg
* index.html - index.html
* robots.txt - robots.txt
* site.webmanifest - site.webmanifest
* tile.png - tile.png
* tile-wide.png - tile-wide.png
`js/vendor` is copied over in order to allow you to use unprocessed JS files `js/vendor` is copied over in order to allow you to use unprocessed JS files
in addition to the files bundled based on the project's entry point `app.js.` in addition to the files bundled based on the project's entry point `app.js.`

View File

@@ -7,7 +7,7 @@ import gulpHeader from 'gulp-header';
import gulpRename from 'gulp-rename'; import gulpRename from 'gulp-rename';
import gulpReplace from 'gulp-replace'; import gulpReplace from 'gulp-replace';
import archiver from 'archiver'; import archiver from 'archiver';
import { globSync } from 'glob' import { globSync } from 'glob';
import { deleteSync } from 'del'; import { deleteSync } from 'del';
import { createRequire } from 'module'; import { createRequire } from 'module';
const require = createRequire(import.meta.url); const require = createRequire(import.meta.url);
@@ -25,17 +25,20 @@ gulp.task('archive:create_archive_dir', (done) => {
}); });
gulp.task('archive:zip', (done) => { gulp.task('archive:zip', (done) => {
const archiveName = path.resolve(dirs.archive, `${pkg.name}_v${pkg.version}.zip`); const archiveName = path.resolve(
dirs.archive,
`${pkg.name}_v${pkg.version}.zip`,
);
const zip = archiver('zip'); const zip = archiver('zip');
const files = globSync('**/*.*', { const files = globSync('**/*.*', {
'cwd': dirs.dist, cwd: dirs.dist,
'ignore': [ ignore: [
'**/node_modules/**', '**/node_modules/**',
'package-lock.json', 'package-lock.json',
'**/dist/**', '**/dist/**',
'**/.cache/**', '**/.cache/**',
], ],
'dot': true // include hidden files dot: true, // include hidden files
}); });
const output = fs.createWriteStream(archiveName); const output = fs.createWriteStream(archiveName);
@@ -52,8 +55,8 @@ gulp.task('archive:zip', (done) => {
// `zip.bulk` does not maintain the file // `zip.bulk` does not maintain the file
// permissions, so we need to add files individually // permissions, so we need to add files individually
zip.append(fs.createReadStream(filePath), { zip.append(fs.createReadStream(filePath), {
'name': file, name: file,
'mode': fs.statSync(filePath).mode mode: fs.statSync(filePath).mode,
}); });
}); });
@@ -63,61 +66,62 @@ gulp.task('archive:zip', (done) => {
}); });
gulp.task('clean', (done) => { gulp.task('clean', (done) => {
deleteSync([ deleteSync([dirs.archive, dirs.dist]);
dirs.archive,
dirs.dist
]);
done(); done();
}); });
gulp.task('copy:index.html', () => { gulp.task('copy:index.html', () => {
return gulp.src(`${dirs.src}/index.html`).pipe(gulp.dest(dirs.dist));
return gulp.src(`${dirs.src}/index.html`)
.pipe(gulp.dest(dirs.dist));
}); });
gulp.task('copy:license', () => gulp.task('copy:license', () =>
gulp.src('LICENSE.txt') gulp.src('LICENSE.txt').pipe(gulp.dest(dirs.dist)),
.pipe(gulp.dest(dirs.dist))
); );
gulp.task('copy:style', () => { gulp.task('copy:style', () => {
const banner = `/*! HTML5 Boilerplate v${pkg.version} | ${pkg.license} License | ${pkg.homepage} */\n\n`; const banner = `/*! HTML5 Boilerplate v${pkg.version} | ${pkg.license} License | ${pkg.homepage} */\n\n`;
return gulp.src('node_modules/main.css/dist/main.css') return gulp
.src('node_modules/main.css/dist/main.css')
.pipe(gulpHeader(banner)) .pipe(gulpHeader(banner))
.pipe(gulpAutoPrefixer({ .pipe(
cascade: false gulpAutoPrefixer({
})) cascade: false,
.pipe(gulpRename({ }),
basename: 'style' )
})) .pipe(
gulpRename({
basename: 'style',
}),
)
.pipe(gulp.dest(`${dirs.dist}/css`)); .pipe(gulp.dest(`${dirs.dist}/css`));
}); });
gulp.task('copy:misc', () => gulp.task('copy:misc', () =>
gulp.src([ gulp
// Copy all files .src(
`${dirs.src}/**/*`, [
// Copy all files
`${dirs.src}/**/*`,
// Exclude the following files // Exclude the following files
// (other tasks will handle the copying of these files) // (other tasks will handle the copying of these files)
`!${dirs.src}/css/main.css`, `!${dirs.src}/css/main.css`,
`!${dirs.src}/index.html` `!${dirs.src}/index.html`,
], { ],
// Include hidden files by default {
dot: true // Include hidden files by default
}).pipe(gulp.dest(dirs.dist)) dot: true,
},
)
.pipe(gulp.dest(dirs.dist)),
); );
gulp.task('lint:js', () => gulp.task('lint:js', () =>
gulp.src([ gulp
`${dirs.src}/js/*.js`, .src([`${dirs.src}/js/*.js`, `${dirs.src}/*.js`, `${dirs.test}/*.mjs`])
`${dirs.src}/*.js`, .pipe(gulpEslint())
`${dirs.test}/*.mjs` .pipe(gulpEslint.failOnError()),
]).pipe(gulpEslint())
.pipe(gulpEslint.failOnError())
); );
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
@@ -125,29 +129,14 @@ gulp.task('lint:js', () =>
// --------------------------------------------------------------------- // ---------------------------------------------------------------------
gulp.task( gulp.task(
'copy', 'copy',
gulp.series( gulp.series('copy:index.html', 'copy:license', 'copy:style', 'copy:misc'),
'copy:index.html',
'copy:license',
'copy:style',
'copy:misc'
)
); );
gulp.task( gulp.task('build', gulp.series(gulp.parallel('clean', 'lint:js'), 'copy'));
'build',
gulp.series(
gulp.parallel('clean', 'lint:js'),
'copy'
)
);
gulp.task( gulp.task(
'archive', 'archive',
gulp.series( gulp.series('build', 'archive:create_archive_dir', 'archive:zip'),
'build',
'archive:create_archive_dir',
'archive:zip'
)
); );
gulp.task('default', gulp.series('build')); gulp.task('default', gulp.series('build'));

16
package-lock.json generated
View File

@@ -23,6 +23,7 @@
"gulp-replace": "^1.1.4", "gulp-replace": "^1.1.4",
"main.css": "3.0.0", "main.css": "3.0.0",
"mocha": "^10.2.0", "mocha": "^10.2.0",
"prettier": "3.0.3",
"strip-json-comments": "^5.0.1" "strip-json-comments": "^5.0.1"
}, },
"engines": { "engines": {
@@ -9091,6 +9092,21 @@
"node": ">= 0.8.0" "node": ">= 0.8.0"
} }
}, },
"node_modules/prettier": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz",
"integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==",
"dev": true,
"bin": {
"prettier": "bin/prettier.cjs"
},
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
}
},
"node_modules/pretty-hrtime": { "node_modules/pretty-hrtime": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz",

View File

@@ -18,6 +18,7 @@
}, },
"scripts": { "scripts": {
"build": "gulp build", "build": "gulp build",
"prettier": "prettier --write ./**/*.{js,json,md,mjs,yml}",
"test": "gulp archive && mocha --reporter spec --timeout 5000" "test": "gulp archive && mocha --reporter spec --timeout 5000"
}, },
"devDependencies": { "devDependencies": {
@@ -35,6 +36,7 @@
"gulp-replace": "^1.1.4", "gulp-replace": "^1.1.4",
"main.css": "3.0.0", "main.css": "3.0.0",
"mocha": "^10.2.0", "mocha": "^10.2.0",
"prettier": "3.0.3",
"strip-json-comments": "^5.0.1" "strip-json-comments": "^5.0.1"
}, },
"engines": { "engines": {

View File

@@ -3,10 +3,10 @@ const path = require('path');
module.exports = { module.exports = {
entry: { entry: {
app: './js/app.js', app: './js/app.js',
}, },
output: { output: {
path: path.resolve(__dirname, 'dist'), path: path.resolve(__dirname, 'dist'),
clean: true, clean: true,
filename: './js/app.js', filename: './js/app.js',
}, },
}; };

View File

@@ -1,7 +1,6 @@
const { merge } = require('webpack-merge'); const { merge } = require('webpack-merge');
const common = require('./webpack.common.js'); const common = require('./webpack.common.js');
module.exports = merge(common, { module.exports = merge(common, {
mode: 'development', mode: 'development',
devtool: 'inline-source-map', devtool: 'inline-source-map',
@@ -12,5 +11,3 @@ module.exports = merge(common, {
static: ['./'], static: ['./'],
}, },
}); });

View File

@@ -1,28 +1,28 @@
const { merge } = require('webpack-merge'); const { merge } = require('webpack-merge');
const common = require('./webpack.common.js'); const common = require('./webpack.common.js');
const HtmlWebpackPlugin = require('html-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyPlugin = require('copy-webpack-plugin'); const CopyPlugin = require('copy-webpack-plugin');
module.exports = merge(common, { module.exports = merge(common, {
mode: 'production', mode: 'production',
plugins: [ plugins: [
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
template: './index.html' template: './index.html',
}), }),
new CopyPlugin({ new CopyPlugin({
patterns: [ patterns: [
{ from: 'img', to: 'img' }, { from: 'img', to: 'img' },
{ from: 'css', to: 'css' }, { from: 'css', to: 'css' },
{ from: 'js/vendor', to: 'js/vendor' }, { from: 'js/vendor', to: 'js/vendor' },
{ from: 'icon.svg', to: 'icon.svg'}, { from: 'icon.svg', to: 'icon.svg' },
{ from: 'favicon.ico', to: 'favicon.ico'}, { from: 'favicon.ico', to: 'favicon.ico' },
{ from: 'tile-wide.png', to: 'tile-wide.png'}, { from: 'tile-wide.png', to: 'tile-wide.png' },
{ from: 'robots.txt', to: 'robots.txt'}, { from: 'robots.txt', to: 'robots.txt' },
{ from: 'icon.png', to: 'icon.png'}, { from: 'icon.png', to: 'icon.png' },
{ from: '404.html', to: '404.html'}, { from: '404.html', to: '404.html' },
{ from: 'site.webmanifest', to: 'site.webmanifest'}, { from: 'site.webmanifest', to: 'site.webmanifest' },
{ from: 'tile.png', to: 'tile.png'} { from: 'tile.png', to: 'tile.png' },
], ],
}) }),
], ],
}); });

View File

@@ -9,21 +9,17 @@ const dirs = pkg['h5bp-configs'].directories;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function checkString(file, string, done) { function checkString(file, string, done) {
let character = ''; let character = '';
let matchFound = false; let matchFound = false;
let matchedPositions = 0; let matchedPositions = 0;
const readStream = fs.createReadStream(file, {'encoding': 'utf8'}); const readStream = fs.createReadStream(file, { encoding: 'utf8' });
readStream.on('close', done); readStream.on('close', done);
readStream.on('error', done); readStream.on('error', done);
readStream.on('readable', function () { readStream.on('readable', function () {
// Read file until the string is found // Read file until the string is found
// or the whole file has been read // or the whole file has been read
while (matchFound !== true && while (matchFound !== true && (character = readStream.read(1)) !== null) {
(character = readStream.read(1)) !== null) {
if (character === string.charAt(matchedPositions)) { if (character === string.charAt(matchedPositions)) {
matchedPositions += 1; matchedPositions += 1;
} else { } else {
@@ -33,31 +29,24 @@ function checkString(file, string, done) {
if (matchedPositions === string.length) { if (matchedPositions === string.length) {
matchFound = true; matchFound = true;
} }
} }
assert.equal(true, matchFound); assert.equal(true, matchFound);
this.close(); this.close();
}); });
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function runTests() { function runTests() {
const dir = dirs.dist; const dir = dirs.dist;
describe(`Test if the files from the "${dir}" directory have the expected content`, () => { describe(`Test if the files from the "${dir}" directory have the expected content`, () => {
it('"style.css" should contain a custom banner', function (done) { it('"style.css" should contain a custom banner', function (done) {
const string = `/*! HTML5 Boilerplate v${pkg.version} | ${pkg.license} License | ${pkg.homepage} */\n`; const string = `/*! HTML5 Boilerplate v${pkg.version} | ${pkg.license} License | ${pkg.homepage} */\n`;
checkString(path.resolve(dir, 'css/style.css'), string, done); checkString(path.resolve(dir, 'css/style.css'), string, done);
}); });
}); });
} }
runTests(); runTests();

View File

@@ -7,12 +7,9 @@ const require = createRequire(import.meta.url);
const pkg = require('../package.json'); const pkg = require('../package.json');
const dirs = pkg['h5bp-configs'].directories; const dirs = pkg['h5bp-configs'].directories;
const expectedFilesInArchiveDir = [ const expectedFilesInArchiveDir = [`${pkg.name}_v${pkg.version}.zip`];
`${pkg.name}_v${pkg.version}.zip`
];
const expectedFilesInDistDir = [ const expectedFilesInDistDir = [
'.editorconfig', '.editorconfig',
'.gitattributes', '.gitattributes',
'.gitignore', '.gitignore',
@@ -22,7 +19,7 @@ const expectedFilesInDistDir = [
'webpack.common.js', 'webpack.common.js',
'webpack.config.dev.js', 'webpack.config.dev.js',
'webpack.config.prod.js', 'webpack.config.prod.js',
'css/', // for directories, a `/` character 'css/', // for directories, a `/` character
// should be included at the end // should be included at the end
'css/style.css', 'css/style.css',
@@ -45,37 +42,34 @@ const expectedFilesInDistDir = [
'robots.txt', 'robots.txt',
'site.webmanifest', 'site.webmanifest',
'tile-wide.png', 'tile-wide.png',
'tile.png' 'tile.png',
]; ];
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function checkFiles(directory, expectedFiles) { function checkFiles(directory, expectedFiles) {
// Get the list of files from the specified directory // Get the list of files from the specified directory
const files = globSync('**/*', { const files = globSync('**/*', {
'cwd': directory, cwd: directory,
'ignore': [ ignore: [
'**/node_modules/**', '**/node_modules/**',
'package-lock.json', 'package-lock.json',
'**/dist/**', '**/dist/**',
'**/.cache/**', '**/.cache/**',
], ],
'dot': true, // include hidden files dot: true, // include hidden files
'mark': true // add a `/` character to directory matches mark: true, // add a `/` character to directory matches
}); });
// Check if all expected files are present in the // Check if all expected files are present in the
// specified directory, and are of the expected type // specified directory, and are of the expected type
expectedFiles.forEach((file) => { expectedFiles.forEach((file) => {
let ok = false; let ok = false;
const expectedFileType = (file.slice(-1) !== '/' ? 'regular file' : 'directory'); const expectedFileType =
file.slice(-1) !== '/' ? 'regular file' : 'directory';
// If file exists // If file exists
if (files.indexOf(file) !== -1) { if (files.indexOf(file) !== -1) {
// Check if the file is of the correct type // Check if the file is of the correct type
if (file.slice(-1) !== '/') { if (file.slice(-1) !== '/') {
// Check if the file is really a regular file // Check if the file is really a regular file
@@ -84,35 +78,32 @@ function checkFiles(directory, expectedFiles) {
// Check if the file is a directory // Check if the file is a directory
// (Since glob adds the `/` character to directory matches, // (Since glob adds the `/` character to directory matches,
// we can simply check if the `/` character is present) // we can simply check if the `/` character is present)
ok = (files[files.indexOf(file)].slice(-1) === '/'); ok = files[files.indexOf(file)].slice(-1) === '/';
} }
} }
it(`"${file}" should be present and it should be a ${expectedFileType}`, () =>{ it(`"${file}" should be present and it should be a ${expectedFileType}`, () => {
assert.equal(true, ok); assert.equal(true, ok);
}); });
}); });
// List all files that should be NOT // List all files that should be NOT
// be present in the specified directory // be present in the specified directory
(files.filter((file) => { files
return expectedFiles.indexOf(file) === -1; .filter((file) => {
})).forEach((file) => { return expectedFiles.indexOf(file) === -1;
it(`"${file}" should NOT be present`, () => { })
assert(false); .forEach((file) => {
it(`"${file}" should NOT be present`, () => {
assert(false);
});
}); });
});
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function runTests() { function runTests() {
describe('Test if all the expected files, and only them, are present in the build directories', () => { describe('Test if all the expected files, and only them, are present in the build directories', () => {
describe(dirs.archive, () => { describe(dirs.archive, () => {
checkFiles(dirs.archive, expectedFilesInArchiveDir); checkFiles(dirs.archive, expectedFilesInArchiveDir);
}); });
@@ -120,9 +111,7 @@ function runTests() {
describe(dirs.dist, () => { describe(dirs.dist, () => {
checkFiles(dirs.dist, expectedFilesInDistDir); checkFiles(dirs.dist, expectedFilesInDistDir);
}); });
}); });
} }
runTests(); runTests();