mirror of
https://github.com/h5bp/html5-boilerplate.git
synced 2026-01-13 00:28:10 -05:00
Compare commits
115 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5dfd2c3110 | ||
|
|
01b5cd0792 | ||
|
|
e060848f71 | ||
|
|
f9bfe5b8e0 | ||
|
|
14f8653428 | ||
|
|
1898b5ea50 | ||
|
|
f19c89a0c0 | ||
|
|
96bfe286fa | ||
|
|
e069405fb5 | ||
|
|
4305529ecc | ||
|
|
bdcf054082 | ||
|
|
70e24fa6a3 | ||
|
|
5662eafeb9 | ||
|
|
ef92d2fa3f | ||
|
|
743b6a3f2a | ||
|
|
1d4a17b16e | ||
|
|
21054e29bb | ||
|
|
eca1f4e1c8 | ||
|
|
530209e3f7 | ||
|
|
a207e3f327 | ||
|
|
bddb444b0e | ||
|
|
7f5741a205 | ||
|
|
1d802261b7 | ||
|
|
ec414cd2fc | ||
|
|
007914d75b | ||
|
|
19833a7a93 | ||
|
|
5f4039d7ec | ||
|
|
a48497df9e | ||
|
|
4a8d981273 | ||
|
|
fa9a016eef | ||
|
|
af9ef8a91d | ||
|
|
aaae9f9992 | ||
|
|
06f0561a0d | ||
|
|
84ae9cc911 | ||
|
|
aa23e9aa08 | ||
|
|
190b2d31f5 | ||
|
|
97c6616367 | ||
|
|
7d88f3551b | ||
|
|
195ef9fc3e | ||
|
|
231e047d27 | ||
|
|
6862fd310d | ||
|
|
87acc19836 | ||
|
|
7e102a6ff0 | ||
|
|
1d2b155cc5 | ||
|
|
805d619a0d | ||
|
|
e006c01033 | ||
|
|
274bab1cf4 | ||
|
|
177a9f3bd6 | ||
|
|
15aa62d2d1 | ||
|
|
af86a9033b | ||
|
|
b1ead4be75 | ||
|
|
23c4112db0 | ||
|
|
137141307b | ||
|
|
5fc11a7f2d | ||
|
|
a95d264c0f | ||
|
|
0b1bca02cc | ||
|
|
f565fbe57b | ||
|
|
f50e7a97e5 | ||
|
|
ffd36de013 | ||
|
|
65dd1529ca | ||
|
|
63afbe79aa | ||
|
|
5ee99abc34 | ||
|
|
3d8ba581b3 | ||
|
|
36c8988392 | ||
|
|
a3e7302c47 | ||
|
|
e1c4afe46a | ||
|
|
106a575359 | ||
|
|
d403a0d6d9 | ||
|
|
04e14e29e5 | ||
|
|
95e3bd5928 | ||
|
|
c6872a598e | ||
|
|
f4409d6845 | ||
|
|
7bc43bd391 | ||
|
|
e7ae4b371c | ||
|
|
fb3b47212d | ||
|
|
2b2bb45391 | ||
|
|
551f0675c5 | ||
|
|
f4cc1f2c52 | ||
|
|
ff475a0bcb | ||
|
|
e3949f38dd | ||
|
|
2aa0d1e4ff | ||
|
|
603b8c733c | ||
|
|
0d7d807322 | ||
|
|
00e40b8d4e | ||
|
|
859f2759c7 | ||
|
|
666c6fd992 | ||
|
|
c79799382f | ||
|
|
f1dd1c55ee | ||
|
|
04a90d7918 | ||
|
|
1cdbbd1cac | ||
|
|
a2edf757ca | ||
|
|
3d055ba802 | ||
|
|
cf06e83c34 | ||
|
|
1335de667b | ||
|
|
d2abd41f4c | ||
|
|
8bf8ef7f10 | ||
|
|
6aad78be96 | ||
|
|
e7790563e7 | ||
|
|
60beb6f1ea | ||
|
|
f5aa308399 | ||
|
|
ceb4620c78 | ||
|
|
b1afbb7736 | ||
|
|
d1fe0cae18 | ||
|
|
4c9a2757ce | ||
|
|
978b1e3599 | ||
|
|
2d1a17aa53 | ||
|
|
ef39fca315 | ||
|
|
87e2c1762d | ||
|
|
fd5466914b | ||
|
|
0fe68e9ef0 | ||
|
|
abe20877fd | ||
|
|
cec65d5b04 | ||
|
|
d809a3118a | ||
|
|
5f00e40672 | ||
|
|
6d925f6bbd |
@@ -14,9 +14,3 @@ trim_trailing_whitespace = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[{.travis.yml,package.json}]
|
||||
# The indent size used in the `package.json` file cannot be changed
|
||||
# https://github.com/npm/npm/pull/3180#issuecomment-16336516
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
|
||||
39
.eslintrc.js
39
.eslintrc.js
@@ -1,26 +1,17 @@
|
||||
module.exports = {
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es6": true,
|
||||
"mocha": true
|
||||
},
|
||||
"plugins": ["mocha"],
|
||||
"extends": "eslint:recommended",
|
||||
"parserOptions": {
|
||||
"sourceType": "module"
|
||||
},
|
||||
"rules": {
|
||||
"indent": [
|
||||
"error",
|
||||
2
|
||||
],
|
||||
"quotes": [
|
||||
"error",
|
||||
"single"
|
||||
],
|
||||
"semi": [
|
||||
"error",
|
||||
"always"
|
||||
]
|
||||
}
|
||||
env: {
|
||||
browser: true,
|
||||
es6: true,
|
||||
mocha: true
|
||||
},
|
||||
plugins: ["mocha"],
|
||||
extends: "eslint:recommended",
|
||||
parserOptions: {
|
||||
sourceType: "module"
|
||||
},
|
||||
rules: {
|
||||
indent: ["error", 2],
|
||||
quotes: ["error", "single"],
|
||||
semi: ["error", "always"]
|
||||
}
|
||||
};
|
||||
|
||||
2
.github/CONTRIBUTING.md
vendored
2
.github/CONTRIBUTING.md
vendored
@@ -1,7 +1,7 @@
|
||||
# Contributing to HTML5 Boilerplate
|
||||
|
||||
♥ [HTML5 Boilerplate](https://html5boilerplate.com/) and want to get involved?
|
||||
Thanks! We're actively looking for folks interested in helping out and there
|
||||
Thanks! We're actively looking for folks interested in helping out and there
|
||||
are plenty of ways you can help!
|
||||
|
||||
Please take a moment to review this document in order to make the contribution
|
||||
|
||||
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -14,6 +14,6 @@
|
||||
- [ ] I have added tests to cover my changes.
|
||||
- [ ] All new and existing tests passed.
|
||||
|
||||
Pull requests should be thought of as a conversation. There will be some back and forth when trying to get code merged into this or any other project. With all but the simplest changes you can and should expect that the maintainers of the project will request changes to your code. Please be aware of that and check in after you open your PR in order to get your code merged in cleanly.
|
||||
Pull requests should be thought of as a conversation. There will be some back and forth when trying to get code merged into this or any other project. With all but the simplest changes you can and should expect that the maintainers of the project will request changes to your code. Please be aware of that and check in after you open your PR in order to get your code merged in cleanly.
|
||||
|
||||
Thanks!
|
||||
|
||||
2
.github/SUPPORT.md
vendored
2
.github/SUPPORT.md
vendored
@@ -2,7 +2,7 @@
|
||||
|
||||
For personal support requests with HTML5 Boilerplate please use Stack Overflow
|
||||
([`html5boilerplate`](https://stackoverflow.com/questions/tagged/html5boilerplate) tag).
|
||||
|
||||
|
||||
Please check the respective repository/website for support regarding the code in
|
||||
[`.htaccess`](https://github.com/h5bp/server-configs-apache),
|
||||
[`jQuery`](https://jquery.org/support/),
|
||||
|
||||
49
.github/workflows/publish.yaml
vendored
Normal file
49
.github/workflows/publish.yaml
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
name: publish
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Upload Release Asset
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
- name: Get tag
|
||||
id: get_version
|
||||
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
|
||||
- name: Create Zip Folder
|
||||
working-directory: dist
|
||||
run: zip -r ../html5-boilerplate_${{ steps.get_version.outputs.VERSION }}.zip ./
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ github.ref }}
|
||||
release_name: Release ${{ github.ref }}
|
||||
draft: false
|
||||
prerelease: false
|
||||
- name: Upload Release Asset
|
||||
id: upload-release-asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./html5-boilerplate_${{ steps.get_version.outputs.VERSION }}.zip
|
||||
asset_name: html5-boilerplate_${{ steps.get_version.outputs.VERSION }}.zip
|
||||
asset_content_type: application/zip
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12
|
||||
registry-url: https://registry.npmjs.org/
|
||||
- name: publish npm
|
||||
run: npm publish
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,2 @@
|
||||
archive
|
||||
node_modules
|
||||
package-lock.json
|
||||
|
||||
68
.jscsrc
68
.jscsrc
@@ -1,68 +0,0 @@
|
||||
{
|
||||
"disallowEmptyBlocks": true,
|
||||
"disallowKeywords": [
|
||||
"with"
|
||||
],
|
||||
"disallowMixedSpacesAndTabs": true,
|
||||
"disallowMultipleLineStrings": true,
|
||||
"disallowMultipleVarDecl": true,
|
||||
"disallowSpaceAfterPrefixUnaryOperators": [
|
||||
"!",
|
||||
"+",
|
||||
"++",
|
||||
"-",
|
||||
"--",
|
||||
"~"
|
||||
],
|
||||
"disallowSpaceBeforeBinaryOperators": [
|
||||
","
|
||||
],
|
||||
"disallowSpaceBeforePostfixUnaryOperators": true,
|
||||
"disallowSpacesInNamedFunctionExpression": {
|
||||
"beforeOpeningRoundBrace": true
|
||||
},
|
||||
"disallowSpacesInsideArrayBrackets": true,
|
||||
"disallowSpacesInsideParentheses": true,
|
||||
"disallowTrailingComma": true,
|
||||
"disallowTrailingWhitespace": true,
|
||||
"requireCamelCaseOrUpperCaseIdentifiers": true,
|
||||
"requireCapitalizedConstructors": true,
|
||||
"requireCommaBeforeLineBreak": true,
|
||||
"requireCurlyBraces": true,
|
||||
"requireDotNotation": true,
|
||||
"requireLineFeedAtFileEnd": true,
|
||||
"requireParenthesesAroundIIFE": true,
|
||||
"requireSpaceAfterBinaryOperators": true,
|
||||
"requireSpaceAfterKeywords": [
|
||||
"catch",
|
||||
"do",
|
||||
"else",
|
||||
"for",
|
||||
"if",
|
||||
"return",
|
||||
"switch",
|
||||
"try",
|
||||
"while"
|
||||
],
|
||||
"requireSpaceAfterLineComment": true,
|
||||
"requireSpaceBeforeBinaryOperators": true,
|
||||
"requireSpaceBeforeBlockStatements": true,
|
||||
"requireSpacesInAnonymousFunctionExpression": {
|
||||
"beforeOpeningCurlyBrace": true
|
||||
},
|
||||
"requireSpacesInConditionalExpression": true,
|
||||
"requireSpacesInFunctionDeclaration": {
|
||||
"beforeOpeningCurlyBrace": true
|
||||
},
|
||||
"requireSpacesInFunctionExpression": {
|
||||
"beforeOpeningCurlyBrace": true
|
||||
},
|
||||
"requireSpacesInNamedFunctionExpression": {
|
||||
"beforeOpeningCurlyBrace": true
|
||||
},
|
||||
"requireSpacesInsideObjectBrackets": "allButNested",
|
||||
"validateIndentation": 4,
|
||||
"validateLineBreaks": "LF",
|
||||
"validateParameterSeparator": ", ",
|
||||
"validateQuoteMarks": "'"
|
||||
}
|
||||
@@ -8,9 +8,7 @@ git:
|
||||
language: node_js
|
||||
|
||||
node_js:
|
||||
- 6
|
||||
- 8
|
||||
- 9
|
||||
- 10
|
||||
|
||||
dist: trusty
|
||||
sudo: false
|
||||
|
||||
96
CHANGELOG.md
96
CHANGELOG.md
@@ -1,4 +1,28 @@
|
||||
### 7.2.0 (June 4, 2019)
|
||||
# Changelog
|
||||
|
||||
## 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 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))
|
||||
* 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))
|
||||
* 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))
|
||||
* 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))
|
||||
|
||||
## 7.3.0 (November 19, 2019)
|
||||
|
||||
* 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 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))
|
||||
* 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))
|
||||
* 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)
|
||||
|
||||
* 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))
|
||||
@@ -6,7 +30,7 @@
|
||||
* 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))
|
||||
|
||||
### 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 Analytics docs and snippet ([#2118](https://github.com/h5bp/html5-boilerplate/pull/2118))
|
||||
@@ -14,11 +38,11 @@
|
||||
* 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))
|
||||
|
||||
### 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))
|
||||
|
||||
### 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))
|
||||
* Move the CSS to a separate repo ([#2066](https://github.com/h5bp/html5-boilerplate/pull/2066))
|
||||
@@ -31,35 +55,33 @@
|
||||
* 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))
|
||||
|
||||
### 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)
|
||||
* 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 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))
|
||||
* 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))
|
||||
* 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))
|
||||
* 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))
|
||||
|
||||
|
||||
### 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))
|
||||
* 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))
|
||||
* 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))
|
||||
* 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))
|
||||
* 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))
|
||||
* Modernizr 3, modernizr.config and ([#1940](https://github.com/h5bp/html5-boilerplate/pull/1940))
|
||||
* Housekeeping by @coliff (#1968 #1969 #1965 #1964 #1958 #1957 #1956)
|
||||
* Update .gitattributes for Web Projects ([#1935](https://github.com/h5bp/html5-boilerplate/pull/1935))
|
||||
@@ -86,17 +108,17 @@
|
||||
([#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)).
|
||||
|
||||
### 5.3.0 (January 12, 2016)
|
||||
## 5.3.0 (January 12, 2016)
|
||||
|
||||
* Update jQuery to `v1.12.0`.
|
||||
* Fetch `jQuery` from jQuery's CDN instead of Google's
|
||||
([#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`
|
||||
pseudo-elements
|
||||
([#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`
|
||||
([#1699](https://github.com/h5bp/html5-boilerplate/issues/1699)).
|
||||
@@ -106,7 +128,7 @@
|
||||
([#1474](https://github.com/h5bp/html5-boilerplate/issues/1474)).
|
||||
* 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`.
|
||||
* Use `https://` in the Google Universal Analytics snippet
|
||||
@@ -118,7 +140,7 @@
|
||||
([#1656](https://github.com/h5bp/html5-boilerplate/issues/1656)).
|
||||
* 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 Apache Server Configs to v2.11.0.
|
||||
@@ -141,7 +163,7 @@
|
||||
([#1567](https://github.com/h5bp/html5-boilerplate/pull/1567)).
|
||||
* Add `/.editorconfig` file
|
||||
([#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
|
||||
([#1562](https://github.com/h5bp/html5-boilerplate/issues/1562)).
|
||||
* Add `timeline` and `timelineEnd` to the list of `console` methods
|
||||
@@ -160,7 +182,7 @@
|
||||
([#1477](https://github.com/h5bp/html5-boilerplate/issues/1477)).
|
||||
* Remove image replacement helper class `.ir`
|
||||
([#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`
|
||||
([#1453](https://github.com/h5bp/html5-boilerplate/issues/1453)).
|
||||
* Redesign 404 page
|
||||
@@ -169,9 +191,9 @@
|
||||
([#1050](https://github.com/h5bp/html5-boilerplate/issues/1050)).
|
||||
* Remove IE conditional classes
|
||||
([#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
|
||||
([#1367](https://github.com/h5bp/html5-boilerplate/issues/1367)).
|
||||
@@ -180,17 +202,17 @@
|
||||
* Update to Apache Server Configs 1.1.0.
|
||||
* Add `initial-scale=1` to the viewport `meta`
|
||||
([#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)).
|
||||
* Remove Google Chrome Frame related code
|
||||
([#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
|
||||
([#1347](https://github.com/h5bp/html5-boilerplate/issues/1347)).
|
||||
* Update to jQuery 1.10.2.
|
||||
* Update to Normalize.css 1.1.3.
|
||||
|
||||
### 4.2.0 (April 8, 2013)
|
||||
## 4.2.0 (April 8, 2013)
|
||||
|
||||
* Remove Google Analytics protocol check
|
||||
([#1319](https://github.com/h5bp/html5-boilerplate/pull/1319)).
|
||||
@@ -201,12 +223,12 @@
|
||||
* Use a protocol relative URL for the 404 template script.
|
||||
* 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 jQuery 1.9.0.
|
||||
|
||||
### 4.0.3 (January 12, 2013)
|
||||
## 4.0.3 (January 12, 2013)
|
||||
|
||||
* Use 32x32 favicon.ico
|
||||
([#1286](https://github.com/h5bp/html5-boilerplate/pull/1286)).
|
||||
@@ -217,26 +239,26 @@
|
||||
* Update HiDPI example media query
|
||||
([#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 to Normalize.css 1.0.2.
|
||||
* Update to jQuery 1.8.3.
|
||||
|
||||
### 4.0.1 (October 20, 2012)
|
||||
## 4.0.1 (October 20, 2012)
|
||||
|
||||
* Further improvements to `console` method stubbing
|
||||
([#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 Modernizr 2.6.2.
|
||||
* Minor additions to the documentation.
|
||||
|
||||
### 4.0.0 (August 28, 2012)
|
||||
## 4.0.0 (August 28, 2012)
|
||||
|
||||
* Improve the Apache compression configuration
|
||||
([#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
|
||||
([#1127](https://github.com/h5bp/html5-boilerplate/issues/1127)).
|
||||
* Add bundled docs
|
||||
@@ -263,15 +285,15 @@
|
||||
* Remove superfluous inline comments
|
||||
([#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.
|
||||
|
||||
### 3.0.1 (February 08, 2012)
|
||||
## 3.0.1 (February 08, 2012)
|
||||
|
||||
* 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`.
|
||||
* Improve 404 design.
|
||||
@@ -300,7 +322,7 @@
|
||||
* Remove explicit Site Speed tracking for Google Analytics. It's now
|
||||
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
|
||||
([#500](https://github.com/h5bp/html5-boilerplate/issues/500)).
|
||||
@@ -332,7 +354,7 @@
|
||||
the HTML.
|
||||
* 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.
|
||||
* Add a humans.txt.
|
||||
|
||||
75
README.md
75
README.md
@@ -9,7 +9,7 @@
|
||||
HTML5 Boilerplate is a professional front-end template for building
|
||||
fast, robust, and adaptable web apps or sites.
|
||||
|
||||
This project is the product of years of iterative development and
|
||||
This project is the product of over 10 years of iterative development and
|
||||
community knowledge. It does not impose a specific development
|
||||
philosophy or framework, so you're free to architect your code in the
|
||||
way that you want.
|
||||
@@ -18,33 +18,63 @@ way that you want.
|
||||
* Source: [https://github.com/h5bp/html5-boilerplate](https://github.com/h5bp/html5-boilerplate)
|
||||
* Twitter: [@h5bp](https://twitter.com/h5bp)
|
||||
|
||||
|
||||
## Quick start
|
||||
|
||||
Choose one of the following options:
|
||||
|
||||
- Download the latest stable release from
|
||||
[html5boilerplate.com](https://html5boilerplate.com/).
|
||||
- Clone the git repo — `git clone
|
||||
* Download the latest stable release from
|
||||
[html5boilerplate.com](https://html5boilerplate.com/). This zip file is a
|
||||
snapshot of the `dist` folder. On Windows, Mac and from the file manager on
|
||||
Linux unzipping this folder will output to a folder named something like
|
||||
`html5-boilerplate_v7.3.0`. From the command line will need to create a
|
||||
folder and unzip the contents into that folder.
|
||||
|
||||
```bash
|
||||
mkdir html5-boilerplate
|
||||
unzip html5-boilerplate*.zip -d html5-boilerplate
|
||||
```
|
||||
|
||||
* Clone the git repo — `git clone
|
||||
https://github.com/h5bp/html5-boilerplate.git` - and checkout the
|
||||
[tagged release](https://github.com/h5bp/html5-boilerplate/releases)
|
||||
you'd like to use.
|
||||
- Install with [npm](https://www.npmjs.com/): `npm install html5-boilerplate` and pull in what you need from the resulting `node_modules/html5-boilerplate/dist`
|
||||
- Install with [yarn](https://yarnpkg.com/): `yarn add html5-boilerplate`
|
||||
you'd like to use. The `dist` folder represents the latest version of the
|
||||
project for end users.
|
||||
|
||||
* Install with [npm](https://www.npmjs.com/): `npm install html5-boilerplate`
|
||||
or [yarn](https://yarnpkg.com/): `yarn add html5-boilerplate`. The resulting
|
||||
`node_modules/html5-boilerplate/dist` folder represents the latest version of
|
||||
the project for end users. Depending on what you want to use and how you want
|
||||
to use it, you may have to copy and paste the contents of that folder into
|
||||
your project directory.
|
||||
|
||||
* Using our new [create-html5-boilerplate](https://github.com/h5bp/create-html5-boilerplate)
|
||||
project, instantly fetch the latest npm published package (or any version
|
||||
available on npm) with `npx`, `npm init` or `yarn create` without having to
|
||||
install any dependencies. Running the following `npx` command installs the
|
||||
latest version into a folder called `new-site`
|
||||
|
||||
```
|
||||
npx create-html5-boilerplate new-site
|
||||
cd new-site
|
||||
npm install
|
||||
npm start
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
* HTML5 ready. Use the new elements with confidence.
|
||||
* A finely-tuned starter template. Reap the benefits of 10 years of analysis,
|
||||
research and experimentation by over 200 contributors.
|
||||
* Designed with progressive enhancement in mind.
|
||||
* Includes:
|
||||
* [`Normalize.css`](https://necolas.github.com/normalize.css/)
|
||||
for CSS normalizations and common bug fixes
|
||||
* [`jQuery`](https://jquery.com/) via CDN with [SRI Hash](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) and a local fallback
|
||||
* A custom build of [`Modernizr`](https://modernizr.com/) for feature
|
||||
detection
|
||||
* [`Apache Server Configs`](https://github.com/h5bp/server-configs-apache)
|
||||
that, among other, improve the web site's performance and security
|
||||
that improve the web site's performance and security
|
||||
* Placeholder Open Graph elements and attributes.
|
||||
* An example package.json file with [Parcel](https://parceljs.org/) commands
|
||||
built in to jumpstart application development
|
||||
* Placeholder CSS Media Queries.
|
||||
* Useful CSS helper classes.
|
||||
* Default print styles, performance optimized.
|
||||
@@ -52,8 +82,7 @@ Choose one of the following options:
|
||||
* Protection against any stray `console` statements causing JavaScript
|
||||
errors in older browsers.
|
||||
* "Delete-key friendly." Easy to strip out parts you don't need.
|
||||
* Extensive inline and accompanying documentation.
|
||||
|
||||
* Extensive documentation.
|
||||
|
||||
## Browser support
|
||||
|
||||
@@ -68,28 +97,26 @@ Choose one of the following options:
|
||||
just that we'll ensure compatibility with the ones mentioned above.*
|
||||
|
||||
If you need legacy browser support you can use [HTML5 Boilerplate v6](https://github.com/h5bp/html5-boilerplate/releases/tag/6.1.0) (IE9/IE10)
|
||||
or [HTML5 Boilerplate v5](https://github.com/h5bp/html5-boilerplate/releases/tag/5.3.0) (IE 8). They are no longer actively developed.
|
||||
|
||||
or [HTML5 Boilerplate v5](https://github.com/h5bp/html5-boilerplate/releases/tag/5.3.0)
|
||||
(IE 8). They are no longer actively developed.
|
||||
|
||||
## Documentation
|
||||
|
||||
Take a look at the [documentation table of contents](dist/doc/TOC.md).
|
||||
This documentation is bundled with the project which makes it
|
||||
available for offline reading and provides a useful starting point for
|
||||
any documentation you want to write about your project.
|
||||
|
||||
Take a look at the [documentation table of contents](dist/doc/TOC.md). This
|
||||
documentation is bundled with the project which makes it available for offline
|
||||
reading and provides a useful starting point for any documentation you want to
|
||||
write about your project.
|
||||
|
||||
## Contributing
|
||||
|
||||
Hundreds of developers have helped to make the HTML5 Boilerplate. Anyone is welcome to [contribute](.github/CONTRIBUTING.md),
|
||||
however, if you decide to get involved, please take a moment to review
|
||||
the [guidelines](.github/CONTRIBUTING.md):
|
||||
Hundreds of developers have helped to make the HTML5 Boilerplate. Anyone is
|
||||
welcome to [contribute](.github/CONTRIBUTING.md), however, if you decide to get
|
||||
involved, please take a moment to review the [guidelines](.github/CONTRIBUTING.md):
|
||||
|
||||
* [Bug reports](.github/CONTRIBUTING.md#bugs)
|
||||
* [Feature requests](.github/CONTRIBUTING.md#features)
|
||||
* [Pull requests](.github/CONTRIBUTING.md#pull-requests)
|
||||
|
||||
|
||||
## License
|
||||
|
||||
The code is available under the [MIT license](LICENSE.txt).
|
||||
|
||||
3
dist/.editorconfig
vendored
3
dist/.editorconfig
vendored
@@ -8,6 +8,3 @@ indent_size = 2
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
3
dist/.gitignore
vendored
3
dist/.gitignore
vendored
@@ -1,3 +1,6 @@
|
||||
# Include your project-specific ignores in this file
|
||||
# Read about how to use .gitignore: https://help.github.com/articles/ignoring-files
|
||||
# Useful .gitignore templates: https://github.com/github/gitignore
|
||||
node_modules
|
||||
dist
|
||||
.cache
|
||||
579
dist/.htaccess
vendored
579
dist/.htaccess
vendored
@@ -1,4 +1,4 @@
|
||||
# Apache Server Configs v3.2.1 | MIT License
|
||||
# Apache Server Configs v4.0.0 | MIT License
|
||||
# https://github.com/h5bp/server-configs-apache
|
||||
|
||||
# (!) Using `.htaccess` files slows down Apache, therefore, if you have
|
||||
@@ -21,6 +21,13 @@
|
||||
# https://enable-cors.org/
|
||||
# https://www.w3.org/TR/cors/
|
||||
|
||||
# (!) Do not use this without understanding the consequences.
|
||||
# This will permit access from any other website.
|
||||
# Instead of using this file, consider using a specific rule such as
|
||||
# allowing access based on (sub)domain:
|
||||
#
|
||||
# Header set Access-Control-Allow-Origin "subdomain.example.com"
|
||||
|
||||
# <IfModule mod_headers.c>
|
||||
# Header set Access-Control-Allow-Origin "*"
|
||||
# </IfModule>
|
||||
@@ -36,7 +43,7 @@
|
||||
|
||||
<IfModule mod_setenvif.c>
|
||||
<IfModule mod_headers.c>
|
||||
<FilesMatch "\.(bmp|cur|gif|ico|jpe?g|png|svgz?|webp)$">
|
||||
<FilesMatch "\.(bmp|cur|gif|ico|jpe?g|a?png|svgz?|webp)$">
|
||||
SetEnvIf Origin ":" IS_CORS
|
||||
Header set Access-Control-Allow-Origin "*" env=IS_CORS
|
||||
</FilesMatch>
|
||||
@@ -63,10 +70,9 @@
|
||||
|
||||
# Allow cross-origin access to the timing information for all resources.
|
||||
#
|
||||
# If a resource isn't served with a `Timing-Allow-Origin` header that
|
||||
# would allow its timing information to be shared with the document,
|
||||
# some of the attributes of the `PerformanceResourceTiming` object will
|
||||
# be set to zero.
|
||||
# If a resource isn't served with a `Timing-Allow-Origin` header that would
|
||||
# allow its timing information to be shared with the document, some of the
|
||||
# attributes of the `PerformanceResourceTiming` object will be set to zero.
|
||||
#
|
||||
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Timing-Allow-Origin
|
||||
# https://www.w3.org/TR/resource-timing/
|
||||
@@ -96,8 +102,8 @@ ErrorDocument 404 /404.html
|
||||
|
||||
# Disable the pattern matching based on filenames.
|
||||
#
|
||||
# This setting prevents Apache from returning a 404 error as the result
|
||||
# of a rewrite when the directory with the same name does not exist.
|
||||
# This setting prevents Apache from returning a 404 error as the result of a
|
||||
# rewrite when the directory with the same name does not exist.
|
||||
#
|
||||
# https://httpd.apache.org/docs/current/content-negotiation.html#multiviews
|
||||
|
||||
@@ -112,21 +118,21 @@ Options -MultiViews
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
# Force Internet Explorer 8/9/10 to render pages in the highest mode
|
||||
# available in the various cases when it may not.
|
||||
# available in various cases when it may not.
|
||||
#
|
||||
# https://hsivonen.fi/doctype/#ie8
|
||||
#
|
||||
# (!) Starting with Internet Explorer 11, document modes are deprecated.
|
||||
# If your business still relies on older web apps and services that were
|
||||
# designed for older versions of Internet Explorer, you might want to
|
||||
# consider enabling `Enterprise Mode` throughout your company.
|
||||
# If your business still relies on older web apps and services that were
|
||||
# designed for older versions of Internet Explorer, you might want to
|
||||
# consider enabling `Enterprise Mode` throughout your company.
|
||||
#
|
||||
# https://msdn.microsoft.com/en-us/library/ie/bg182625.aspx#docmode
|
||||
# https://blogs.msdn.microsoft.com/ie/2014/04/02/stay-up-to-date-with-enterprise-mode-for-internet-explorer-11/
|
||||
# https://msdn.microsoft.com/en-us/library/ff955275.aspx
|
||||
|
||||
<IfModule mod_headers.c>
|
||||
Header set X-UA-Compatible "IE=edge" "expr=%{CONTENT_TYPE} =~ m#text/html#i"
|
||||
Header always set X-UA-Compatible "IE=edge" "expr=%{CONTENT_TYPE} =~ m#text/html#i"
|
||||
</IfModule>
|
||||
|
||||
# ######################################################################
|
||||
@@ -182,8 +188,8 @@ Options -MultiViews
|
||||
AddType video/webm webm
|
||||
AddType video/x-flv flv
|
||||
|
||||
# Serving `.ico` image files with a different media type
|
||||
# prevents Internet Explorer from displaying them as images:
|
||||
# Serving `.ico` image files with a different media type prevents
|
||||
# Internet Explorer from displaying them as images:
|
||||
# https://github.com/h5bp/html5-boilerplate/commit/37b5fec090d00f38de64b591bcddcb205aadf8ee
|
||||
|
||||
AddType image/x-icon cur ico
|
||||
@@ -224,8 +230,8 @@ Options -MultiViews
|
||||
# | Character encodings |
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
# Serve all resources labeled as `text/html` or `text/plain`
|
||||
# with the media type `charset` parameter set to `UTF-8`.
|
||||
# Serve all resources labeled as `text/html` or `text/plain` with the media type
|
||||
# `charset` parameter set to `UTF-8`.
|
||||
#
|
||||
# https://httpd.apache.org/docs/current/mod/core.html#adddefaultcharset
|
||||
|
||||
@@ -233,8 +239,8 @@ AddDefaultCharset utf-8
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
# Serve the following file types with the media type `charset`
|
||||
# parameter set to `UTF-8`.
|
||||
# Serve the following file types with the media type `charset` parameter set to
|
||||
# `UTF-8`.
|
||||
#
|
||||
# https://httpd.apache.org/docs/current/mod/mod_mime.html#addcharset
|
||||
|
||||
@@ -267,8 +273,8 @@ AddDefaultCharset utf-8
|
||||
# | Rewrite engine |
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
# (1) Turn on the rewrite engine (this is necessary in order for
|
||||
# the `RewriteRule` directives to work).
|
||||
# (1) Turn on the rewrite engine (this is necessary in order for the
|
||||
# `RewriteRule` directives to work).
|
||||
#
|
||||
# https://httpd.apache.org/docs/current/mod/mod_rewrite.html#RewriteEngine
|
||||
#
|
||||
@@ -276,10 +282,10 @@ AddDefaultCharset utf-8
|
||||
#
|
||||
# https://httpd.apache.org/docs/current/mod/core.html#options
|
||||
#
|
||||
# (3) If your web host doesn't allow the `FollowSymlinks` option,
|
||||
# you need to comment it out or remove it, and then uncomment
|
||||
# the `Options +SymLinksIfOwnerMatch` line (4), but be aware
|
||||
# of the performance impact.
|
||||
# (3) If your web host doesn't allow the `FollowSymlinks` option, you need to
|
||||
# comment it out or remove it, and then uncomment the
|
||||
# `Options +SymLinksIfOwnerMatch` line (4), but be aware of the performance
|
||||
# impact.
|
||||
#
|
||||
# https://httpd.apache.org/docs/current/misc/perf-tuning.html#symlinks
|
||||
#
|
||||
@@ -288,14 +294,10 @@ AddDefaultCharset utf-8
|
||||
# https://www.rackspace.com/knowledge_center/frequently-asked-question/why-is-modrewrite-not-working-on-my-site
|
||||
# https://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase
|
||||
#
|
||||
# (5) Depending on how your server is set up, you may also need to
|
||||
# use the `RewriteOptions` directive to enable some options for
|
||||
# the rewrite engine.
|
||||
# (5) Depending on how your server is set up, you may also need to use the
|
||||
# `RewriteOptions` directive to enable some options for the rewrite engine.
|
||||
#
|
||||
# https://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewriteoptions
|
||||
#
|
||||
# (6) Set %{ENV:PROTO} variable, to allow rewrites to redirect with the
|
||||
# appropriate schema automatically (http or https).
|
||||
|
||||
<IfModule mod_rewrite.c>
|
||||
|
||||
@@ -314,12 +316,6 @@ AddDefaultCharset utf-8
|
||||
# (5)
|
||||
# RewriteOptions <options>
|
||||
|
||||
# (6)
|
||||
RewriteCond %{HTTPS} =on
|
||||
RewriteRule ^ - [env=proto:https]
|
||||
RewriteCond %{HTTPS} !=on
|
||||
RewriteRule ^ - [env=proto:http]
|
||||
|
||||
</IfModule>
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
@@ -330,10 +326,9 @@ AddDefaultCharset utf-8
|
||||
#
|
||||
# https://wiki.apache.org/httpd/RewriteHTTPToHTTPS
|
||||
|
||||
# (1) If you're using cPanel AutoSSL or the Let's Encrypt webroot
|
||||
# method it will fail to validate the certificate if validation
|
||||
# requests are redirected to HTTPS. Turn on the condition(s)
|
||||
# you need.
|
||||
# (1) If you're using cPanel AutoSSL or the Let's Encrypt webroot method it
|
||||
# will fail to validate the certificate if validation requests are
|
||||
# redirected to HTTPS. Turn on the condition(s) you need.
|
||||
#
|
||||
# https://www.iana.org/assignments/well-known-uris/well-known-uris.xhtml
|
||||
# https://tools.ietf.org/html/draft-ietf-acme-acme-12
|
||||
@@ -354,27 +349,39 @@ AddDefaultCharset utf-8
|
||||
|
||||
# Rewrite www.example.com → example.com
|
||||
|
||||
# The same content should never be available under two different
|
||||
# URLs, especially not with and without `www.` at the beginning.
|
||||
# This can cause SEO problems (duplicate content), and therefore,
|
||||
# you should choose one of the alternatives and redirect the other
|
||||
# one.
|
||||
# The same content should never be available under two different URLs,
|
||||
# especially not with and without `www.` at the beginning.
|
||||
# This can cause SEO problems (duplicate content), and therefore, you should
|
||||
# choose one of the alternatives and redirect the other one.
|
||||
#
|
||||
# (!) NEVER USE BOTH WWW-RELATED RULES AT THE SAME TIME!
|
||||
|
||||
# (1) The rule assumes by default that both HTTP and HTTPS
|
||||
# environments are available for redirection.
|
||||
# If your SSL certificate could not handle one of the domains
|
||||
# used during redirection, you should turn the condition on.
|
||||
# (1) Set %{ENV:PROTO} variable, to allow rewrites to redirect with the
|
||||
# appropriate schema automatically (http or https).
|
||||
#
|
||||
# (2) The rule assumes by default that both HTTP and HTTPS environments are
|
||||
# available for redirection.
|
||||
# If your SSL certificate could not handle one of the domains used during
|
||||
# redirection, you should turn the condition on.
|
||||
#
|
||||
# https://github.com/h5bp/server-configs-apache/issues/52
|
||||
|
||||
<IfModule mod_rewrite.c>
|
||||
|
||||
RewriteEngine On
|
||||
|
||||
# (1)
|
||||
RewriteCond %{HTTPS} =on
|
||||
RewriteRule ^ - [E=PROTO:https]
|
||||
RewriteCond %{HTTPS} !=on
|
||||
RewriteRule ^ - [E=PROTO:http]
|
||||
|
||||
# (2)
|
||||
# RewriteCond %{HTTPS} !=on
|
||||
|
||||
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
|
||||
RewriteRule ^ %{ENV:PROTO}://%1%{REQUEST_URI} [R=301,L]
|
||||
|
||||
</IfModule>
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
@@ -383,18 +390,20 @@ AddDefaultCharset utf-8
|
||||
|
||||
# Rewrite example.com → www.example.com
|
||||
|
||||
# The same content should never be available under two different
|
||||
# URLs, especially not with and without `www.` at the beginning.
|
||||
# This can cause SEO problems (duplicate content), and therefore,
|
||||
# you should choose one of the alternatives and redirect the other
|
||||
# one.
|
||||
# The same content should never be available under two different URLs,
|
||||
# especially not with and without `www.` at the beginning.
|
||||
# This can cause SEO problems (duplicate content), and therefore, you should
|
||||
# choose one of the alternatives and redirect the other one.
|
||||
#
|
||||
# (!) NEVER USE BOTH WWW-RELATED RULES AT THE SAME TIME!
|
||||
|
||||
# (1) The rule assumes by default that both HTTP and HTTPS
|
||||
# environments are available for redirection.
|
||||
# If your SSL certificate could not handle one of the domains
|
||||
# used during redirection, you should turn the condition on.
|
||||
# (1) Set %{ENV:PROTO} variable, to allow rewrites to redirect with the
|
||||
# appropriate schema automatically (http or https).
|
||||
#
|
||||
# (2) The rule assumes by default that both HTTP and HTTPS environments are
|
||||
# available for redirection.
|
||||
# If your SSL certificate could not handle one of the domains used during
|
||||
# redirection, you should turn the condition on.
|
||||
#
|
||||
# https://github.com/h5bp/server-configs-apache/issues/52
|
||||
|
||||
@@ -402,13 +411,23 @@ AddDefaultCharset utf-8
|
||||
# subdomains for certain parts of your website.
|
||||
|
||||
# <IfModule mod_rewrite.c>
|
||||
|
||||
# RewriteEngine On
|
||||
|
||||
# # (1)
|
||||
# RewriteCond %{HTTPS} =on
|
||||
# RewriteRule ^ - [E=PROTO:https]
|
||||
# RewriteCond %{HTTPS} !=on
|
||||
# RewriteRule ^ - [E=PROTO:http]
|
||||
|
||||
# # (2)
|
||||
# # RewriteCond %{HTTPS} !=on
|
||||
|
||||
# RewriteCond %{HTTP_HOST} !^www\. [NC]
|
||||
# RewriteCond %{SERVER_ADDR} !=127.0.0.1
|
||||
# RewriteCond %{SERVER_ADDR} !=::1
|
||||
# RewriteRule ^ %{ENV:PROTO}://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
|
||||
|
||||
# </IfModule>
|
||||
|
||||
# ######################################################################
|
||||
@@ -416,33 +435,32 @@ AddDefaultCharset utf-8
|
||||
# ######################################################################
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# | Clickjacking |
|
||||
# | Frame Options |
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
# Protect website against clickjacking.
|
||||
#
|
||||
# The example below sends the `X-Frame-Options` response header with
|
||||
# the value `DENY`, informing browsers not to display the content of
|
||||
# the web page in any frame.
|
||||
# The example below sends the `X-Frame-Options` response header with the value
|
||||
# `DENY`, informing browsers not to display the content of the web page in any
|
||||
# frame.
|
||||
#
|
||||
# This might not be the best setting for everyone. You should read
|
||||
# about the other two possible values the `X-Frame-Options` header
|
||||
# field can have: `SAMEORIGIN` and `ALLOW-FROM`.
|
||||
# This might not be the best setting for everyone. You should read about the
|
||||
# other two possible values the `X-Frame-Options` header field can have:
|
||||
# `SAMEORIGIN` and `ALLOW-FROM`.
|
||||
# https://tools.ietf.org/html/rfc7034#section-2.1.
|
||||
#
|
||||
# Keep in mind that while you could send the `X-Frame-Options` header
|
||||
# for all of your website’s pages, this has the potential downside that
|
||||
# it forbids even non-malicious framing of your content (e.g.: when
|
||||
# users visit your website using a Google Image Search results page).
|
||||
# Keep in mind that while you could send the `X-Frame-Options` header for all
|
||||
# of your website's pages, this has the potential downside that it forbids even
|
||||
# non-malicious framing of your content (e.g.: when users visit your website
|
||||
# using a Google Image Search results page).
|
||||
#
|
||||
# Nonetheless, you should ensure that you send the `X-Frame-Options`
|
||||
# header for all pages that allow a user to make a state changing
|
||||
# operation (e.g: pages that contain one-click purchase links, checkout
|
||||
# or bank-transfer confirmation pages, pages that make permanent
|
||||
# configuration changes, etc.).
|
||||
# Nonetheless, you should ensure that you send the `X-Frame-Options` header for
|
||||
# all pages that allow a user to make a state-changing operation (e.g: pages
|
||||
# that contain one-click purchase links, checkout or bank-transfer confirmation
|
||||
# pages, pages that make permanent configuration changes, etc.).
|
||||
#
|
||||
# Sending the `X-Frame-Options` header can also protect your website
|
||||
# against more than just clickjacking attacks:
|
||||
# Sending the `X-Frame-Options` header can also protect your website against
|
||||
# more than just clickjacking attacks.
|
||||
# https://cure53.de/xfo-clickjacking.pdf.
|
||||
#
|
||||
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
|
||||
@@ -451,7 +469,7 @@ AddDefaultCharset utf-8
|
||||
# https://www.owasp.org/index.php/Clickjacking
|
||||
|
||||
# <IfModule mod_headers.c>
|
||||
# Header set X-Frame-Options "DENY" "expr=%{CONTENT_TYPE} =~ m#text/html#i"
|
||||
# Header always set X-Frame-Options "DENY" "expr=%{CONTENT_TYPE} =~ m#text/html#i"
|
||||
# </IfModule>
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
@@ -461,54 +479,60 @@ AddDefaultCharset utf-8
|
||||
# Mitigate the risk of cross-site scripting and other content-injection
|
||||
# attacks.
|
||||
#
|
||||
# This can be done by setting a `Content Security Policy` which
|
||||
# whitelists trusted sources of content for your website.
|
||||
# This can be done by setting a `Content Security Policy` which whitelists
|
||||
# trusted sources of content for your website.
|
||||
#
|
||||
# There is no policy that fits all websites, you will have to modify
|
||||
# the `Content-Security-Policy` directives in the example below depending
|
||||
# on your needs.
|
||||
# There is no policy that fits all websites, you will have to modify the
|
||||
# `Content-Security-Policy` directives in the example depending on your needs.
|
||||
#
|
||||
# The example policy below aims to:
|
||||
#
|
||||
# (1) Restrict all fetches by default to the origin of the current website
|
||||
# by setting the `default-src` directive to `'self'` - which acts as a
|
||||
# (1) Restrict all fetches by default to the origin of the current website by
|
||||
# setting the `default-src` directive to `'self'` - which acts as a
|
||||
# fallback to all "Fetch directives" (https://developer.mozilla.org/en-US/docs/Glossary/Fetch_directive).
|
||||
#
|
||||
# This is convenient as you do not have to specify all Fetch directives
|
||||
# that apply to your site, for example:
|
||||
# `connect-src 'self'; font-src 'self'; script-src 'self'; style-src 'self'`, etc.
|
||||
#
|
||||
# This restriction also means that you must explicitly define from
|
||||
# which site(s) your website is allowed to load resources from.
|
||||
# This restriction also means that you must explicitly define from which
|
||||
# site(s) your website is allowed to load resources from.
|
||||
#
|
||||
# (2) The `<base>` element is not allowed on the website. This is to
|
||||
# prevent attackers from changing the locations of resources loaded
|
||||
# from relative URLs.
|
||||
# (2) The `<base>` element is not allowed on the website. This is to prevent
|
||||
# attackers from changing the locations of resources loaded from relative
|
||||
# URLs.
|
||||
#
|
||||
# If you want to use the `<base>` element, then `base-uri 'self'`
|
||||
# can be used instead.
|
||||
# If you want to use the `<base>` element, then `base-uri 'self'` can be
|
||||
# used instead.
|
||||
#
|
||||
# (3) Form submissions are only allowed from the current website by
|
||||
# setting: `form-action 'self'`.
|
||||
# (3) Form submissions are only allowed from the current website by setting:
|
||||
# `form-action 'self'`.
|
||||
#
|
||||
# (4) Prevents all websites (including your own) from embedding your
|
||||
# webpages within e.g. the `<iframe>` or `<object>` element by
|
||||
# setting `frame-ancestors 'none'`.
|
||||
# (4) Prevents all websites (including your own) from embedding your webpages
|
||||
# within e.g. the `<iframe>` or `<object>` element by setting:
|
||||
# `frame-ancestors 'none'`.
|
||||
#
|
||||
# The `frame-ancestors` directive helps avoid "Clickjacking" attacks
|
||||
# and is similar to the `X-Frame-Options` header.
|
||||
# The `frame-ancestors` directive helps avoid "Clickjacking" attacks and
|
||||
# is similar to the `X-Frame-Options` header.
|
||||
#
|
||||
# Browsers that support the CSP header will ignore `X-Frame-Options`
|
||||
# if `frame-ancestors` is also specified.
|
||||
# Browsers that support the CSP header will ignore `X-Frame-Options` if
|
||||
# `frame-ancestors` is also specified.
|
||||
#
|
||||
# (5) Forces the browser to treat all the resources that are served over
|
||||
# HTTP as if they were loaded securely over HTTPS by setting the
|
||||
# (5) Forces the browser to treat all the resources that are served over HTTP
|
||||
# as if they were loaded securely over HTTPS by setting the
|
||||
# `upgrade-insecure-requests` directive.
|
||||
#
|
||||
# Please note that `upgrade-insecure-requests` does not ensure
|
||||
# HTTPS for the top-level navigation. If you want to force the
|
||||
# website itself to be loaded over HTTPS you must include the
|
||||
# `Strict-Transport-Security` header.
|
||||
# Please note that `upgrade-insecure-requests` does not ensure HTTPS for
|
||||
# the top-level navigation. If you want to force the website itself to be
|
||||
# loaded over HTTPS you must include the `Strict-Transport-Security`
|
||||
# header.
|
||||
#
|
||||
# (6) The `Content-Security-Policy` header is included in all responses
|
||||
# that are able to execute scripting. This includes the commonly used
|
||||
# file types: HTML, XML and PDF documents. Although Javascript files
|
||||
# can not execute script in a "browsing context", they are still included
|
||||
# to target workers:
|
||||
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#CSP_in_workers
|
||||
#
|
||||
# To make your CSP implementation easier, you can use an online CSP header
|
||||
# generator such as:
|
||||
@@ -524,8 +548,8 @@ AddDefaultCharset utf-8
|
||||
# https://www.w3.org/TR/CSP/
|
||||
|
||||
# <IfModule mod_headers.c>
|
||||
# # (1) (2) (3) (4) (5)
|
||||
# Header set Content-Security-Policy "default-src 'self'; base-uri 'none'; form-action 'self'; frame-ancestors 'none'; upgrade-insecure-requests" "expr=%{CONTENT_TYPE} =~ m#text/html#i"
|
||||
# # (1) (2) (3) (4) (5) (6)
|
||||
# Header always set Content-Security-Policy "default-src 'self'; base-uri 'none'; form-action 'self'; frame-ancestors 'none'; upgrade-insecure-requests" "expr=%{CONTENT_TYPE} =~ m#text\/(html|javascript)|application\/pdf|xml#i"
|
||||
# </IfModule>
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
@@ -534,9 +558,9 @@ AddDefaultCharset utf-8
|
||||
|
||||
# Block access to directories without a default document.
|
||||
#
|
||||
# You should leave the following uncommented, as you shouldn't allow
|
||||
# anyone to surf through every directory on your server (which may
|
||||
# includes rather private places such as the CMS's directories).
|
||||
# You should leave the following uncommented, as you shouldn't allow anyone to
|
||||
# surf through every directory on your server (which may include rather
|
||||
# private places such as the CMS's directories).
|
||||
|
||||
<IfModule mod_autoindex.c>
|
||||
Options -Indexes
|
||||
@@ -544,17 +568,17 @@ AddDefaultCharset utf-8
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
# Block access to all hidden files and directories with the exception of
|
||||
# the visible content from within the `/.well-known/` hidden directory.
|
||||
# Block access to all hidden files and directories except for the
|
||||
# visible content from within the `/.well-known/` hidden directory.
|
||||
#
|
||||
# These types of files usually contain user preferences or the preserved
|
||||
# state of an utility, and can include rather private places like, for
|
||||
# example, the `.git` or `.svn` directories.
|
||||
# These types of files usually contain user preferences or the preserved state
|
||||
# of a utility, and can include rather private places like, for example, the
|
||||
# `.git` or `.svn` directories.
|
||||
#
|
||||
# The `/.well-known/` directory represents the standard (RFC 5785) path
|
||||
# prefix for "well-known locations" (e.g.: `/.well-known/manifest.json`,
|
||||
# `/.well-known/keybase.txt`), and therefore, access to its visible
|
||||
# content should not be blocked.
|
||||
# The `/.well-known/` directory represents the standard (RFC 5785) path prefix
|
||||
# for "well-known locations" (e.g.: `/.well-known/manifest.json`,
|
||||
# `/.well-known/keybase.txt`), and therefore, access to its visible content
|
||||
# should not be blocked.
|
||||
#
|
||||
# https://www.mnot.net/blog/2010/04/07/well-known
|
||||
# https://tools.ietf.org/html/rfc5785
|
||||
@@ -571,17 +595,16 @@ AddDefaultCharset utf-8
|
||||
|
||||
# Block access to files that can expose sensitive information.
|
||||
#
|
||||
# By default, block access to backup and source files that may be
|
||||
# left by some text editors and can pose a security risk when anyone
|
||||
# has access to them.
|
||||
# By default, block access to backup and source files that may be left by some
|
||||
# text editors and can pose a security risk when anyone has access to them.
|
||||
#
|
||||
# https://feross.org/cmsploit/
|
||||
#
|
||||
# (!) Update the `<FilesMatch>` regular expression from below to
|
||||
# include any files that might end up on your production server and
|
||||
# can expose sensitive information about your website. These files may
|
||||
# include: configuration files, files that contain metadata about the
|
||||
# project (e.g.: project dependencies), build scripts, etc..
|
||||
# (!) Update the `<FilesMatch>` regular expression from below to include any
|
||||
# files that might end up on your production server and can expose
|
||||
# sensitive information about your website. These files may include:
|
||||
# configuration files, files that contain metadata about the project (e.g.:
|
||||
# project dependencies, build scripts, etc.).
|
||||
|
||||
<IfModule mod_authz_core.c>
|
||||
<FilesMatch "(^#.*#|\.(bak|conf|dist|fla|in[ci]|log|orig|psd|sh|sql|sw[op])|~)$">
|
||||
@@ -593,102 +616,93 @@ AddDefaultCharset utf-8
|
||||
# | HTTP Strict Transport Security (HSTS) |
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
# Force client-side SSL redirection.
|
||||
# Force client-side TLS (Transport Layer Security) redirection.
|
||||
#
|
||||
# If a user types `example.com` in their browser, even if the server
|
||||
# redirects them to the secure version of the website, that still leaves
|
||||
# a window of opportunity (the initial HTTP connection) for an attacker
|
||||
# to downgrade or redirect the request.
|
||||
# If a user types `example.com` in their browser, even if the server redirects
|
||||
# them to the secure version of the website, that still leaves a window of
|
||||
# opportunity (the initial HTTP connection) for an attacker to downgrade or
|
||||
# redirect the request.
|
||||
#
|
||||
# The following header ensures that browser will ONLY connect to your
|
||||
# server via HTTPS, regardless of what the users type in the browser's
|
||||
# address bar.
|
||||
# The following header ensures that a browser only connects to your server
|
||||
# via HTTPS, regardless of what the users type in the browser's address bar.
|
||||
#
|
||||
# (!) Be aware that this, once published, is not revokable and you must ensure
|
||||
# being able to serve the site via SSL for the duration you've specified
|
||||
# in max-age. When you don't have a valid SSL connection (anymore) your
|
||||
# visitors will see a nasty error message even when attempting to connect
|
||||
# via simple HTTP.
|
||||
# (!) Be aware that Strict Transport Security is not revokable and you
|
||||
# must ensure being able to serve the site over HTTPS for the duration
|
||||
# you've specified in the `max-age` directive. When you don't have a
|
||||
# valid TLS connection anymore (e.g. due to an expired TLS certificate)
|
||||
# your visitors will see a nasty error message even when attempting to
|
||||
# connect over HTTP.
|
||||
#
|
||||
# (!) Remove the `includeSubDomains` optional directive if the website's
|
||||
# subdomains are not using HTTPS.
|
||||
# (1) Preloading Strict Transport Security.
|
||||
# To submit your site for HSTS preloading, it is required that:
|
||||
# * the `includeSubDomains` directive is specified
|
||||
# * the `preload` directive is specified
|
||||
# * the `max-age` is specified with a value of at least 31536000 seconds
|
||||
# (1 year).
|
||||
# https://hstspreload.org/#deployment-recommendations
|
||||
#
|
||||
# (1) If you want to submit your site for HSTS preload (2) you must
|
||||
# * ensure the `includeSubDomains` directive to be present
|
||||
# * the `preload` directive to be specified
|
||||
# * the `max-age` to be at least 31536000 seconds (1 year) according to the current status.
|
||||
#
|
||||
# It is also advised (3) to only serve the HSTS header via a secure connection
|
||||
# which can be done with either `env=https` or `"expr=%{HTTPS} == 'on'"` (4). The
|
||||
# exact way depends on your environment and might just be tried.
|
||||
#
|
||||
# (2) https://hstspreload.org/
|
||||
# (3) https://tools.ietf.org/html/rfc6797#section-7.2
|
||||
# (4) https://stackoverflow.com/questions/24144552/how-to-set-hsts-header-from-htaccess-only-on-https/24145033#comment81632711_24145033
|
||||
#
|
||||
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security
|
||||
# https://tools.ietf.org/html/rfc6797#section-6.1
|
||||
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security
|
||||
# https://www.html5rocks.com/en/tutorials/security/transport-layer-security/
|
||||
# https://blogs.msdn.microsoft.com/ieinternals/2014/08/18/strict-transport-security/
|
||||
# https://hstspreload.org/
|
||||
|
||||
# <IfModule mod_headers.c>
|
||||
# Header always set Strict-Transport-Security "max-age=16070400; includeSubDomains"
|
||||
# # (1) or if HSTS preloading is desired (respect (2) for current requirements):
|
||||
# # Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" env=HTTPS
|
||||
# # (4) respectively… (respect (2) for current requirements):
|
||||
# Header always set Strict-Transport-Security "max-age=16070400; includeSubDomains" "expr=%{HTTPS} == 'on'"
|
||||
# # (1) Enable your site for HSTS preload inclusion.
|
||||
# # Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" "expr=%{HTTPS} == 'on'"
|
||||
# </IfModule>
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# | Reducing MIME type security risks |
|
||||
# | Content Type Options |
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
# Prevent some browsers from MIME-sniffing the response.
|
||||
#
|
||||
# This reduces exposure to drive-by download attacks and cross-origin
|
||||
# data leaks, and should be left uncommented, especially if the server
|
||||
# is serving user-uploaded content or content that could potentially be
|
||||
# treated as executable by the browser.
|
||||
# This reduces exposure to drive-by download attacks and cross-origin data
|
||||
# leaks, and should be left uncommented, especially if the server is serving
|
||||
# user-uploaded content or content that could potentially be treated as
|
||||
# executable by the browser.
|
||||
#
|
||||
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options
|
||||
# https://blogs.msdn.microsoft.com/ie/2008/07/02/ie8-security-part-v-comprehensive-protection/
|
||||
# https://mimesniff.spec.whatwg.org/
|
||||
|
||||
<IfModule mod_headers.c>
|
||||
Header set X-Content-Type-Options "nosniff"
|
||||
Header always set X-Content-Type-Options "nosniff"
|
||||
</IfModule>
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# | Reflected Cross-Site Scripting (XSS) attacks |
|
||||
# | Cross-Site Scripting (XSS) Protection |
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
# (1) Try to re-enable the cross-site scripting (XSS) filter built
|
||||
# into most web browsers.
|
||||
# Protect website reflected Cross-Site Scripting (XSS) attacks.
|
||||
#
|
||||
# The filter is usually enabled by default, but in some cases it
|
||||
# may be disabled by the user. However, in Internet Explorer for
|
||||
# example, it can be re-enabled just by sending the
|
||||
# `X-XSS-Protection` header with the value of `1`.
|
||||
# (1) Try to re-enable the cross-site scripting (XSS) filter built into most
|
||||
# web browsers.
|
||||
#
|
||||
# (2) Prevent web browsers from rendering the web page if a potential
|
||||
# reflected (a.k.a non-persistent) XSS attack is detected by the
|
||||
# filter.
|
||||
# The filter is usually enabled by default, but in some cases, it may be
|
||||
# disabled by the user. However, in Internet Explorer, for example, it can be
|
||||
# re-enabled just by sending the `X-XSS-Protection` header with the value
|
||||
# of `1`.
|
||||
#
|
||||
# By default, if the filter is enabled and browsers detect a
|
||||
# reflected XSS attack, they will attempt to block the attack
|
||||
# by making the smallest possible modifications to the returned
|
||||
# web page.
|
||||
# (2) Prevent web browsers from rendering the web page if a potential reflected
|
||||
# (a.k.a non-persistent) XSS attack is detected by the filter.
|
||||
#
|
||||
# Unfortunately, in some browsers (e.g.: Internet Explorer),
|
||||
# this default behavior may allow the XSS filter to be exploited,
|
||||
# thereby, it's better to inform browsers to prevent the rendering
|
||||
# of the page altogether, instead of attempting to modify it.
|
||||
# By default, if the filter is enabled and browsers detect a reflected XSS
|
||||
# attack, they will attempt to block the attack by making the smallest
|
||||
# possible modifications to the returned web page.
|
||||
#
|
||||
# Unfortunately, in some browsers (e.g.: Internet Explorer), this default
|
||||
# behavior may allow the XSS filter to be exploited. Therefore, it's better
|
||||
# to inform browsers to prevent the rendering of the page altogether,
|
||||
# instead of attempting to modify it.
|
||||
#
|
||||
# https://hackademix.net/2009/11/21/ies-xss-filter-creates-xss-vulnerabilities
|
||||
#
|
||||
# (!) Do not rely on the XSS filter to prevent XSS attacks! Ensure that
|
||||
# you are taking all possible measures to prevent XSS attacks, the
|
||||
# most obvious being: validating and sanitizing your website's inputs.
|
||||
# (!) Do not rely on the XSS filter to prevent XSS attacks! Ensure that you are
|
||||
# taking all possible measures to prevent XSS attacks, the most obvious
|
||||
# being: validating and sanitizing your website's inputs.
|
||||
#
|
||||
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection
|
||||
# https://blogs.msdn.microsoft.com/ie/2008/07/02/ie8-security-part-iv-the-xss-filter/
|
||||
@@ -697,33 +711,34 @@ AddDefaultCharset utf-8
|
||||
|
||||
# <IfModule mod_headers.c>
|
||||
# # (1) (2)
|
||||
# Header set X-XSS-Protection "1; mode=block" "expr=%{CONTENT_TYPE} =~ m#text/html#i"
|
||||
# Header always set X-XSS-Protection "1; mode=block" "expr=%{CONTENT_TYPE} =~ m#text/html#i"
|
||||
# </IfModule>
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# | Referrer Policy |
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
# A web application uses HTTPS and a URL-based session identifier.
|
||||
# The web application might wish to link to HTTPS resources on other
|
||||
# web sites without leaking the user's session identifier in the URL.
|
||||
# Set a strict Referrer Policy to mitigate information leakage.
|
||||
#
|
||||
# This can be done by setting a `Referrer Policy` which
|
||||
# whitelists trusted sources of content for your website.
|
||||
# (1) The `Referrer-Policy` header is included in responses for resources
|
||||
# that are able to request (or navigate to) other resources.
|
||||
#
|
||||
# To check your referrer policy, you can use an online service
|
||||
# such as: https://securityheaders.io/.
|
||||
# This includes the commonly used resource types:
|
||||
# HTML, CSS, XML/SVG, PDF documents, scripts and workers.
|
||||
#
|
||||
# To prevent referrer leakage entirely, specify the `no-referrer` value
|
||||
# instead. Note that the effect could impact analytics metrics negatively.
|
||||
#
|
||||
# To check your Referrer Policy, you can use an online service, such as:
|
||||
# https://securityheaders.com/
|
||||
# https://observatory.mozilla.org/
|
||||
#
|
||||
# https://scotthelme.co.uk/a-new-security-header-referrer-policy/
|
||||
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy
|
||||
|
||||
# <IfModule mod_headers.c>
|
||||
# # no-referrer-when-downgrade (default)
|
||||
# # This should be the user agent's default behavior if no policy is
|
||||
# # specified.The origin is sent as referrer to a-priori as-much-secure
|
||||
# # destination (HTTPS->HTTPS), but isn't sent to a less secure destination
|
||||
# # (HTTPS->HTTP).
|
||||
# Header set Referrer-Policy "no-referrer-when-downgrade" "expr=%{CONTENT_TYPE} =~ m#text/html#i"
|
||||
# # (1)
|
||||
# Header always set Referrer-Policy "strict-origin-when-cross-origin" "expr=%{CONTENT_TYPE} =~ m#text\/(css|html|javascript)|application\/pdf|xml#i"
|
||||
# </IfModule>
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
@@ -732,22 +747,26 @@ AddDefaultCharset utf-8
|
||||
|
||||
# Prevent Apache from responding to `TRACE` HTTP request.
|
||||
#
|
||||
# The TRACE method, while apparently harmless, can be successfully
|
||||
# leveraged in some scenarios to steal legitimate users' credentials
|
||||
# The TRACE method, while seemingly harmless, can be successfully leveraged
|
||||
# in some scenarios to steal legitimate users' credentials.
|
||||
#
|
||||
# Modern browsers now prevent TRACE requests being made via JavaScript,
|
||||
# however, other ways of sending TRACE requests with browsers have been
|
||||
# discovered, such as using Java.
|
||||
#
|
||||
# (!) The `TraceEnable` directive will only work in the main server
|
||||
# configuration file, so don't try to enable it in the `.htaccess` file!
|
||||
# (!) If you have access to the main server configuration file, use the
|
||||
# `TraceEnable` directive instead.
|
||||
#
|
||||
# https://tools.ietf.org/html/rfc7231#section-4.3.8
|
||||
# https://www.owasp.org/index.php/Cross_Site_Tracing
|
||||
# https://www.owasp.org/index.php/Test_HTTP_Methods_(OTG-CONFIG-006)
|
||||
# https://httpd.apache.org/docs/current/mod/core.html#traceenable
|
||||
|
||||
# TraceEnable Off
|
||||
# <IfModule mod_rewrite.c>
|
||||
# RewriteEngine On
|
||||
# RewriteCond %{REQUEST_METHOD} ^TRACE [NC]
|
||||
# RewriteRule .* - [R=405,L]
|
||||
# </IfModule>
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# | Server-side technology information |
|
||||
@@ -755,17 +774,16 @@ AddDefaultCharset utf-8
|
||||
|
||||
# Remove the `X-Powered-By` response header that:
|
||||
#
|
||||
# * is set by some frameworks and server-side languages
|
||||
# (e.g.: ASP.NET, PHP), and its value contains information
|
||||
# about them (e.g.: their name, version number)
|
||||
# * is set by some frameworks and server-side languages (e.g.: ASP.NET, PHP),
|
||||
# and its value contains information about them (e.g.: their name, version
|
||||
# number)
|
||||
#
|
||||
# * doesn't provide any value to users, contributes to header
|
||||
# bloat, and in some cases, the information it provides can
|
||||
# expose vulnerabilities
|
||||
# * doesn't provide any value to users, contributes to header bloat, and in
|
||||
# some cases, the information it provides can expose vulnerabilities
|
||||
#
|
||||
# (!) If you can, you should disable the `X-Powered-By` header from the
|
||||
# language / framework level (e.g.: for PHP, you can do that by setting
|
||||
# `expose_php = off` in `php.ini`)
|
||||
# language/framework level (e.g.: for PHP, you can do that by setting
|
||||
# `expose_php = off` in `php.ini`).
|
||||
#
|
||||
# https://php.net/manual/en/ini.core.php#ini.expose-php
|
||||
|
||||
@@ -778,27 +796,14 @@ AddDefaultCharset utf-8
|
||||
# | Server software information |
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
# Prevent Apache from adding a trailing footer line containing
|
||||
# information about the server to the server-generated documents
|
||||
# (e.g.: error messages, directory listings, etc.)
|
||||
# Prevent Apache from adding a trailing footer line containing information
|
||||
# about the server to the server-generated documents (e.g.: error messages,
|
||||
# directory listings, etc.).
|
||||
#
|
||||
# https://httpd.apache.org/docs/current/mod/core.html#serversignature
|
||||
|
||||
ServerSignature Off
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
# Prevent Apache from sending in the `Server` response header its
|
||||
# exact version number, the description of the generic OS-type or
|
||||
# information about its compiled-in modules.
|
||||
#
|
||||
# (!) The `ServerTokens` directive will only work in the main server
|
||||
# configuration file, so don't try to enable it in the `.htaccess` file!
|
||||
#
|
||||
# https://httpd.apache.org/docs/current/mod/core.html#servertokens
|
||||
|
||||
# ServerTokens Prod
|
||||
|
||||
# ######################################################################
|
||||
# # WEB PERFORMANCE #
|
||||
# ######################################################################
|
||||
@@ -847,6 +852,7 @@ ServerSignature Off
|
||||
"font/eot" \
|
||||
"font/opentype" \
|
||||
"font/otf" \
|
||||
"font/ttf" \
|
||||
"image/bmp" \
|
||||
"image/svg+xml" \
|
||||
"image/vnd.microsoft.icon" \
|
||||
@@ -868,16 +874,15 @@ ServerSignature Off
|
||||
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
# Map the following filename extensions to the specified
|
||||
# encoding type in order to make Apache serve the file types
|
||||
# with the appropriate `Content-Encoding` response header
|
||||
# (do note that this will NOT make Apache compress them!).
|
||||
# Map the following filename extensions to the specified encoding type in
|
||||
# order to make Apache serve the file types with the appropriate
|
||||
# `Content-Encoding` response header (do note that this will NOT make
|
||||
# Apache compress them!).
|
||||
#
|
||||
# If these files types would be served without an appropriate
|
||||
# `Content-Enable` response header, client applications (e.g.:
|
||||
# browsers) wouldn't know that they first need to uncompress
|
||||
# the response, and thus, wouldn't be able to understand the
|
||||
# content.
|
||||
# `Content-Encoding` response header, client applications (e.g.: browsers)
|
||||
# wouldn't know that they first need to uncompress the response, and thus,
|
||||
# wouldn't be able to understand the content.
|
||||
#
|
||||
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding
|
||||
# https://httpd.apache.org/docs/current/mod/mod_mime.html#addencoding
|
||||
@@ -892,15 +897,14 @@ ServerSignature Off
|
||||
# | Brotli pre-compressed content |
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
# Serve brotli compressed CSS, JS, HTML, SVG, ICS and JSON files
|
||||
# if they exist and if the client accepts br encoding.
|
||||
# Serve brotli compressed CSS, JS, HTML, SVG, ICS and JSON files if they exist
|
||||
# and if the client accepts br encoding.
|
||||
#
|
||||
# (!) To make this part relevant, you need to generate encoded
|
||||
# files by your own. Enabling this part will not auto-generate
|
||||
# brotlied files.
|
||||
# (!) To make this part relevant, you need to generate encoded files by your
|
||||
# own. Enabling this part will not auto-generate brotlied files.
|
||||
#
|
||||
# Note that some clients (eg. browsers) require a secure connection
|
||||
# to request brotli-compressed resources.
|
||||
# Note that some clients (eg. browsers) require a secure connection to request
|
||||
# brotli-compressed resources.
|
||||
# https://www.chromestatus.com/feature/5420797577396224
|
||||
#
|
||||
# https://httpd.apache.org/docs/current/mod/mod_brotli.html#precompressed
|
||||
@@ -946,21 +950,19 @@ ServerSignature Off
|
||||
# | GZip pre-compressed content |
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
# Serve gzip compressed CSS, JS, HTML, SVG, ICS and JSON files
|
||||
# if they exist and if the client accepts gzip encoding.
|
||||
# Serve gzip compressed CSS, JS, HTML, SVG, ICS, and JSON files if they exist
|
||||
# and if the client accepts gzip encoding.
|
||||
#
|
||||
# (!) To make this part relevant, you need to generate encoded
|
||||
# files by your own. Enabling this part will not auto-generate
|
||||
# gziped files.
|
||||
# (!) To make this part relevant, you need to generate encoded files by your
|
||||
# own. Enabling this part will not auto-generate gziped files.
|
||||
#
|
||||
# https://httpd.apache.org/docs/current/mod/mod_deflate.html#precompressed
|
||||
#
|
||||
# (1)
|
||||
# Removing default MIME Type for .gz files allowing to add custom
|
||||
# sub-types.
|
||||
# You may prefer using less generic extensions such as .html_gz in
|
||||
# order to keep default behavior regarding .gz files.
|
||||
# https://httpd.apache.org/docs/current/mod/mod_mime.html#removetype
|
||||
# (1) Removing default MIME Type for .gz files allowing to add custom
|
||||
# sub-types.
|
||||
# You may prefer using less generic extensions such as .html_gz in order to
|
||||
# keep the default behavior regarding .gz files.
|
||||
# https://httpd.apache.org/docs/current/mod/mod_mime.html#removetype
|
||||
|
||||
# <IfModule mod_headers.c>
|
||||
|
||||
@@ -1007,20 +1009,29 @@ ServerSignature Off
|
||||
# | Content transformation |
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
# Prevent intermediate caches or proxies (e.g.: such as the ones
|
||||
# used by mobile network providers) from modifying the website's
|
||||
# content.
|
||||
# Prevent intermediate caches or proxies (such as those used by mobile
|
||||
# network providers) and browsers data-saving features from modifying
|
||||
# the website's content using the `cache-control: no-transform` directive.
|
||||
#
|
||||
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
|
||||
# https://tools.ietf.org/html/rfc2616#section-14.9.5
|
||||
# https://tools.ietf.org/html/rfc7234#section-5.2.2.4
|
||||
#
|
||||
# (!) If you are using `mod_pagespeed`, please note that setting
|
||||
# the `Cache-Control: no-transform` response header will prevent
|
||||
# `PageSpeed` from rewriting `HTML` files, and, if the
|
||||
# `ModPagespeedDisableRewriteOnNoTransform` directive isn't set
|
||||
# to `off`, also from rewriting other resources.
|
||||
# (!) Carefully consider the impact on your visitors before disabling
|
||||
# content transformation. These transformations are performed to
|
||||
# improve the experience for data- and cost-constrained users
|
||||
# (e.g. users on a 2G connection).
|
||||
#
|
||||
# https://developers.google.com/speed/pagespeed/module/configuration#notransform
|
||||
# You can test the effects of content transformation applied by
|
||||
# Google's Lite Mode by visiting: https://googleweblight.com/i?u=https://www.example.com
|
||||
#
|
||||
# https://support.google.com/webmasters/answer/6211428
|
||||
#
|
||||
# (!) If you are using `mod_pagespeed`, note that disabling this will
|
||||
# prevent `PageSpeed` from rewriting HTML files, and, if the
|
||||
# `ModPagespeedDisableRewriteOnNoTransform` directive isn't set to
|
||||
# `off`, also from rewriting other resources.
|
||||
#
|
||||
# https://developers.google.com/speed/pagespeed/module/configuration#notransform
|
||||
|
||||
# <IfModule mod_headers.c>
|
||||
# Header merge Cache-Control "no-transform"
|
||||
@@ -1047,11 +1058,10 @@ FileETag None
|
||||
# | Cache expiration |
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
# Serve resources with far-future expiration date.
|
||||
# Serve resources with a far-future expiration date.
|
||||
#
|
||||
# (!) If you don't control versioning with filename-based
|
||||
# cache busting, you should consider lowering the cache times
|
||||
# to something like one week.
|
||||
# (!) If you don't control versioning with filename-based cache busting, you
|
||||
# should consider lowering the cache times to something like one week.
|
||||
#
|
||||
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
|
||||
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expires
|
||||
@@ -1114,6 +1124,7 @@ FileETag None
|
||||
# Media files
|
||||
|
||||
ExpiresByType audio/ogg "access plus 1 month"
|
||||
ExpiresByType image/apng "access plus 1 month"
|
||||
ExpiresByType image/bmp "access plus 1 month"
|
||||
ExpiresByType image/gif "access plus 1 month"
|
||||
ExpiresByType image/jpeg "access plus 1 month"
|
||||
@@ -1169,16 +1180,13 @@ FileETag None
|
||||
|
||||
# Allow concatenation from within specific files.
|
||||
#
|
||||
# e.g.:
|
||||
# If you have the following lines in a file called, for example,
|
||||
# `main.combined.js`:
|
||||
#
|
||||
# If you have the following lines in a file called, for
|
||||
# example, `main.combined.js`:
|
||||
# <!--#include file="js/jquery.js" -->
|
||||
# <!--#include file="js/jquery.timer.js" -->
|
||||
#
|
||||
# <!--#include file="js/jquery.js" -->
|
||||
# <!--#include file="js/jquery.timer.js" -->
|
||||
#
|
||||
# Apache will replace those lines with the content of the
|
||||
# specified files.
|
||||
# Apache will replace those lines with the content of the specified files.
|
||||
|
||||
# <IfModule mod_include.c>
|
||||
|
||||
@@ -1202,17 +1210,16 @@ FileETag None
|
||||
# | Filename-based cache busting |
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
# If you're not using a build process to manage your filename version
|
||||
# revving, you might want to consider enabling the following directives
|
||||
# to route all requests such as `/style.12345.css` to `/style.css`.
|
||||
# If you're not using a build process to manage your filename version revving,
|
||||
# you might want to consider enabling the following directives.
|
||||
#
|
||||
# To understand why this is important and even a better solution than
|
||||
# using something like `*.css?v231`, please see:
|
||||
# To understand why this is important and even a better solution than using
|
||||
# something like `*.css?v231`, please see:
|
||||
# https://www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/
|
||||
|
||||
# <IfModule mod_rewrite.c>
|
||||
# RewriteEngine On
|
||||
# RewriteCond %{REQUEST_FILENAME} !-f
|
||||
# RewriteRule ^(.+)\.(\w+)\.(bmp|css|cur|gif|ico|jpe?g|m?js|png|svgz?|webp|webmanifest)$ $1.$3 [L]
|
||||
# RewriteRule ^(.+)\.(\w+)\.(bmp|css|cur|gif|ico|jpe?g|m?js|a?png|svgz?|webp|webmanifest)$ $1.$3 [L]
|
||||
# </IfModule>
|
||||
|
||||
|
||||
92
dist/404.html
vendored
92
dist/404.html
vendored
@@ -1,60 +1,62 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Page Not Found</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style>
|
||||
<meta charset="utf-8">
|
||||
<title>Page Not Found</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style>
|
||||
* {
|
||||
line-height: 1.2;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
* {
|
||||
line-height: 1.2;
|
||||
margin: 0;
|
||||
}
|
||||
html {
|
||||
color: #888;
|
||||
display: table;
|
||||
font-family: sans-serif;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
html {
|
||||
color: #888;
|
||||
display: table;
|
||||
font-family: sans-serif;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
}
|
||||
body {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
margin: 2em auto;
|
||||
}
|
||||
|
||||
body {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
margin: 2em auto;
|
||||
}
|
||||
h1 {
|
||||
color: #555;
|
||||
font-size: 2em;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #555;
|
||||
font-size: 2em;
|
||||
font-weight: 400;
|
||||
}
|
||||
p {
|
||||
margin: 0 auto;
|
||||
width: 280px;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0 auto;
|
||||
width: 280px;
|
||||
}
|
||||
@media only screen and (max-width: 280px) {
|
||||
|
||||
@media only screen and (max-width: 280px) {
|
||||
body,
|
||||
p {
|
||||
width: 95%;
|
||||
}
|
||||
|
||||
body, p {
|
||||
width: 95%;
|
||||
}
|
||||
h1 {
|
||||
font-size: 1.5em;
|
||||
margin: 0 0 0.3em;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 1.5em;
|
||||
margin: 0 0 0.3em;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</style>
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Page Not Found</h1>
|
||||
<p>Sorry, but the page you were trying to view does not exist.</p>
|
||||
<h1>Page Not Found</h1>
|
||||
<p>Sorry, but the page you were trying to view does not exist.</p>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<!-- IE needs 512+ bytes: https://blogs.msdn.microsoft.com/ieinternals/2010/08/18/friendly-http-error-pages/ -->
|
||||
<!-- IE needs 512+ bytes: https://docs.microsoft.com/archive/blogs/ieinternals/friendly-http-error-pages -->
|
||||
|
||||
16
dist/browserconfig.xml
vendored
16
dist/browserconfig.xml
vendored
@@ -1,12 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Please read: https://msdn.microsoft.com/en-us/library/ie/dn455106.aspx -->
|
||||
<browserconfig>
|
||||
<msapplication>
|
||||
<tile>
|
||||
<square70x70logo src="tile.png"/>
|
||||
<square150x150logo src="tile.png"/>
|
||||
<wide310x150logo src="tile-wide.png"/>
|
||||
<square310x310logo src="tile.png"/>
|
||||
</tile>
|
||||
</msapplication>
|
||||
<msapplication>
|
||||
<tile>
|
||||
<square70x70logo src="tile.png"/>
|
||||
<square150x150logo src="tile.png"/>
|
||||
<wide310x150logo src="tile-wide.png"/>
|
||||
<square310x310logo src="tile.png"/>
|
||||
</tile>
|
||||
</msapplication>
|
||||
</browserconfig>
|
||||
|
||||
109
dist/css/main.css
vendored
109
dist/css/main.css
vendored
@@ -1,6 +1,6 @@
|
||||
/*! HTML5 Boilerplate v7.2.0 | MIT License | https://html5boilerplate.com/ */
|
||||
/*! HTML5 Boilerplate v8.0.0 | MIT License | https://html5boilerplate.com/ */
|
||||
|
||||
/* main.css 2.0.0 | MIT License | https://github.com/h5bp/main.css#readme */
|
||||
/* main.css 2.1.0 | MIT License | https://github.com/h5bp/main.css#readme */
|
||||
/*
|
||||
* What follows is the result of much research on cross-browser styling.
|
||||
* Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
|
||||
@@ -83,17 +83,6 @@ textarea {
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Browser Upgrade Prompt
|
||||
========================================================================== */
|
||||
|
||||
.browserupgrade {
|
||||
margin: 0.2em 0;
|
||||
background: #ccc;
|
||||
color: #000;
|
||||
padding: 0.2em 0;
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Author's custom styles
|
||||
========================================================================== */
|
||||
@@ -106,18 +95,19 @@ textarea {
|
||||
* Hide visually and from screen readers
|
||||
*/
|
||||
|
||||
.hidden {
|
||||
.hidden,
|
||||
[hidden] {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/*
|
||||
* Hide only visually, but have it available for screen readers:
|
||||
* https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
|
||||
*
|
||||
* 1. For long content, line feeds are not interpreted as spaces and small width
|
||||
* causes content to wrap 1 word per line:
|
||||
* https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
|
||||
*/
|
||||
* Hide only visually, but have it available for screen readers:
|
||||
* https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
|
||||
*
|
||||
* 1. For long content, line feeds are not interpreted as spaces and small width
|
||||
* causes content to wrap 1 word per line:
|
||||
* https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
|
||||
*/
|
||||
|
||||
.sr-only {
|
||||
border: 0;
|
||||
@@ -133,10 +123,10 @@ textarea {
|
||||
}
|
||||
|
||||
/*
|
||||
* Extends the .sr-only class to allow the element
|
||||
* to be focusable when navigated to via the keyboard:
|
||||
* https://www.drupal.org/node/897638
|
||||
*/
|
||||
* Extends the .sr-only class to allow the element
|
||||
* to be focusable when navigated to via the keyboard:
|
||||
* https://www.drupal.org/node/897638
|
||||
*/
|
||||
|
||||
.sr-only.focusable:active,
|
||||
.sr-only.focusable:focus {
|
||||
@@ -150,34 +140,32 @@ textarea {
|
||||
}
|
||||
|
||||
/*
|
||||
* Hide visually and from screen readers, but maintain layout
|
||||
*/
|
||||
* Hide visually and from screen readers, but maintain layout
|
||||
*/
|
||||
|
||||
.invisible {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
/*
|
||||
* Clearfix: contain floats
|
||||
*
|
||||
* For modern browsers
|
||||
* 1. The space content is one way to avoid an Opera bug when the
|
||||
* `contenteditable` attribute is included anywhere else in the document.
|
||||
* Otherwise it causes space to appear at the top and bottom of elements
|
||||
* that receive the `clearfix` class.
|
||||
* 2. The use of `table` rather than `block` is only necessary if using
|
||||
* `:before` to contain the top-margins of child elements.
|
||||
*/
|
||||
* Clearfix: contain floats
|
||||
*
|
||||
* For modern browsers
|
||||
* 1. The space content is one way to avoid an Opera bug when the
|
||||
* `contenteditable` attribute is included anywhere else in the document.
|
||||
* Otherwise it causes space to appear at the top and bottom of elements
|
||||
* that receive the `clearfix` class.
|
||||
* 2. The use of `table` rather than `block` is only necessary if using
|
||||
* `:before` to contain the top-margins of child elements.
|
||||
*/
|
||||
|
||||
.clearfix:before,
|
||||
.clearfix:after {
|
||||
.clearfix::before,
|
||||
.clearfix::after {
|
||||
content: " ";
|
||||
/* 1 */
|
||||
display: table;
|
||||
/* 2 */
|
||||
}
|
||||
|
||||
.clearfix:after {
|
||||
.clearfix::after {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
@@ -206,58 +194,67 @@ textarea {
|
||||
|
||||
@media print {
|
||||
*,
|
||||
*:before,
|
||||
*:after {
|
||||
background: transparent !important;
|
||||
*::before,
|
||||
*::after {
|
||||
background: #fff !important;
|
||||
color: #000 !important;
|
||||
/* Black prints faster */
|
||||
-webkit-box-shadow: none !important;
|
||||
box-shadow: none !important;
|
||||
text-shadow: none !important;
|
||||
}
|
||||
|
||||
a,
|
||||
a:visited {
|
||||
text-decoration: underline;
|
||||
}
|
||||
a[href]:after {
|
||||
|
||||
a[href]::after {
|
||||
content: " (" attr(href) ")";
|
||||
}
|
||||
abbr[title]:after {
|
||||
|
||||
abbr[title]::after {
|
||||
content: " (" attr(title) ")";
|
||||
}
|
||||
|
||||
/*
|
||||
* Don't show links that are fragment identifiers,
|
||||
* or use the `javascript:` pseudo protocol
|
||||
*/
|
||||
a[href^="#"]:after,
|
||||
a[href^="javascript:"]:after {
|
||||
* Don't show links that are fragment identifiers,
|
||||
* or use the `javascript:` pseudo protocol
|
||||
*/
|
||||
a[href^="#"]::after,
|
||||
a[href^="javascript:"]::after {
|
||||
content: "";
|
||||
}
|
||||
|
||||
pre {
|
||||
white-space: pre-wrap !important;
|
||||
}
|
||||
|
||||
pre,
|
||||
blockquote {
|
||||
border: 1px solid #999;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
/*
|
||||
* Printing Tables:
|
||||
* https://web.archive.org/web/20180815150934/http://css-discuss.incutio.com/wiki/Printing_Tables
|
||||
*/
|
||||
* Printing Tables:
|
||||
* https://web.archive.org/web/20180815150934/http://css-discuss.incutio.com/wiki/Printing_Tables
|
||||
*/
|
||||
thead {
|
||||
display: table-header-group;
|
||||
}
|
||||
|
||||
tr,
|
||||
img {
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
p,
|
||||
h2,
|
||||
h3 {
|
||||
orphans: 3;
|
||||
widows: 3;
|
||||
}
|
||||
|
||||
h2,
|
||||
h3 {
|
||||
page-break-after: avoid;
|
||||
|
||||
27
dist/doc/TOC.md
vendored
27
dist/doc/TOC.md
vendored
@@ -14,21 +14,24 @@
|
||||
|
||||
## Development
|
||||
|
||||
* [Extending and customizing HTML5 Boilerplate](extend.md) — Going further
|
||||
with the boilerplate.
|
||||
* [Extending and customizing HTML5 Boilerplate](extend.md) — Going further with
|
||||
the boilerplate.
|
||||
|
||||
## Related projects
|
||||
|
||||
The [H5BP organization](https://github.com/h5bp) maintains several projects
|
||||
that complement HTML5 Boilerplate, projects that can help you improve different
|
||||
The [H5BP organization](https://github.com/h5bp) maintains several projects that
|
||||
complement HTML5 Boilerplate, projects that can help you improve different
|
||||
aspects of your website/web app (e.g.: the performance, security, etc.).
|
||||
|
||||
* [Server Configs](https://github.com/h5bp/server-configs) — Fast and
|
||||
smart configurations for web servers such as Apache and Nginx.
|
||||
* [Apache](https://github.com/h5bp/server-configs-apache)
|
||||
* [Google App Engine (GAE)](https://github.com/h5bp/server-configs-gae)
|
||||
* [Internet Information Services (IIS)](https://github.com/h5bp/server-configs-iis)
|
||||
* [lighttpd](https://github.com/h5bp/server-configs-lighttpd)
|
||||
* [Nginx](https://github.com/h5bp/server-configs-nginx)
|
||||
* [Node.js](https://github.com/h5bp/server-configs-node)
|
||||
* [Server Configs](https://github.com/h5bp/server-configs) — Fast and smart
|
||||
configurations for web servers such as Apache and Nginx.
|
||||
* [Apache](https://github.com/h5bp/server-configs-apache)
|
||||
* [Google App Engine (GAE)](https://github.com/h5bp/server-configs-gae)
|
||||
* [Internet Information Services
|
||||
(IIS)](https://github.com/h5bp/server-configs-iis)
|
||||
* [lighttpd](https://github.com/h5bp/server-configs-lighttpd)
|
||||
* [Nginx](https://github.com/h5bp/server-configs-nginx)
|
||||
* [Node.js](https://github.com/h5bp/server-configs-node)
|
||||
* [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
|
||||
* [main.css](https://github.com/h5bp/main.css) — the main.css file included with HTML5 Boilerplate
|
||||
|
||||
27
dist/doc/css.md
vendored
27
dist/doc/css.md
vendored
@@ -8,19 +8,11 @@ HTML5 Boilerplate's CSS includes:
|
||||
* [Normalize.css](#normalizecss)
|
||||
* [main.css](#maincss)
|
||||
|
||||
This starting CSS does not rely on the presence of
|
||||
[conditional class names](https://www.paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/),
|
||||
[conditional style sheets](https://css-tricks.com/how-to-create-an-ie-only-stylesheet/),
|
||||
or [Modernizr](https://modernizr.com/), and it is ready to use no matter what
|
||||
your development preferences happen to be.
|
||||
|
||||
|
||||
## Normalize.css
|
||||
|
||||
In order to make browsers render all elements more consistently and in line
|
||||
with modern standards, we include
|
||||
[Normalize.css](https://necolas.github.io/normalize.css/) — a modern, HTML5-ready
|
||||
alternative to CSS resets.
|
||||
In order to make browsers render all elements more consistently and in line with
|
||||
modern standards, we include Normalize.css — a modern, HTML5-ready alternative
|
||||
to CSS resets.
|
||||
|
||||
As opposed to CSS resets, Normalize.css:
|
||||
|
||||
@@ -32,14 +24,11 @@ As opposed to CSS resets, Normalize.css:
|
||||
* has better documentation
|
||||
|
||||
For more information about Normalize.css, please refer to its [project
|
||||
page](https://necolas.github.com/normalize.css/), as well as this
|
||||
[blog post](http://nicolasgallagher.com/about-normalize-css/).
|
||||
|
||||
page](https://necolas.github.io/normalize.css/).
|
||||
|
||||
## main.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
|
||||
* protect against unwanted `text-shadow` during text highlighting
|
||||
@@ -48,4 +37,8 @@ styles:
|
||||
* style the prompt that is displayed to users using an outdated browser
|
||||
* and more...
|
||||
|
||||
These styles are included in [main.css](https://github.com/h5bp/html5-boilerplate/blob/master/dist/css/main.css). See the [main.css](https://github.com/h5bp/main.css) project [documentation](https://github.com/h5bp/main.css/blob/master/README.md#features) for a full discussion of these styles.
|
||||
These styles are included in
|
||||
[main.css](https://github.com/h5bp/html5-boilerplate/blob/master/dist/css/main.css).
|
||||
See the [main.css](https://github.com/h5bp/main.css) project
|
||||
[documentation](https://github.com/h5bp/main.css/blob/master/README.md#features)
|
||||
for a full discussion of these styles.
|
||||
|
||||
267
dist/doc/extend.md
vendored
267
dist/doc/extend.md
vendored
@@ -4,9 +4,8 @@ table of contents](TOC.md)
|
||||
# Extend and customise HTML5 Boilerplate
|
||||
|
||||
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 everything fits with everyone's needs.
|
||||
|
||||
Boilerplate even better. We don't want to include it all by default, as not
|
||||
everything fits with everyone's needs.
|
||||
|
||||
* [App Stores](#app-stores)
|
||||
* [DNS prefetching](#dns-prefetching)
|
||||
@@ -24,8 +23,11 @@ not everything fits with everyone's needs.
|
||||
|
||||
### Smart App Banners in iOS 6+ Safari
|
||||
|
||||
Stop bothering everyone with gross modals advertising your entry in the
|
||||
App Store. Including the following [meta tag](https://developer.apple.com/library/content/documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html) will unobtrusively give the user the option to download your iOS app, or open it with some data about the user's current state on the website.
|
||||
Stop bothering everyone with gross modals advertising your entry in the App
|
||||
Store. Including the following [meta
|
||||
tag](https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html)
|
||||
will unobtrusively give the user the option to download your iOS app, or open it
|
||||
with some data about the user's current state on the website.
|
||||
|
||||
```html
|
||||
<meta name="apple-itunes-app" content="app-id=APP_ID,app-argument=SOME_TEXT">
|
||||
@@ -35,42 +37,29 @@ App Store. Including the following [meta tag](https://developer.apple.com/librar
|
||||
|
||||
In short, DNS Prefetching is a method of informing the browser of domain names
|
||||
referenced on a site so that the client can resolve the DNS for those hosts,
|
||||
cache them, and when it comes time to use them, have a faster turn around on
|
||||
the request.
|
||||
cache them, and when it comes time to use them, have a faster turn around on the
|
||||
request.
|
||||
|
||||
### Implicit prefetches
|
||||
|
||||
There is a lot of prefetching done for you automatically by the browser. When
|
||||
the browser encounters an anchor in your html that does not share the same
|
||||
domain name as the current location the browser requests, from the client OS,
|
||||
the IP address for this new domain. The client first checks its cache and
|
||||
then, lacking a cached copy, makes a request from a DNS server. These requests
|
||||
happen in the background and are not meant to block the rendering of the
|
||||
page.
|
||||
the IP address for this new domain. The client first checks its cache and then,
|
||||
lacking a cached copy, makes a request from a DNS server. These requests happen
|
||||
in the background and are not meant to block the rendering of the page.
|
||||
|
||||
The goal of this is that when the foreign IP address is finally needed it will
|
||||
already be in the client cache and will not block the loading of the foreign
|
||||
content. Fewer requests result in faster page load times. The perception of this
|
||||
is increased on a mobile platform where DNS latency can be greater.
|
||||
|
||||
#### Disable implicit prefetching
|
||||
|
||||
```html
|
||||
<meta http-equiv="x-dns-prefetch-control" content="off">
|
||||
```
|
||||
|
||||
Even with X-DNS-Prefetch-Control meta tag (or http header) browsers will still
|
||||
prefetch any explicit dns-prefetch links.
|
||||
|
||||
**_WARNING:_** THIS MAY MAKE YOUR SITE SLOWER IF YOU RELY ON RESOURCES FROM
|
||||
FOREIGN DOMAINS.
|
||||
|
||||
### Explicit prefetches
|
||||
|
||||
Typically the browser only scans the HTML for foreign domains. If you have
|
||||
resources that are outside of your HTML (a javascript request to a remote
|
||||
server or a CDN that hosts content that may not be present on every page of
|
||||
your site, for example) then you can queue up a domain name to be prefetched.
|
||||
resources that are outside of your HTML (a javascript request to a remote server
|
||||
or a CDN that hosts content that may not be present on every page of your site,
|
||||
for example) then you can queue up a domain name to be prefetched.
|
||||
|
||||
```html
|
||||
<link rel="dns-prefetch" href="//example.com">
|
||||
@@ -80,8 +69,8 @@ your site, for example) then you can queue up a domain name to be prefetched.
|
||||
You can use as many of these as you need, but it's best if they are all
|
||||
immediately after the [Meta
|
||||
Charset](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#attr-charset)
|
||||
element (which should go right at the top of the `head`), so the browser can
|
||||
act on them ASAP.
|
||||
element (which should go right at the top of the `head`), so the browser can act
|
||||
on them ASAP.
|
||||
|
||||
#### Common Prefetch Links
|
||||
|
||||
@@ -108,8 +97,7 @@ Microsoft Ajax Content Delivery Network:
|
||||
|
||||
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-DNS-Prefetch-Control
|
||||
* https://dev.chromium.org/developers/design-documents/dns-prefetching
|
||||
* https://blogs.msdn.microsoft.com/ie/2011/03/17/internet-explorer-9-network-performance-improvements/
|
||||
|
||||
* https://docs.microsoft.com/en-us/archive/blogs/ie/internet-explorer-9-network-performance-improvements
|
||||
|
||||
## Google Universal Analytics
|
||||
|
||||
@@ -126,23 +114,9 @@ ga('create', 'UA-XXXXX-X', 'auto'); ga('send', 'pageview');
|
||||
To customize further, see Google's [Advanced
|
||||
Setup](https://developers.google.com/analytics/devguides/collection/analyticsjs/),
|
||||
[Pageview](https://developers.google.com/analytics/devguides/collection/analyticsjs/pages),
|
||||
and [Event](https://developers.google.com/analytics/devguides/collection/analyticsjs/events) Docs.
|
||||
|
||||
### Anonymize IP addresses
|
||||
|
||||
In some countries, no personal data may be transferred outside jurisdictions
|
||||
that do not have similarly strict laws (i.e. from Germany to outside the EU).
|
||||
Thus a webmaster using the Google Universal Analytics may have to ensure that
|
||||
no personal (trackable) data is transferred to the US. You can do that with
|
||||
[the `ga('set', 'anonymizeIp', true);`
|
||||
parameter](https://developers.google.com/analytics/devguides/collection/analyticsjs/advanced#anonymizeip)
|
||||
before sending any events/pageviews. In use it looks like this:
|
||||
|
||||
```js
|
||||
ga('create', 'UA-XXXXX-X', 'auto');
|
||||
ga('set', 'anonymizeIp', true);
|
||||
ga('send', 'pageview');
|
||||
```
|
||||
and
|
||||
[Event](https://developers.google.com/analytics/devguides/collection/analyticsjs/events)
|
||||
Docs.
|
||||
|
||||
### Track jQuery AJAX requests in Google Analytics
|
||||
|
||||
@@ -190,7 +164,7 @@ Add this function after `ga` is defined:
|
||||
|
||||
### Track page scroll
|
||||
|
||||
Add this function after `ga` is defined:
|
||||
Add this function after `ga` is defined. Note, the following snippet requires jQuery.
|
||||
|
||||
```js
|
||||
$(function(){
|
||||
@@ -218,8 +192,9 @@ $(function(){
|
||||
|
||||
Enabling your application for pinning will allow IE users to add it to their
|
||||
Windows Taskbar and Start Menu. This comes with a range of new tools that you
|
||||
can easily configure with the elements below. See more [documentation on IE
|
||||
Pinned Sites](https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/samples/gg491731(v%3dvs.85)).
|
||||
can easily configure with the elements below. See more [documentation on IE
|
||||
Pinned
|
||||
Sites](https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/samples/gg491731(v%3dvs.85)).
|
||||
|
||||
### Name the Pinned Site for Windows
|
||||
|
||||
@@ -253,8 +228,8 @@ track the number of pinned users, like so:
|
||||
### Recolor IE's controls manually for a Pinned Site
|
||||
|
||||
IE will automatically use the overall color of your Pinned Site's favicon to
|
||||
shade its browser buttons. UNLESS you give it another color here. Only use
|
||||
named colors (`red`) or hex colors (`#ff0000`).
|
||||
shade its browser buttons. UNLESS you give it another color here. Only use named
|
||||
colors (`red`) or hex colors (`#ff0000`).
|
||||
|
||||
```html
|
||||
<meta name="msapplication-navbutton-color" content="#ff0000">
|
||||
@@ -263,8 +238,7 @@ named colors (`red`) or hex colors (`#ff0000`).
|
||||
### Manually set the window size of a Pinned Site
|
||||
|
||||
If the site should open at a certain window size once pinned, you can specify
|
||||
the dimensions here. It only supports static pixel dimensions. 800x600
|
||||
minimum.
|
||||
the dimensions here. It only supports static pixel dimensions. 800x600 minimum.
|
||||
|
||||
```html
|
||||
<meta name="msapplication-window" content="width=800;height=600">
|
||||
@@ -274,8 +248,7 @@ minimum.
|
||||
|
||||
Add Jump List Tasks that will appear when the Pinned Site's icon gets a
|
||||
right-click. Each Task goes to the specified URL, and gets its own mini icon
|
||||
(essentially a favicon, a 16x16 .ICO). You can add as many of these as you
|
||||
need.
|
||||
(essentially a favicon, a 16x16 .ICO). You can add as many of these as you need.
|
||||
|
||||
```html
|
||||
<meta name="msapplication-task" content="name=Task 1;action-uri=http://host/Page1.html;icon-uri=http://host/icon1.ico">
|
||||
@@ -286,42 +259,31 @@ need.
|
||||
|
||||
Windows 8 adds the ability for you to provide a PNG tile image and specify the
|
||||
tile's background color. [Full details on the IE
|
||||
blog](https://blogs.msdn.microsoft.com/ie/2012/06/08/high-quality-visuals-for-pinned-sites-in-windows-8/).
|
||||
blog](https://docs.microsoft.com/en-us/archive/blogs/ie/high-quality-visuals-for-pinned-sites-in-windows-8).
|
||||
|
||||
* Create a 144x144 image of your site icon, filling all of the canvas, and
|
||||
using a transparent background.
|
||||
* Save this image as a 32-bit PNG and optimize it without reducing
|
||||
colour-depth. It can be named whatever you want (e.g. `metro-tile.png`).
|
||||
* To reference the tile and its color, add the HTML `meta` elements described
|
||||
in the IE Blog post.
|
||||
* Create a 144x144 image of your site icon, filling all of the canvas, and using
|
||||
a transparent background.
|
||||
* Save this image as a 32-bit PNG and optimize it without reducing colour-depth.
|
||||
It can be named whatever you want (e.g. `metro-tile.png`).
|
||||
* To reference the tile and its color, add the HTML `meta` elements described in
|
||||
the IE Blog post.
|
||||
|
||||
### (Windows 8) Badges for Pinned Sites
|
||||
|
||||
IE will poll an XML document for badge information to display on your app's
|
||||
tile in the Start screen. The user will be able to receive these badge updates
|
||||
even when your app isn't actively running. The badge's value can be a number,
|
||||
or one of a predefined list of glyphs.
|
||||
IE will poll an XML document for badge information to display on your app's tile
|
||||
in the Start screen. The user will be able to receive these badge updates even
|
||||
when your app isn't actively running. The badge's value can be a number, or one
|
||||
of a predefined list of glyphs.
|
||||
|
||||
* [Tutorial on IEBlog with link to badge XML schema](https://blogs.msdn.microsoft.com/ie/2012/04/03/pinned-sites-in-windows-8/)
|
||||
* [Available badge values](https://docs.microsoft.com/en-us/uwp/schemas/tiles/badgeschema/element-badge)
|
||||
* [Tutorial on IEBlog with link to badge XML
|
||||
schema](https://docs.microsoft.com/en-us/archive/blogs/ie/pinned-sites-in-windows-8)
|
||||
* [Available badge
|
||||
values](https://docs.microsoft.com/en-us/uwp/schemas/tiles/badgeschema/element-badge)
|
||||
|
||||
```html
|
||||
<meta name="msapplication-badge" value="frequency=NUMBER_IN_MINUTES;polling-uri=https://www.example.com/path/to/file.xml">
|
||||
```
|
||||
|
||||
### Disable link highlighting upon tap in IE10
|
||||
|
||||
Similar to [-webkit-tap-highlight-color](https://davidwalsh.name/mobile-highlight-color)
|
||||
in iOS Safari. Unlike that CSS property, this is an HTML meta element, and its
|
||||
value is boolean rather than a color. It's all or nothing.
|
||||
|
||||
```html
|
||||
<meta name="msapplication-tap-highlight" content="no" />
|
||||
```
|
||||
|
||||
You can read about this useful element and more techniques in
|
||||
[Microsoft's documentation on adapting WebKit-oriented apps for IE10](https://blogs.windows.com/buildingapps/2012/11/15/adapting-your-webkit-optimized-site-for-internet-explorer-10/)
|
||||
|
||||
## Search
|
||||
|
||||
### Direct search spiders to your sitemap
|
||||
@@ -332,9 +294,8 @@ Submit it to search engine tool:
|
||||
* [Google](https://www.google.com/webmasters/tools/sitemap-list)
|
||||
* [Bing](https://www.bing.com/toolbox/webmaster)
|
||||
* [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:
|
||||
* [Baidu](https://zhanzhang.baidu.com/) OR Insert the following line anywhere in
|
||||
your robots.txt file, specifying the path to your sitemap:
|
||||
```
|
||||
Sitemap: https://example.com/sitemap_location.xml
|
||||
```
|
||||
@@ -365,17 +326,14 @@ plugin](https://www.google.com/search?ie=UTF-8&q=how+to+make+browser+search+plug
|
||||
|
||||
## Miscellaneous
|
||||
|
||||
* Use [polyfills](https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills).
|
||||
* Use
|
||||
[polyfills](https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills).
|
||||
|
||||
* Use [Microformats](http://microformats.org/wiki/Main_Page) (via
|
||||
[microdata](http://microformats.org/wiki/microdata)) for optimum search
|
||||
results
|
||||
[visibility](https://webmasters.googleblog.com/2009/05/introducing-rich-snippets.html).
|
||||
|
||||
* If you're building a web app you may want [native style momentum scrolling in
|
||||
iOS 5+](https://www.johanbrook.com/writings/native-style-momentum-scrolling-to-arrive-in-ios-5/)
|
||||
using `-webkit-overflow-scrolling: touch`.
|
||||
|
||||
* If you want to disable the translation prompt in Chrome or block Google
|
||||
Translate from translating your web page, use [`<meta name="google"
|
||||
content="notranslate">`](https://support.google.com/webmasters/answer/79812).
|
||||
@@ -396,7 +354,7 @@ plugin](https://www.google.com/search?ie=UTF-8&q=how+to+make+browser+search+plug
|
||||
### RSS
|
||||
|
||||
Have an RSS feed? Link to it here. Want to [learn how to write an RSS feed from
|
||||
scratch](http://www.rssboard.org/rss-specification)?
|
||||
scratch](https://www.rssboard.org/rss-specification)?
|
||||
|
||||
```html
|
||||
<link rel="alternate" type="application/rss+xml" title="RSS" href="/rss.xml">
|
||||
@@ -404,8 +362,8 @@ scratch](http://www.rssboard.org/rss-specification)?
|
||||
|
||||
### Atom
|
||||
|
||||
Atom is similar to RSS, and you might prefer to use it instead of or in
|
||||
addition to it. [See what Atom's all
|
||||
Atom is similar to RSS, and you might prefer to use it instead of or in addition
|
||||
to it. [See what Atom's all
|
||||
about](https://en.wikipedia.org/wiki/Atom_(Web_standard)).
|
||||
|
||||
```html
|
||||
@@ -414,16 +372,19 @@ about](https://en.wikipedia.org/wiki/Atom_(Web_standard)).
|
||||
|
||||
### Pingbacks
|
||||
|
||||
Your server may be notified when another site links to yours. The href
|
||||
attribute should contain the location of your pingback service.
|
||||
Your server may be notified when another site links to yours. The href attribute
|
||||
should contain the location of your pingback service.
|
||||
|
||||
```html
|
||||
<link rel="pingback" href="">
|
||||
```
|
||||
|
||||
* High-level explanation: https://codex.wordpress.org/Introduction_to_Blogging#Pingbacks
|
||||
* Step-by-step example case: https://www.hixie.ch/specs/pingback/pingback-1.0#TOC5
|
||||
* PHP pingback service: https://web.archive.org/web/20131211032834/http://blog.perplexedlabs.com/2009/07/15/xmlrpc-pingbacks-using-php/
|
||||
* High-level explanation:
|
||||
https://codex.wordpress.org/Introduction_to_Blogging#Pingbacks
|
||||
* Step-by-step example case:
|
||||
https://www.hixie.ch/specs/pingback/pingback-1.0#TOC5
|
||||
* PHP pingback service:
|
||||
https://web.archive.org/web/20131211032834/http://blog.perplexedlabs.com/2009/07/15/xmlrpc-pingbacks-using-php/
|
||||
|
||||
|
||||
|
||||
@@ -440,11 +401,11 @@ Take full advantage of Facebook's support for complex data and activity by
|
||||
following the [Open Graph
|
||||
tutorial](https://developers.facebook.com/docs/sharing/webmasters/getting-started).
|
||||
|
||||
For a reference of Open Graph's markup and properties, you may check
|
||||
[Facebook's Open Graph Protocol reference](http://ogp.me/). Finally,
|
||||
you can validate your markup with the [Facebook Object
|
||||
Debugger](https://developers.facebook.com/tools/debug/) (needs
|
||||
registration to Facebook).
|
||||
For a reference of Open Graph's markup and properties, you may check [Facebook's
|
||||
Open Graph Protocol reference](https://ogp.me). Finally, you can validate your
|
||||
markup with the [Facebook Object
|
||||
Debugger](https://developers.facebook.com/tools/debug/) (needs registration to
|
||||
Facebook).
|
||||
|
||||
```html
|
||||
<meta property="fb:app_id" content="123456789">
|
||||
@@ -460,11 +421,13 @@ registration to Facebook).
|
||||
### Twitter Cards
|
||||
|
||||
Twitter provides a snippet specification that serves a similar purpose to Open
|
||||
Graph. In fact, Twitter will use Open Graph when Cards is not available. You
|
||||
can read more about the various snippet formats and application process in the
|
||||
[official Twitter Cards documentation](https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/abouts-cards),
|
||||
and you can validate your markup with the [Card validator](https://cards-dev.twitter.com/validator)
|
||||
(needs registration to Twitter).
|
||||
Graph. In fact, Twitter will use Open Graph when Cards is not available. You can
|
||||
read more about the various snippet formats in the
|
||||
[official Twitter Cards
|
||||
documentation](https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/abouts-cards),
|
||||
and you can validate your markup with the [Card
|
||||
validator](https://cards-dev.twitter.com/validator) (needs registration to
|
||||
Twitter).
|
||||
|
||||
```html
|
||||
<meta name="twitter:card" content="summary">
|
||||
@@ -476,31 +439,29 @@ and you can validate your markup with the [Card validator](https://cards-dev.twi
|
||||
<meta name="twitter:image" content="https://www.example.com/path/to/image.jpg">
|
||||
```
|
||||
|
||||
### Google+ / Schema.org
|
||||
### Schema.org
|
||||
|
||||
Google also provides a snippet specification that serves a similar
|
||||
purpose to Facebook's Open Graph or Twitter Cards. While it helps you
|
||||
to control information displayed on Google+, this metadata is a subset
|
||||
of [schema.org's microdata vocabulary](https://schema.org/), which
|
||||
covers many other schemas that can describe the content of your pages
|
||||
to search engines. For this reason, this metadata is more generic for
|
||||
SEO, notably for Google's search-engine, although this vocabulary is
|
||||
also used by Microsoft, Pinterest and Yandex.
|
||||
Google also provides a snippet specification that serves a similar purpose to
|
||||
Facebook's Open Graph or Twitter Cards. This metadata is a subset of
|
||||
[schema.org's microdata vocabulary](https://schema.org/), which covers many
|
||||
other schemas that can describe the content of your pages to search engines. For
|
||||
this reason, this metadata is more generic for SEO, notably for Google's
|
||||
search-engine, although this vocabulary is also used by Microsoft, Pinterest and
|
||||
Yandex.
|
||||
|
||||
You can validate your markup with the [Structured Data Testing
|
||||
Tool](https://developers.google.com/structured-data/testing-tool/).
|
||||
Also, please note that this markup requires to add attributes to your
|
||||
top `html` tag.
|
||||
Tool](https://search.google.com/structured-data/testing-tool). Also, please
|
||||
note that this markup requires to add attributes to your top `html` tag.
|
||||
|
||||
```html
|
||||
<html class="no-js" lang="" itemscope itemtype="http://schema.org/Article">
|
||||
<head>
|
||||
<html class="no-js" lang="" itemscope itemtype="https://schema.org/Article">
|
||||
<head>
|
||||
|
||||
<link rel="author" href="">
|
||||
<link rel="publisher" href="">
|
||||
<meta itemprop="name" content="">
|
||||
<meta itemprop="description" content="">
|
||||
<meta itemprop="image" content="">
|
||||
<link rel="author" href="">
|
||||
<link rel="publisher" href="">
|
||||
<meta itemprop="name" content="">
|
||||
<meta itemprop="description" content="">
|
||||
<meta itemprop="image" content="">
|
||||
```
|
||||
|
||||
## URLs
|
||||
@@ -519,15 +480,16 @@ the cleaner, more accurate `https://www.example.com/cart.html`.
|
||||
### Separate mobile URLs
|
||||
|
||||
If you use separate URLs for desktop and mobile users, you should consider
|
||||
helping search engine algorithms better understand the configuration on your
|
||||
web site.
|
||||
helping search engine algorithms better understand the configuration on your web
|
||||
site.
|
||||
|
||||
This can be done by adding the following annotations in your HTML pages:
|
||||
|
||||
* on the desktop page, add the `link rel="alternate"` tag pointing to the
|
||||
corresponding mobile URL, e.g.:
|
||||
|
||||
`<link rel="alternate" media="only screen and (max-width: 640px)" href="https://m.example.com/page.html" >`
|
||||
`<link rel="alternate" media="only screen and (max-width: 640px)"
|
||||
href="https://m.example.com/page.html" >`
|
||||
|
||||
* on the mobile page, add the `link rel="canonical"` tag pointing to the
|
||||
corresponding desktop URL, e.g.:
|
||||
@@ -545,8 +507,8 @@ There are a couple of meta tags that provide information about a web app when
|
||||
added to the Home Screen on iOS:
|
||||
|
||||
* 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
|
||||
default view by adding `apple-mobile-web-app-status-bar-style`.
|
||||
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`.
|
||||
|
||||
```html
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
@@ -554,25 +516,25 @@ default view by adding `apple-mobile-web-app-status-bar-style`.
|
||||
```
|
||||
|
||||
* You can use `apple-mobile-web-app-title` to add a specific sites name for the
|
||||
Home Screen icon. This works since iOS 6.
|
||||
Home Screen icon.
|
||||
|
||||
```html
|
||||
<meta name="apple-mobile-web-app-title" content="">
|
||||
```
|
||||
|
||||
For further information please read the [official
|
||||
documentation](https://developer.apple.com/library/safari/#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.
|
||||
|
||||
|
||||
### Apple Touch Icons
|
||||
|
||||
Apple touch icons are used as icons when a user adds your webapp to the home
|
||||
screen of aniOS devices.
|
||||
Apple touch icons are used as icons when a user adds your webapp to the home
|
||||
screen of an iOS devices.
|
||||
|
||||
Though the dimensions of the icon can vary between iOS devices and versions
|
||||
one `180×180px` touch icon named `icon.png` and including the following in
|
||||
the `<head>` of the page is enough:
|
||||
Though the dimensions of the icon can vary between iOS devices and versions one
|
||||
`180×180px` touch icon named `icon.png` and including the following in the
|
||||
`<head>` of the page is enough:
|
||||
|
||||
```html
|
||||
<link rel="apple-touch-icon" href="icon.png">
|
||||
@@ -587,8 +549,8 @@ Icons](https://mathiasbynens.be/notes/touch-icons).
|
||||
Apart from that it is possible to add start-up screens for web apps on iOS. This
|
||||
basically works by defining `apple-touch-startup-image` with an according link
|
||||
to the image. Since iOS devices have different screen resolutions it maybe
|
||||
necessary to add media queries to detect which image to load. Here is an
|
||||
example for an iPhone:
|
||||
necessary to add media queries to detect which image to load. Here is an example
|
||||
for an iPhone:
|
||||
|
||||
```html
|
||||
<link rel="apple-touch-startup-image" media="(max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)" href="img/startup.png">
|
||||
@@ -613,10 +575,11 @@ Same applies to the touch icons:
|
||||
|
||||
### Theme Color
|
||||
|
||||
You can add the [`theme-color` meta extension](https://html.spec.whatwg.org/multipage/semantics.html#meta-theme-color)
|
||||
in the `<head>` of your pages to suggest the color that browsers and
|
||||
OSes should use if they customize the display of individual pages in
|
||||
their UIs with varying colors.
|
||||
You can add the [`theme-color` meta
|
||||
extension](https://html.spec.whatwg.org/multipage/semantics.html#meta-theme-color)
|
||||
in the `<head>` of your pages to suggest the color that browsers and OSes should
|
||||
use if they customize the display of individual pages in their UIs with varying
|
||||
colors.
|
||||
|
||||
```html
|
||||
<meta name="theme-color" content="#ff69b4">
|
||||
@@ -624,17 +587,19 @@ their UIs with varying colors.
|
||||
|
||||
The `content` attribute extension can take any valid CSS color.
|
||||
|
||||
Currently, the `theme-color` meta extension is supported by [Chrome 39+
|
||||
for Android Lollipop](https://developers.google.com/web/updates/2014/11/Support-for-theme-color-in-Chrome-39-for-Android).
|
||||
Currently, the `theme-color` meta extension is supported by [Chrome 39+ for
|
||||
Android
|
||||
Lollipop](https://developers.google.com/web/updates/2014/11/Support-for-theme-color-in-Chrome-39-for-Android).
|
||||
|
||||
|
||||
## security.txt
|
||||
|
||||
When security risks in web services are discovered by users they often lack the
|
||||
channels to disclose them properly. As a result, security issues may be left unreported.
|
||||
channels to disclose them properly. As a result, security issues may be left
|
||||
unreported.
|
||||
|
||||
Security.txt defines a standard to help organizations define the process for
|
||||
users to disclose security vulnerabilities securely. Include a text
|
||||
file on your server at `.well-known/security.txt` with the relevant contact details.
|
||||
Security.txt defines a standard to help organizations define the process for
|
||||
users to disclose security vulnerabilities securely. Include a text file on your
|
||||
server at `.well-known/security.txt` with the relevant contact details.
|
||||
|
||||
Check [https://securitytxt.org/](https://securitytxt.org/) for more details.
|
||||
|
||||
34
dist/doc/faq.md
vendored
34
dist/doc/faq.md
vendored
@@ -4,9 +4,8 @@ table of contents](TOC.md)
|
||||
# Frequently asked questions
|
||||
|
||||
* [Why is the Google Analytics code at the bottom? Google recommends it be
|
||||
placed in the `<head>`.](#why-is-the-google-analytics-code-at-the-bottom-google-recommends-it-be-placed-in-the-head)
|
||||
* [How can I integrate Bootstrap with HTML5
|
||||
Boilerplate?](#how-can-i-integrate-bootstrap-with-html5-boilerplate)
|
||||
placed in the
|
||||
`<head>`.](#why-is-the-google-analytics-code-at-the-bottom-google-recommends-it-be-placed-in-the-head)
|
||||
* [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)
|
||||
* [Where can I get help with support
|
||||
@@ -14,29 +13,30 @@ table of contents](TOC.md)
|
||||
|
||||
---
|
||||
|
||||
### Why is the Google Analytics code at the bottom? Google recommends it be placed in the `<head>`.
|
||||
## Why is the Google Analytics code at the bottom? Google recommends it be placed in the `<head>`.
|
||||
|
||||
The main advantage of placing it in the `<head>` is that you will track the
|
||||
user's `pageview` even if they leave the page before it has been fully loaded.
|
||||
|
||||
Here's a handy quote from [Mathias Bynens](https://mathiasbynens.be/notes/async-analytics-snippet#comment-50) about our placement choice.
|
||||
Here's a handy quote from [Mathias
|
||||
Bynens](https://mathiasbynens.be/notes/async-analytics-snippet#comment-50) about
|
||||
our placement choice.
|
||||
>I should point out that it’s Google — not me — recommending to place this
|
||||
script before all other scripts in the document. The only real advantage is to
|
||||
catch a pageView call if your page fails to load completely (for example, if
|
||||
the user aborts loading, or quickly closes the page, etc.). Personally, I
|
||||
wouldn’t count that as a page view, so I actually prefer to place this script
|
||||
at the bottom, after all other scripts. This keeps all the scripts together and
|
||||
reinforces that scripts at the bottom are the right move. (Usually I
|
||||
concatenate and minify all my scripts into one .js file — the GA snippet being
|
||||
the suffix.)
|
||||
catch a pageView call if your page fails to load completely (for example, if the
|
||||
user aborts loading, or quickly closes the page, etc.). Personally, I wouldn’t
|
||||
count that as a page view, so I actually prefer to place this script at the
|
||||
bottom, after all other scripts. This keeps all the scripts together and
|
||||
reinforces that scripts at the bottom are the right move. (Usually I concatenate
|
||||
and minify all my scripts into one .js file — the GA snippet being the suffix.)
|
||||
|
||||
### 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?
|
||||
|
||||
No, just as you don't normally replace the foundation of a house once it
|
||||
was built. However, there is nothing stopping you from trying to work in the
|
||||
latest changes, but you'll have to assess the costs/benefits of doing so.
|
||||
No, just as you don't normally replace the foundation of a house once it was
|
||||
built. However, there is nothing stopping you from trying to work in the latest
|
||||
changes, but you'll have to assess the costs/benefits of doing so.
|
||||
|
||||
### Where can I get help with support questions?
|
||||
## Where can I get help with support questions?
|
||||
|
||||
Please ask for help on
|
||||
[StackOverflow](https://stackoverflow.com/questions/tagged/html5boilerplate).
|
||||
|
||||
264
dist/doc/html.md
vendored
264
dist/doc/html.md
vendored
@@ -9,22 +9,20 @@ By default, HTML5 Boilerplate provides two `html` pages:
|
||||
basis of all pages on your website
|
||||
* `404.html` - a placeholder 404 error page
|
||||
|
||||
|
||||
## `index.html`
|
||||
|
||||
|
||||
### The `no-js` Class
|
||||
|
||||
The `no-js` class is provided in order to allow you to more easily and
|
||||
explicitly add custom styles based on whether JavaScript is disabled
|
||||
(`.no-js`) or enabled (`.js`). Using this technique also helps [avoid the
|
||||
explicitly add custom styles based on whether JavaScript is disabled (`.no-js`)
|
||||
or enabled (`.js`). Using this technique also helps [avoid the
|
||||
FOUC](https://www.paulirish.com/2009/avoiding-the-fouc-v3/).
|
||||
|
||||
### Language Attribute
|
||||
|
||||
## Language Attribute
|
||||
|
||||
Please consider specifying the language of your content by adding a [value](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry) to the `lang`
|
||||
attribute in the `<html>` as in this example:
|
||||
Please consider specifying the language of your content by adding a
|
||||
[value](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry)
|
||||
to the `lang` attribute in the `<html>` as in this example:
|
||||
|
||||
```html
|
||||
<html class="no-js" lang="en">
|
||||
@@ -32,174 +30,224 @@ attribute in the `<html>` as in this example:
|
||||
|
||||
### The order of the `<title>` and `<meta>` tags
|
||||
|
||||
The charset declaration (`<meta charset="utf-8">`) must be included completely
|
||||
within the [first 1024 bytes of the document](https://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#charset)
|
||||
and should be specified as early as possible (before any content that could
|
||||
be controlled by an attacker, such as a `<title>` element) in order to avoid a
|
||||
potential [encoding-related security issue](https://code.google.com/archive/p/doctype-mirror/wikis/ArticleUtf7.wiki)
|
||||
The charset declaration (`<meta charset="utf-8">`) must be included completely
|
||||
within the [first 1024 bytes of the
|
||||
document](https://html.spec.whatwg.org/multipage/semantics.html#charset)
|
||||
and should be specified as early as possible (before any content that could be
|
||||
controlled by an attacker, such as a `<title>` element) in order to avoid a
|
||||
potential [encoding-related security
|
||||
issue](https://code.google.com/archive/p/doctype-mirror/wikis/ArticleUtf7.wiki)
|
||||
in Internet Explorer
|
||||
|
||||
## Meta Description
|
||||
### Meta Description
|
||||
|
||||
The `description` meta tag provides a short description of the page.
|
||||
In some situations this description is used as a part of the snippet
|
||||
shown in the search results.
|
||||
The `description` meta tag provides a short description of the page. In some
|
||||
situations this description is used as a part of the snippet shown in the search
|
||||
results.
|
||||
|
||||
```html
|
||||
<meta name="description" content="This is a description">
|
||||
```
|
||||
|
||||
Google's [Create good meta descriptions](https://support.google.com/webmasters/answer/35624?hl=en#meta-descriptions)
|
||||
Google's [Create good meta
|
||||
descriptions](https://support.google.com/webmasters/answer/35624?hl=en#meta-descriptions)
|
||||
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 [`viewport` meta
|
||||
tag](https://docs.google.com/present/view?id=dkx3qtm_22dxsrgcf4 "Viewport and
|
||||
Media Queries - The Complete Idiot's Guide"). You can find out more in [the
|
||||
MDN Web Docs](https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag).
|
||||
HTML5 Boilerplate comes with a simple setup that strikes a good balance for general use cases.
|
||||
Media Queries - The Complete Idiot's Guide"). You can find out more in [the MDN
|
||||
Web
|
||||
Docs](https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag).
|
||||
HTML5 Boilerplate comes with a simple setup that strikes a good balance for
|
||||
general use cases.
|
||||
|
||||
```html
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
```
|
||||
|
||||
If you want to take advantage of edge-to-edge displays of iPhone X/XS/XR you can do
|
||||
so with additional viewport parameters. [Check the WebKit blog](https://webkit.org/blog/7929/designing-websites-for-iphone-x/)
|
||||
for details.
|
||||
If you want to take advantage of edge-to-edge displays of iPhone X/XS/XR you
|
||||
can do so with additional viewport parameters. [Check the WebKit
|
||||
blog](https://webkit.org/blog/7929/designing-websites-for-iphone-x/) for
|
||||
details.
|
||||
|
||||
## Web App Manifest
|
||||
### Open Graph Metadata
|
||||
|
||||
HTML5 Boilerplate includes a simple web app manifest file.
|
||||
The [Open Graph Protocol](https://ogp.me/) allows you to define the way your
|
||||
site is presented when referenced on third party sites and applications
|
||||
(Facebook, Twitter, LinkedIn). The protocol provides a series of meta elements
|
||||
that define the details of your site. The required attributes define the title,
|
||||
preview image, URL, and [type](https://ogp.me/#types) (e.g., video, music,
|
||||
website, article).
|
||||
|
||||
The web app manifest is a simple JSON file that allows you to control how your
|
||||
app appears on a device's home screen, what it looks like when it launches
|
||||
in that context and what happens when it is launched. This allows for much greater
|
||||
control over the UI of a saved site or web app on a mobile device.
|
||||
``` html
|
||||
<meta property="og:title" content="">
|
||||
<meta property="og:type" content="">
|
||||
<meta property="og:url" content="">
|
||||
<meta property="og:image" content="">
|
||||
```
|
||||
|
||||
In addition to these four attributes there are many more attributes you can use
|
||||
to add more richness to the description of your site. This just represents the
|
||||
most basic implementation.
|
||||
|
||||
To see a working example, the following is the open graph metadata for the HTML5
|
||||
Boilerplate site. In addition to the required fields we add `og:description` to
|
||||
describe the site in more detail.
|
||||
|
||||
``` html
|
||||
<meta name="og:url" content="https://html5boilerplate.com/">
|
||||
<meta name="og:title" content="HTML5 ★ BOILERPLATE">
|
||||
<meta name="og:type" content="website">
|
||||
<meta name="og:description" content="The web’s most popular front-end template which helps you build fast, robust, and adaptable web apps or sites.">
|
||||
<meta name="og:image" content="https://html5boilerplate.com/icon.png">
|
||||
```
|
||||
|
||||
### Web App Manifest
|
||||
|
||||
HTML5 Boilerplate includes a simple web app manifest file.
|
||||
|
||||
The web app manifest is a simple JSON file that allows you to control how your
|
||||
app appears on a device's home screen, what it looks like when it launches in
|
||||
that context and what happens when it is launched. This allows for much greater`
|
||||
control over the UI of a saved site or web app on a mobile device.
|
||||
|
||||
It's linked to from the HTML as follows:
|
||||
|
||||
```html
|
||||
<link rel="manifest" href="site.webmanifest">
|
||||
```
|
||||
Our [site.webmanifest](https://github.com/h5bp/html5-boilerplate/blob/master/src/site.webmanifest) contains a very skeletal "app" definition, just to show the basic usage.
|
||||
You should fill this file out with [more information about your site or application](https://developer.mozilla.org/en-US/docs/Web/Manifest)
|
||||
|
||||
## Favicons and Touch Icon
|
||||
Our
|
||||
[site.webmanifest](https://github.com/h5bp/html5-boilerplate/blob/master/src/site.webmanifest)
|
||||
contains a very skeletal "app" definition, just to show the basic usage. You
|
||||
should fill this file out with [more information about your site or
|
||||
application](https://developer.mozilla.org/en-US/docs/Web/Manifest)
|
||||
|
||||
The shortcut icons should be put in the root directory of your site. `favicon.ico`
|
||||
is automatically picked up by browsers if it's placed in the root. HTML5
|
||||
Boilerplate comes with a default set of icons (include favicon and one Apple
|
||||
Touch Icon) that you can use as a baseline to create your own.
|
||||
### Favicons and Touch Icon
|
||||
|
||||
The shortcut icons should be put in the root directory of your site.
|
||||
`favicon.ico` is automatically picked up by browsers if it's placed in the root.
|
||||
HTML5 Boilerplate comes with a default set of icons (include favicon and one
|
||||
Apple Touch Icon) that you can use as a baseline to create your own.
|
||||
|
||||
Please refer to the more detailed description in the [Extend section](extend.md)
|
||||
of these docs.
|
||||
|
||||
## The Content Area
|
||||
### The Content Area
|
||||
|
||||
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 app development.
|
||||
intentional, in order to make the boilerplate suitable for both web page and web
|
||||
app development.
|
||||
|
||||
### Browser Upgrade Prompt
|
||||
|
||||
The main content area of the boilerplate includes a prompt to install an up to
|
||||
date browser for users of IE 9 and lower. If you intended to support IE, then you
|
||||
should edit or remove the snippet of code.
|
||||
|
||||
## Modernizr
|
||||
### Modernizr
|
||||
|
||||
HTML5 Boilerplate uses a custom build of Modernizr.
|
||||
|
||||
[Modernizr](https://modernizr.com/) is a JavaScript library which adds classes to
|
||||
the `html` element based on the results of feature test and which ensures that
|
||||
all browsers can make use of HTML5 elements (as it includes the HTML5 Shiv).
|
||||
This allows you to target parts of your CSS and JavaScript based on the
|
||||
[Modernizr](https://modernizr.com/) is a JavaScript library which adds classes
|
||||
to the `html` element based on the results of feature test and which ensures
|
||||
that all browsers can make use of HTML5 elements (as it includes the HTML5
|
||||
Shiv). This allows you to target parts of your CSS and JavaScript based on the
|
||||
features supported by a browser.
|
||||
|
||||
Starting with version 3 Modernizr can be customized using the [modernizr-config.json](https://github.com/h5bp/html5-boilerplate/blob/master/modernizr-config.json) and the
|
||||
[Modernizr command line utility](https://www.npmjs.com/package/modernizr-cli).
|
||||
Starting with version 3 Modernizr can be customized using the
|
||||
[modernizr-config.json](https://github.com/h5bp/html5-boilerplate/blob/master/modernizr-config.json)
|
||||
and the [Modernizr command line
|
||||
utility](https://www.npmjs.com/package/modernizr-cli).
|
||||
|
||||
## What About Polyfills?
|
||||
### What About Polyfills?
|
||||
|
||||
If you need to include [polyfills](https://remysharp.com/2010/10/08/what-is-a-polyfill)
|
||||
in your project, you must make sure those load before any other JavaScript. If you're
|
||||
using a polyfill CDN service, like [cdn.polyfill.io](https://cdn.polyfill.io/),
|
||||
just put it before the other scripts in the bottom of the page:
|
||||
If you need to include
|
||||
[polyfills](https://remysharp.com/2010/10/08/what-is-a-polyfill) in your
|
||||
project, you must make sure those load before any other JavaScript. If you're
|
||||
using a polyfill CDN service, like [polyfill.io](https://polyfill.io/v3/), just put
|
||||
it before the other scripts in the bottom of the page:
|
||||
|
||||
```html
|
||||
<script src="js/vendor/modernizr-3.7.1.min.js"></script>
|
||||
<script src="https://cdn.polyfill.io/v3/polyfill.min.js"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
|
||||
<script>window.jQuery || document.write('<script src="js/vendor/jquery-3.4.1.min.js"><\/script>')</script>
|
||||
<script src="js/vendor/modernizr-3.10.0.min.js"></script>
|
||||
<script src="https://polyfill.io/v3/polyfill.min.js"></script>
|
||||
<script src="js/plugins.js"></script>
|
||||
<script src="js/main.js"></script>
|
||||
</body>
|
||||
```
|
||||
|
||||
If you like to just include the polyfills yourself, you could include them in
|
||||
`js/plugins.js`. When you have a bunch of polyfills to load in, you could
|
||||
also create a `polyfills.js` file in the `js/vendor` directory or include the files
|
||||
individually and combine them using a build tool. Always ensure that the polyfills
|
||||
are all loaded before any other JavaScript.
|
||||
`js/plugins.js`. When you have a bunch of polyfills to load in, you could also
|
||||
create a `polyfills.js` file in the `js/vendor` directory or include the files
|
||||
individually and combine them using a build tool. Always ensure that the
|
||||
polyfills are all loaded before any other JavaScript.
|
||||
|
||||
There are some misconceptions about Modernizr and polyfills. It's important
|
||||
to understand that Modernizr just handles feature checking, not polyfilling
|
||||
itself. The only thing Modernizr does regarding polyfills is that the team
|
||||
maintains [a huge list of cross Browser polyfills](https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills).
|
||||
There are some misconceptions about Modernizr and polyfills. It's important to
|
||||
understand that Modernizr just handles feature checking, not polyfilling itself.
|
||||
The only thing Modernizr does regarding polyfills is that the team maintains [a
|
||||
huge list of cross Browser
|
||||
polyfills](https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills).
|
||||
|
||||
### jQuery CDN for jQuery
|
||||
### jQuery
|
||||
|
||||
The jQuery CDN version of the jQuery JavaScript library is referenced towards
|
||||
the bottom of the page. A local fallback of jQuery is included for rare instances
|
||||
when the CDN version might not be available, and to facilitate offline
|
||||
development.
|
||||
As of v8.0.0 we no longer include jQuery by default. Web development has
|
||||
changed a lot since we started this project and while many millions of sites
|
||||
still use jQuery there are many sites and applications that don't. 10 years ago
|
||||
jQuery _was_ JavaScript for most developers. That's not the case any more so
|
||||
we've made the decision to remove jQuery from the project.
|
||||
|
||||
The jQuery CDN version was chosen over other potential candidates
|
||||
([like Google's Hosted Libraries](https://developers.google.com/speed/libraries/))
|
||||
because it's fast ([comparable or faster than Google by some
|
||||
measures](https://www.cdnperf.com/#jsdelivr,cdnjs,google,yandex,microsoft,jquery,bootstrapcdn/https/90))
|
||||
and, (unlike Google's CDN) is available to China's hundreds of millions of internet users.
|
||||
For many years we [chose](https://github.com/h5bp/html5-boilerplate/issues/1191)
|
||||
the Google Hosted version over the jQuery CDN because it was available
|
||||
over HTTPS (the jQuery CDN was not,) and it offered a better chance of
|
||||
hitting the cache lottery owing to the popularity of the Google CDN.
|
||||
The first issue is no longer valid and the second is far outweighed by
|
||||
being able to serve jQuery to users in China.
|
||||
If you're interested in including it, you can easily install jQuery using the
|
||||
following command:
|
||||
|
||||
While the jQuery CDN is a strong default solution your site or application may
|
||||
require a different configuration. Testing your site with services like
|
||||
[WebPageTest](https://www.webpagetest.org/) and browser tools like
|
||||
[PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights/) will help you examine the real
|
||||
world performance of your site and can show where you can optimize your specific
|
||||
site or application.
|
||||
```
|
||||
npm install jQuery
|
||||
```
|
||||
|
||||
You can then copy the minified file into the `vendor` folder and add jQuery
|
||||
to the `index.html` manually.
|
||||
|
||||
To load jQuery from a CDN with a local fallback you can use the following:
|
||||
|
||||
``` html
|
||||
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
|
||||
<script>window.jQuery || document.write('<script src="js/vendor/jquery-3.5.1.min.js"><\/script>')</script>
|
||||
```
|
||||
|
||||
### Google Universal Analytics Tracking Code
|
||||
|
||||
Finally, an optimized version of the Google Universal Analytics tracking code is
|
||||
included.
|
||||
|
||||
We use `analytics.js` rather than the newer `gtag.js` as
|
||||
[it's faster and supports tasks and plugins](https://github.com/philipwalton/analyticsjs-boilerplate/issues/19#issuecomment-333714370)
|
||||
We use `analytics.js` rather than the newer `gtag.js` as [it's faster and
|
||||
supports tasks and
|
||||
plugins](https://github.com/philipwalton/analyticsjs-boilerplate/issues/19#issuecomment-333714370)
|
||||
|
||||
The beacon transport mechanism is used to send all hits [which saves HTTP requests and improves performance](https://philipwalton.com/articles/the-google-analytics-setup-i-use-on-every-site-i-build/#loading-analytics.js).
|
||||
Starting with version 8.0.0 we, by default, [anonymize IP
|
||||
addresses](https://support.google.com/analytics/answer/2763052). By
|
||||
default Google Analytics records the full IP address of a user visiting the
|
||||
site, but that full IP address is never available to the Google Analytics
|
||||
property admin. By anonymizing the IP address you can make your site more
|
||||
GDPR-compliant as a full IP address can be defined as PII (personally
|
||||
identifiable information.)
|
||||
|
||||
Google recommends that this script be placed at the top of the page.
|
||||
Factors to consider: if you place this script at the top of the page, you’ll
|
||||
be able to count users who don’t fully load the page, and you’ll incur the max
|
||||
number of simultaneous connections of the browser.
|
||||
The beacon transport mechanism is used to send all hits [which saves HTTP
|
||||
requests and improves
|
||||
performance](https://philipwalton.com/articles/the-google-analytics-setup-i-use-on-every-site-i-build/#loading-analytics.js).
|
||||
|
||||
Google recommends that this script be placed at the top of the page. Factors to
|
||||
consider: if you place this script at the top of the page, you’ll be able to
|
||||
count users who don’t fully load the page, and you’ll incur the max number of
|
||||
simultaneous connections of the browser.
|
||||
|
||||
Please be aware that while Google [states that it is fully GDPR compliant](https://privacy.google.com/businesses/compliance/),
|
||||
it is still possible to use analytics to violate GDPR.
|
||||
|
||||
Further information:
|
||||
|
||||
- [Introduction to
|
||||
* [Introduction to
|
||||
Analytics.js](https://developers.google.com/analytics/devguides/collection/analyticsjs/)
|
||||
- [Google Analytics Demos & Tools](https://ga-dev-tools.appspot.com/)
|
||||
* [Google Analytics Demos & Tools](https://ga-dev-tools.appspot.com/)
|
||||
* [Privacy Controls in Google Analytics](https://support.google.com/analytics/answer/9019185)
|
||||
|
||||
**N.B.** The Google Analytics snippet is included by default mainly
|
||||
because Google Analytics is [currently one of the most popular tracking
|
||||
**N.B.** The Google Analytics snippet is included by default mainly because
|
||||
Google Analytics is [currently one of the most popular tracking
|
||||
solutions](https://trends.builtwith.com/analytics/Google-Analytics) out there.
|
||||
However, its usage isn't set in stone, and you SHOULD consider exploring the
|
||||
[alternatives](https://en.wikipedia.org/wiki/List_of_web_analytics_software)
|
||||
and use whatever suits your needs best.
|
||||
|
||||
|
||||
[alternatives](https://en.wikipedia.org/wiki/List_of_web_analytics_software) and
|
||||
use whatever suits your needs best.
|
||||
|
||||
25
dist/doc/js.md
vendored
25
dist/doc/js.md
vendored
@@ -7,30 +7,29 @@ Information about the default JavaScript included in the project.
|
||||
|
||||
## main.js
|
||||
|
||||
This file can be used to contain or reference your site/app JavaScript code.
|
||||
If you're working on something more advanced you might replace this file
|
||||
entirely. That's cool.
|
||||
This file can be used to contain or reference your site/app JavaScript code. If
|
||||
you're working on something more advanced you might replace this file entirely.
|
||||
That's cool.
|
||||
|
||||
## plugins.js
|
||||
|
||||
This file can be used to contain all your plugins, such as jQuery plugins and
|
||||
other 3rd party scripts for a simple site.
|
||||
|
||||
One approach is to put jQuery plugins inside of a `(function($){ ...
|
||||
})(jQuery);` closure to make sure they're in the jQuery namespace safety
|
||||
blanket. Read more about [jQuery plugin
|
||||
authoring](https://learn.jquery.com/plugins/#Getting_Started).
|
||||
One approach is to put jQuery plugins inside of a `(function($){ ...})(jQuery);`
|
||||
closure to make sure they're in the jQuery namespace safety blanket. Read more
|
||||
about [jQuery plugin authoring](https://learn.jquery.com/plugins/).
|
||||
|
||||
By default the `plugins.js` file contains a small script to avoid `console`
|
||||
errors in browsers that lack a `console`. The script will make sure that, if
|
||||
a console method isn't available, that method will have the value of empty
|
||||
errors in browsers that lack a `console`. The script will make sure that, if a
|
||||
console method isn't available, that method will have the value of empty
|
||||
function, thus, preventing the browser from throwing an error.
|
||||
|
||||
## vendor
|
||||
|
||||
This directory can be used to contain all 3rd party library code.
|
||||
|
||||
Minified versions of the latest jQuery and Modernizr libraries are included by
|
||||
default. You may wish to create your own [custom Modernizr
|
||||
build with the online builder](https://www.modernizr.com/download/) or [command
|
||||
line tool](https://modernizr.com/docs#command-line-config).
|
||||
Our custom build of the Modernizr library is included by
|
||||
default. You may wish to create your own [custom Modernizr build with the online
|
||||
builder](https://modernizr.com/download/) or [command line
|
||||
tool](https://modernizr.com/docs#command-line-config).
|
||||
|
||||
66
dist/doc/misc.md
vendored
66
dist/doc/misc.md
vendored
@@ -9,6 +9,7 @@ table of contents](TOC.md)
|
||||
* [robots.txt](#robotstxt)
|
||||
* [humans.txt](#humanstxt)
|
||||
* [browserconfig.xml](#browserconfigxml)
|
||||
* [package.json](#packagejson)
|
||||
|
||||
--
|
||||
|
||||
@@ -31,10 +32,9 @@ globally ignore:
|
||||
excludesfile = ~/.gitignore
|
||||
```
|
||||
|
||||
* More on global ignores: https://help.github.com/articles/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
|
||||
|
||||
|
||||
## .editorconfig
|
||||
|
||||
The `.editorconfig` file is provided in order to encourage and help you and
|
||||
@@ -58,7 +58,6 @@ access to `.editorconfig` files, as they can disclose sensitive information!
|
||||
For more details, please refer to the [EditorConfig
|
||||
project](https://editorconfig.org/).
|
||||
|
||||
|
||||
## Server Configuration
|
||||
|
||||
H5BP includes a [`.htaccess`](#htaccess) file for the [Apache HTTP
|
||||
@@ -80,11 +79,10 @@ The `.htaccess` file is mostly used for:
|
||||
|
||||
If you have access to the main server configuration file (usually called
|
||||
`httpd.conf`), you should add the logic from the `.htaccess` file in, for
|
||||
example, a <Directory> section in the main configuration file. This is usually
|
||||
example, a `<Directory>` section in the main configuration file. This is usually
|
||||
the recommended way, as using .htaccess files slows down Apache!
|
||||
|
||||
To enable Apache modules locally, please see:
|
||||
https://github.com/h5bp/server-configs-apache/wiki/How-to-enable-Apache-modules.
|
||||
To enable Apache modules locally, please see [the Apache modules documentation](https://github.com/h5bp/server-configs-apache#enable-apache-httpd-modules)
|
||||
|
||||
In the repo the `.htaccess` is used for:
|
||||
|
||||
@@ -113,7 +111,6 @@ section](https://httpd.apache.org/docs/current/howto/htaccess.html).
|
||||
Notice that the original repo for the `.htaccess` file is [this
|
||||
one](https://github.com/h5bp/server-configs-apache).
|
||||
|
||||
|
||||
## robots.txt
|
||||
|
||||
The `robots.txt` file is used to give instructions to web robots on what can
|
||||
@@ -121,8 +118,8 @@ be crawled from the website.
|
||||
|
||||
By default, the file provided by this project includes the next two lines:
|
||||
|
||||
* `User-agent: *` - the following rules apply to all web robots
|
||||
* `Disallow:` - everything on the website is allowed to be crawled
|
||||
* `User-agent: *` - the following rules apply to all web robots
|
||||
* `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
|
||||
`Disallow` directive (e.g.: `Disallow: /path`) or, if you want to disallow
|
||||
@@ -137,8 +134,8 @@ you want to block access to private content, use proper authentication instead.
|
||||
|
||||
For more information about `robots.txt`, please see:
|
||||
|
||||
* [robotstxt.org](http://www.robotstxt.org/)
|
||||
* [How Google handles the `robots.txt` file](https://developers.google.com/webmasters/control-crawl-index/docs/robots_txt)
|
||||
* [robotstxt.org](https://www.robotstxt.org/)
|
||||
* [How Google handles the `robots.txt` file](https://developers.google.com/search/reference/robots_txt)
|
||||
|
||||
## humans.txt
|
||||
|
||||
@@ -147,19 +144,18 @@ the website.
|
||||
|
||||
The provided file contains three sections:
|
||||
|
||||
* `TEAM` - this is intended to list the group of people responsible for the website
|
||||
* `THANKS` - this is intended to list the group of people that have contributed
|
||||
* `TEAM` - this is intended to list the group of people responsible for the website
|
||||
* `THANKS` - this is intended to list the group of people that have contributed
|
||||
to the website
|
||||
* `TECHNOLOGY COLOPHON` - the section lists technologies used to make the website
|
||||
|
||||
For more information about `humans.txt`, please see: http://humanstxt.org/
|
||||
* `TECHNOLOGY COLOPHON` - the section lists technologies used to make the website
|
||||
|
||||
For more information about `humans.txt`, please see: http://humanstxt.org/
|
||||
|
||||
## browserconfig.xml
|
||||
|
||||
The `browserconfig.xml` file is used to customize the tile displayed when users
|
||||
pin your site to the Windows 8.1 start screen. In there you can define custom
|
||||
tile colors, custom images or even [live tiles](https://msdn.microsoft.com/library/dn455106.aspx#CreatingLiveTiles).
|
||||
tile colors, custom images or even [live tiles](https://docs.microsoft.com/previous-versions/windows/internet-explorer/ie-developer/samples/dn455106(v=vs.85)).
|
||||
|
||||
By default, the file points to 2 placeholder tile images:
|
||||
|
||||
@@ -170,4 +166,38 @@ By default, the file points to 2 placeholder tile images:
|
||||
Notice that IE11 uses the same images when adding a site to the `favorites`.
|
||||
|
||||
For more in-depth information about the `browserconfig.xml` file, please
|
||||
see [MSDN](https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/dn320426(v=vs.85)).
|
||||
see [MSDN](https://docs.microsoft.com/previous-versions/windows/internet-explorer/ie-developer/platform-apis/dn320426(v=vs.85)).
|
||||
|
||||
## package.json
|
||||
|
||||
`package.json` is used to define attributes of your site or application for
|
||||
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:
|
||||
|
||||
* `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)
|
||||
and be unique.
|
||||
* `version` - indicates the version of your site application using semantic
|
||||
versioning ([semver](https://docs.npmjs.com/misc/semver))
|
||||
* `description` - describes your site.
|
||||
* `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)
|
||||
related to the package lifecycle that node understands automatically. You can
|
||||
also define custom scripts for use with your application development. We
|
||||
provide three custom scripts that work with Parcel to get you up and running
|
||||
quickly with a bundler for your assets and a simple development server.
|
||||
|
||||
* `start` builds your site and starts a server
|
||||
* `build` builds your `index.html` using Parcel
|
||||
* `dev` serves your `index.html` with a simple development server
|
||||
|
||||
* `keywords` - an array of keywords used to discover your app in the npm
|
||||
registry
|
||||
* `author` - defines the author of a package. There is also an alternative
|
||||
[contributors](https://docs.npmjs.com/files/package.json#people-fields-author-contributors)
|
||||
field if there's more than one author.
|
||||
* `license` - the license for your application. Must conform to
|
||||
[specific rules](https://docs.npmjs.com/files/package.json#license)
|
||||
* `devDependencies` - development dependencies for your package. In our case
|
||||
it's a single dependency, Parcel, which we use to bundle files and run a
|
||||
simple web server.
|
||||
|
||||
26
dist/doc/usage.md
vendored
26
dist/doc/usage.md
vendored
@@ -38,7 +38,6 @@ A basic HTML5 Boilerplate site initially looks something like this:
|
||||
│ ├── main.js
|
||||
│ ├── plugins.js
|
||||
│ └── vendor
|
||||
│ ├── jquery.min.js
|
||||
│ └── modernizr.min.js
|
||||
├── .editorconfig
|
||||
├── .htaccess
|
||||
@@ -48,6 +47,7 @@ A basic HTML5 Boilerplate site initially looks something like this:
|
||||
├── humans.txt
|
||||
├── icon.png
|
||||
├── index.html
|
||||
├── package.json
|
||||
├── robots.txt
|
||||
├── site.webmanifest
|
||||
├── tile.png
|
||||
@@ -80,8 +80,9 @@ refer to the [Apache Server Configs
|
||||
repository](https://github.com/h5bp/server-configs-apache).
|
||||
|
||||
Host your site on a server other than Apache? You're likely to find the
|
||||
corresponding server configs project listed in our [Server Configs
|
||||
](https://github.com/h5bp/server-configs/blob/master/README.md) repository.
|
||||
corresponding server configs project listed in our [Server
|
||||
Configs](https://github.com/h5bp/server-configs/blob/master/README.md)
|
||||
repository.
|
||||
|
||||
### 404.html
|
||||
|
||||
@@ -91,14 +92,14 @@ A helpful custom 404 to get you started.
|
||||
|
||||
This file contains all settings regarding custom tiles for IE11 and Edge.
|
||||
|
||||
For more info on this topic, please refer to
|
||||
[Microsoft's Docs](https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/dn320426(v=vs.85)).
|
||||
For more info on this topic, please refer to [Microsoft's
|
||||
Docs](https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/dn320426(v=vs.85)).
|
||||
|
||||
### .editorconfig
|
||||
|
||||
The `.editorconfig` file is provided in order to encourage and help you and
|
||||
your team to maintain consistent coding styles between different
|
||||
editors and IDEs. [Read more about the `.editorconfig` file](misc.md#editorconfig).
|
||||
The `.editorconfig` file is provided in order to encourage and help you and your
|
||||
team to maintain consistent coding styles between different editors and IDEs.
|
||||
[Read more about the `.editorconfig` file](misc.md#editorconfig).
|
||||
|
||||
### index.html
|
||||
|
||||
@@ -117,14 +118,19 @@ corresponding snippet at the bottom to include your analytics ID.
|
||||
Edit this file to include the team that worked on your site/app, and the
|
||||
technology powering it.
|
||||
|
||||
### package.json
|
||||
|
||||
Edit this file to describe your application, add dependencies, scripts and
|
||||
other properties related to node based development and the npm registry
|
||||
|
||||
### robots.txt
|
||||
|
||||
Edit this file to include any pages you need hidden from search engines.
|
||||
|
||||
### Icons
|
||||
|
||||
Replace the default `favicon.ico`, `tile.png`, `tile-wide.png` and Apple
|
||||
Touch Icon with your own.
|
||||
Replace the default `favicon.ico`, `tile.png`, `tile-wide.png` and Apple Touch
|
||||
Icon with your own.
|
||||
|
||||
If you want to use different Apple Touch Icons for different resolutions please
|
||||
refer to the [according documentation](extend.md#apple-touch-icons).
|
||||
|
||||
14
dist/index.html
vendored
14
dist/index.html
vendored
@@ -7,6 +7,11 @@
|
||||
<meta name="description" content="">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<meta property="og:title" content="">
|
||||
<meta property="og:type" content="">
|
||||
<meta property="og:url" content="">
|
||||
<meta property="og:image" content="">
|
||||
|
||||
<link rel="manifest" href="site.webmanifest">
|
||||
<link rel="apple-touch-icon" href="icon.png">
|
||||
<!-- Place favicon.ico in the root directory -->
|
||||
@@ -18,22 +23,17 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!--[if IE]>
|
||||
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="https://browsehappy.com/">upgrade your browser</a> to improve your experience and security.</p>
|
||||
<![endif]-->
|
||||
|
||||
<!-- Add your site or application content here -->
|
||||
<p>Hello world! This is HTML5 Boilerplate.</p>
|
||||
<script src="js/vendor/modernizr-3.7.1.min.js"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
|
||||
<script>window.jQuery || document.write('<script src="js/vendor/jquery-3.4.1.min.js"><\/script>')</script>
|
||||
<script src="js/vendor/modernizr-3.11.2.min.js"></script>
|
||||
<script src="js/plugins.js"></script>
|
||||
<script src="js/main.js"></script>
|
||||
|
||||
<!-- Google Analytics: change UA-XXXXX-Y to be your site's ID. -->
|
||||
<script>
|
||||
window.ga = function () { ga.q.push(arguments) }; ga.q = []; ga.l = +new Date;
|
||||
ga('create', 'UA-XXXXX-Y', 'auto'); ga('set','transport','beacon'); ga('send', 'pageview')
|
||||
ga('create', 'UA-XXXXX-Y', 'auto'); ga('set', 'anonymizeIp', true); ga('set', 'transport', 'beacon'); ga('send', 'pageview')
|
||||
</script>
|
||||
<script src="https://www.google-analytics.com/analytics.js" async></script>
|
||||
</body>
|
||||
|
||||
2
dist/js/vendor/jquery-3.4.1.min.js
vendored
2
dist/js/vendor/jquery-3.4.1.min.js
vendored
File diff suppressed because one or more lines are too long
3
dist/js/vendor/modernizr-3.11.2.min.js
vendored
Normal file
3
dist/js/vendor/modernizr-3.11.2.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3
dist/js/vendor/modernizr-3.7.1.min.js
vendored
3
dist/js/vendor/modernizr-3.7.1.min.js
vendored
File diff suppressed because one or more lines are too long
7450
dist/package-lock.json
generated
vendored
Normal file
7450
dist/package-lock.json
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
17
dist/package.json
vendored
Normal file
17
dist/package.json
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": " ",
|
||||
"version": "0.0.1",
|
||||
"description": "",
|
||||
"keywords": "",
|
||||
"license": "",
|
||||
"author": "",
|
||||
"scripts": {
|
||||
"build": "parcel build index.html",
|
||||
"dev": "parcel index.html --open",
|
||||
"start": "npm run build && npm run dev",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"parcel-bundler": "^1.12.4"
|
||||
}
|
||||
}
|
||||
@@ -7,36 +7,36 @@ import gulp from 'gulp';
|
||||
// and attach them to the `plugins` object
|
||||
import plugins from 'gulp-load-plugins';
|
||||
|
||||
// Temporary solution until gulp 4
|
||||
// https://github.com/gulpjs/gulp/issues/355
|
||||
import runSequence from 'run-sequence';
|
||||
|
||||
import archiver from 'archiver';
|
||||
import glob from 'glob';
|
||||
import del from 'del';
|
||||
import ssri from 'ssri';
|
||||
import modernizr from 'modernizr';
|
||||
|
||||
import pkg from './package.json';
|
||||
import modernizrConfig from './modernizr-config.json';
|
||||
|
||||
|
||||
const dirs = pkg['h5bp-configs'].directories;
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
// | Helper tasks |
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
gulp.task('archive:create_archive_dir', () => {
|
||||
gulp.task('archive:create_archive_dir', (done) => {
|
||||
fs.mkdirSync(path.resolve(dirs.archive), '0755');
|
||||
done();
|
||||
});
|
||||
|
||||
gulp.task('archive:zip', (done) => {
|
||||
|
||||
const archiveName = path.resolve(dirs.archive, `${pkg.name}_v${pkg.version}.zip`);
|
||||
const zip = archiver('zip');
|
||||
const files = glob.sync('**/*.*', {
|
||||
'cwd': dirs.dist,
|
||||
'ignore': [
|
||||
'**/node_modules/**',
|
||||
'package-lock.json',
|
||||
'**/dist/**',
|
||||
'**/.cache/**',
|
||||
],
|
||||
'dot': true // include hidden files
|
||||
});
|
||||
const output = fs.createWriteStream(archiveName);
|
||||
@@ -49,7 +49,6 @@ gulp.task('archive:zip', (done) => {
|
||||
output.on('close', done);
|
||||
|
||||
files.forEach((file) => {
|
||||
|
||||
const filePath = path.resolve(dirs.dist, file);
|
||||
|
||||
// `zip.bulk` does not maintain the file
|
||||
@@ -58,12 +57,11 @@ gulp.task('archive:zip', (done) => {
|
||||
'name': file,
|
||||
'mode': fs.statSync(filePath).mode
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
zip.pipe(output);
|
||||
zip.finalize();
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
gulp.task('clean', (done) => {
|
||||
@@ -75,16 +73,6 @@ gulp.task('clean', (done) => {
|
||||
});
|
||||
});
|
||||
|
||||
gulp.task('copy', [
|
||||
'copy:.htaccess',
|
||||
'copy:index.html',
|
||||
'copy:jquery',
|
||||
'copy:license',
|
||||
'copy:main.css',
|
||||
'copy:misc',
|
||||
'copy:normalize'
|
||||
]);
|
||||
|
||||
gulp.task('copy:.htaccess', () =>
|
||||
gulp.src('node_modules/apache-server-configs/dist/.htaccess')
|
||||
.pipe(plugins().replace(/# ErrorDocument/g, 'ErrorDocument'))
|
||||
@@ -92,26 +80,14 @@ gulp.task('copy:.htaccess', () =>
|
||||
);
|
||||
|
||||
gulp.task('copy:index.html', () => {
|
||||
const hash = ssri.fromData(
|
||||
fs.readFileSync('node_modules/jquery/dist/jquery.min.js'),
|
||||
{algorithms: ['sha256']}
|
||||
);
|
||||
let version = pkg.devDependencies.jquery;
|
||||
|
||||
let modernizrVersion = pkg.devDependencies.modernizr;
|
||||
|
||||
gulp.src(`${dirs.src}/index.html`)
|
||||
.pipe(plugins().replace(/{{JQUERY_VERSION}}/g, version))
|
||||
return gulp.src(`${dirs.src}/index.html`)
|
||||
.pipe(plugins().replace(/{{MODERNIZR_VERSION}}/g, modernizrVersion))
|
||||
.pipe(plugins().replace(/{{JQUERY_SRI_HASH}}/g, hash.toString()))
|
||||
.pipe(gulp.dest(dirs.dist));
|
||||
});
|
||||
|
||||
gulp.task('copy:jquery', () =>
|
||||
gulp.src(['node_modules/jquery/dist/jquery.min.js'])
|
||||
.pipe(plugins().rename(`jquery-${pkg.devDependencies.jquery}.min.js`))
|
||||
.pipe(gulp.dest(`${dirs.dist}/js/vendor`))
|
||||
);
|
||||
|
||||
gulp.task('copy:license', () =>
|
||||
gulp.src('LICENSE.txt')
|
||||
.pipe(gulp.dest(dirs.dist))
|
||||
@@ -120,10 +96,9 @@ gulp.task('copy:license', () =>
|
||||
gulp.task('copy:main.css', () => {
|
||||
const banner = `/*! HTML5 Boilerplate v${pkg.version} | ${pkg.license} License | ${pkg.homepage} */\n\n`;
|
||||
|
||||
gulp.src(`node_modules/main.css/dist/main.css`)
|
||||
return gulp.src('node_modules/main.css/dist/main.css')
|
||||
.pipe(plugins().header(banner))
|
||||
.pipe(plugins().autoprefixer({
|
||||
browsers: ['last 2 versions', 'ie >= 9', '> 1%'],
|
||||
cascade: false
|
||||
}))
|
||||
.pipe(gulp.dest(`${dirs.dist}/css`));
|
||||
@@ -131,7 +106,6 @@ gulp.task('copy:main.css', () => {
|
||||
|
||||
gulp.task('copy:misc', () =>
|
||||
gulp.src([
|
||||
|
||||
// Copy all files
|
||||
`${dirs.src}/**/*`,
|
||||
|
||||
@@ -139,12 +113,9 @@ gulp.task('copy:misc', () =>
|
||||
// (other tasks will handle the copying of these files)
|
||||
`!${dirs.src}/css/main.css`,
|
||||
`!${dirs.src}/index.html`
|
||||
|
||||
], {
|
||||
|
||||
// Include hidden files by default
|
||||
dot: true
|
||||
|
||||
}).pipe(gulp.dest(dirs.dist))
|
||||
);
|
||||
|
||||
@@ -153,42 +124,56 @@ gulp.task('copy:normalize', () =>
|
||||
.pipe(gulp.dest(`${dirs.dist}/css`))
|
||||
);
|
||||
|
||||
gulp.task('modernizr', (done) =>{
|
||||
|
||||
gulp.task('modernizr', (done) => {
|
||||
// TODO: rework this flow instead of just reacting to the fact that the jQuery step is gone
|
||||
if (!fs.existsSync(`${dirs.dist}/js/vendor/`)){
|
||||
fs.mkdirSync(`${dirs.dist}/js/vendor/`);
|
||||
}
|
||||
|
||||
modernizr.build(modernizrConfig, (code) => {
|
||||
fs.writeFile(`${dirs.dist}/js/vendor/modernizr-${pkg.devDependencies.modernizr}.min.js`, code, done);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
gulp.task('lint:js', () =>
|
||||
gulp.src([
|
||||
'gulpfile.js',
|
||||
`${dirs.src}/js/*.js`,
|
||||
`${dirs.test}/*.js`
|
||||
]).pipe(plugins().jscs())
|
||||
.pipe(plugins().eslint())
|
||||
]).pipe(plugins().eslint())
|
||||
.pipe(plugins().eslint.failOnError())
|
||||
);
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
// | Main tasks |
|
||||
// ---------------------------------------------------------------------
|
||||
gulp.task(
|
||||
'copy',
|
||||
gulp.series(
|
||||
'copy:.htaccess',
|
||||
'copy:index.html',
|
||||
'copy:license',
|
||||
'copy:main.css',
|
||||
'copy:misc',
|
||||
'copy:normalize'
|
||||
)
|
||||
);
|
||||
|
||||
gulp.task('archive', (done) => {
|
||||
runSequence(
|
||||
gulp.task(
|
||||
'build',
|
||||
gulp.series(
|
||||
gulp.parallel('clean', 'lint:js'),
|
||||
'copy',
|
||||
'modernizr'
|
||||
)
|
||||
);
|
||||
|
||||
gulp.task(
|
||||
'archive',
|
||||
gulp.series(
|
||||
'build',
|
||||
'archive:create_archive_dir',
|
||||
'archive:zip',
|
||||
done);
|
||||
});
|
||||
'archive:zip'
|
||||
)
|
||||
);
|
||||
|
||||
gulp.task('build', (done) => {
|
||||
runSequence(
|
||||
['clean', 'lint:js'],
|
||||
'copy', 'modernizr',
|
||||
done);
|
||||
});
|
||||
|
||||
gulp.task('default', ['build']);
|
||||
gulp.task('default', gulp.series('build'));
|
||||
|
||||
9541
package-lock.json
generated
Normal file
9541
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
90
package.json
90
package.json
@@ -1,41 +1,65 @@
|
||||
{
|
||||
"name": "html5-boilerplate",
|
||||
"version": "8.0.0",
|
||||
"homepage": "https://html5boilerplate.com/",
|
||||
"license": "MIT",
|
||||
"description": "A professional front-end template for building fast, robust, and adaptable web apps or sites.",
|
||||
"keywords": [
|
||||
"h5bp",
|
||||
"template",
|
||||
"front-end"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/h5bp/html5-boilerplate.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/h5bp/html5-boilerplate/issues"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "gulp build",
|
||||
"test": "gulp archive && mocha --require @babel/register --reporter spec --timeout 5000"
|
||||
},
|
||||
"devDependencies": {
|
||||
"apache-server-configs": "^3.2.1",
|
||||
"archiver": "^3.0.0",
|
||||
"babel-core": "^6.26.3",
|
||||
"babel-preset-env": "^1.7.0",
|
||||
"babel-register": "^6.26.0",
|
||||
"del": "^4.1.1",
|
||||
"eslint": "^5.16.0",
|
||||
"eslint-config-recommended": "^4.0.0",
|
||||
"eslint-plugin-mocha": "^5.3.0",
|
||||
"glob": "^7.1.4",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-autoprefixer": "^6.1.0",
|
||||
"gulp-eslint": "^5.0.0",
|
||||
"gulp-header": "^2.0.7",
|
||||
"gulp-jscs": "^4.1.0",
|
||||
"gulp-load-plugins": "^1.6.0",
|
||||
"gulp-rename": "^1.4.0",
|
||||
"@babel/core": "^7.10.2",
|
||||
"@babel/preset-env": "^7.10.2",
|
||||
"@babel/register": "^7.10.1",
|
||||
"apache-server-configs": "^4.0.0",
|
||||
"archiver": "^4.0.1",
|
||||
"del": "^5.1.0",
|
||||
"eslint": "^7.1.0",
|
||||
"eslint-config-recommended": "^4.1.0",
|
||||
"eslint-plugin-mocha": "^7.0.1",
|
||||
"glob": "^7.1.6",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-autoprefixer": "^7.0.1",
|
||||
"gulp-eslint": "^6.0.0",
|
||||
"gulp-header": "^2.0.9",
|
||||
"gulp-load-plugins": "^2.0.3",
|
||||
"gulp-rename": "^2.0.0",
|
||||
"gulp-replace": "^1.0.0",
|
||||
"jquery": "3.4.1",
|
||||
"main.css": "2.0.0",
|
||||
"mocha": "^5.2.0",
|
||||
"modernizr": "3.7.1",
|
||||
"main.css": "2.1.0",
|
||||
"mocha": "^7.2.0",
|
||||
"modernizr": "3.11.2",
|
||||
"normalize.css": "8.0.1",
|
||||
"run-sequence": "^2.2.1",
|
||||
"ssri": "^6.0.1",
|
||||
"strip-json-comments": "^2.0.1"
|
||||
"strip-json-comments": "^3.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6",
|
||||
"node": ">=10",
|
||||
"npm": ">=3"
|
||||
},
|
||||
"babel": {
|
||||
"presets": [
|
||||
"env"
|
||||
"@babel/preset-env"
|
||||
]
|
||||
},
|
||||
"browserslist": [
|
||||
"> 0.5%",
|
||||
"last 2 versions",
|
||||
"Firefox ESR",
|
||||
"not dead",
|
||||
"IE 11"
|
||||
],
|
||||
"h5bp-configs": {
|
||||
"directories": {
|
||||
"archive": "archive",
|
||||
@@ -44,15 +68,6 @@
|
||||
"test": "test"
|
||||
}
|
||||
},
|
||||
"homepage": "https://html5boilerplate.com/",
|
||||
"license": "MIT",
|
||||
"name": "html5-boilerplate",
|
||||
"scripts": {
|
||||
"build": "gulp build",
|
||||
"test": "gulp archive && mocha --require babel-core/register --reporter spec --timeout 5000"
|
||||
},
|
||||
"version": "7.2.0",
|
||||
"description": "A professional front-end template for building fast, robust, and adaptable web apps or sites.",
|
||||
"files": [
|
||||
"CHANGELOG.md",
|
||||
"LICENSE.txt",
|
||||
@@ -61,8 +76,5 @@
|
||||
"modernizr-config.json",
|
||||
"README.md"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/h5bp/html5-boilerplate.git"
|
||||
}
|
||||
"dependencies": {}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,3 @@ indent_size = 2
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
3
src/.gitignore
vendored
3
src/.gitignore
vendored
@@ -1,3 +1,6 @@
|
||||
# Include your project-specific ignores in this file
|
||||
# Read about how to use .gitignore: https://help.github.com/articles/ignoring-files
|
||||
# Useful .gitignore templates: https://github.com/github/gitignore
|
||||
node_modules
|
||||
dist
|
||||
.cache
|
||||
92
src/404.html
92
src/404.html
@@ -1,60 +1,62 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Page Not Found</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style>
|
||||
<meta charset="utf-8">
|
||||
<title>Page Not Found</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style>
|
||||
* {
|
||||
line-height: 1.2;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
* {
|
||||
line-height: 1.2;
|
||||
margin: 0;
|
||||
}
|
||||
html {
|
||||
color: #888;
|
||||
display: table;
|
||||
font-family: sans-serif;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
html {
|
||||
color: #888;
|
||||
display: table;
|
||||
font-family: sans-serif;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
}
|
||||
body {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
margin: 2em auto;
|
||||
}
|
||||
|
||||
body {
|
||||
display: table-cell;
|
||||
vertical-align: middle;
|
||||
margin: 2em auto;
|
||||
}
|
||||
h1 {
|
||||
color: #555;
|
||||
font-size: 2em;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #555;
|
||||
font-size: 2em;
|
||||
font-weight: 400;
|
||||
}
|
||||
p {
|
||||
margin: 0 auto;
|
||||
width: 280px;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0 auto;
|
||||
width: 280px;
|
||||
}
|
||||
@media only screen and (max-width: 280px) {
|
||||
|
||||
@media only screen and (max-width: 280px) {
|
||||
body,
|
||||
p {
|
||||
width: 95%;
|
||||
}
|
||||
|
||||
body, p {
|
||||
width: 95%;
|
||||
}
|
||||
h1 {
|
||||
font-size: 1.5em;
|
||||
margin: 0 0 0.3em;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 1.5em;
|
||||
margin: 0 0 0.3em;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</style>
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Page Not Found</h1>
|
||||
<p>Sorry, but the page you were trying to view does not exist.</p>
|
||||
<h1>Page Not Found</h1>
|
||||
<p>Sorry, but the page you were trying to view does not exist.</p>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<!-- IE needs 512+ bytes: https://blogs.msdn.microsoft.com/ieinternals/2010/08/18/friendly-http-error-pages/ -->
|
||||
<!-- IE needs 512+ bytes: https://docs.microsoft.com/archive/blogs/ieinternals/friendly-http-error-pages -->
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Please read: https://msdn.microsoft.com/en-us/library/ie/dn455106.aspx -->
|
||||
<browserconfig>
|
||||
<msapplication>
|
||||
<tile>
|
||||
<square70x70logo src="tile.png"/>
|
||||
<square150x150logo src="tile.png"/>
|
||||
<wide310x150logo src="tile-wide.png"/>
|
||||
<square310x310logo src="tile.png"/>
|
||||
</tile>
|
||||
</msapplication>
|
||||
<msapplication>
|
||||
<tile>
|
||||
<square70x70logo src="tile.png"/>
|
||||
<square150x150logo src="tile.png"/>
|
||||
<wide310x150logo src="tile-wide.png"/>
|
||||
<square310x310logo src="tile.png"/>
|
||||
</tile>
|
||||
</msapplication>
|
||||
</browserconfig>
|
||||
|
||||
@@ -14,21 +14,24 @@
|
||||
|
||||
## Development
|
||||
|
||||
* [Extending and customizing HTML5 Boilerplate](extend.md) — Going further
|
||||
with the boilerplate.
|
||||
* [Extending and customizing HTML5 Boilerplate](extend.md) — Going further with
|
||||
the boilerplate.
|
||||
|
||||
## Related projects
|
||||
|
||||
The [H5BP organization](https://github.com/h5bp) maintains several projects
|
||||
that complement HTML5 Boilerplate, projects that can help you improve different
|
||||
The [H5BP organization](https://github.com/h5bp) maintains several projects that
|
||||
complement HTML5 Boilerplate, projects that can help you improve different
|
||||
aspects of your website/web app (e.g.: the performance, security, etc.).
|
||||
|
||||
* [Server Configs](https://github.com/h5bp/server-configs) — Fast and
|
||||
smart configurations for web servers such as Apache and Nginx.
|
||||
* [Apache](https://github.com/h5bp/server-configs-apache)
|
||||
* [Google App Engine (GAE)](https://github.com/h5bp/server-configs-gae)
|
||||
* [Internet Information Services (IIS)](https://github.com/h5bp/server-configs-iis)
|
||||
* [lighttpd](https://github.com/h5bp/server-configs-lighttpd)
|
||||
* [Nginx](https://github.com/h5bp/server-configs-nginx)
|
||||
* [Node.js](https://github.com/h5bp/server-configs-node)
|
||||
* [Server Configs](https://github.com/h5bp/server-configs) — Fast and smart
|
||||
configurations for web servers such as Apache and Nginx.
|
||||
* [Apache](https://github.com/h5bp/server-configs-apache)
|
||||
* [Google App Engine (GAE)](https://github.com/h5bp/server-configs-gae)
|
||||
* [Internet Information Services
|
||||
(IIS)](https://github.com/h5bp/server-configs-iis)
|
||||
* [lighttpd](https://github.com/h5bp/server-configs-lighttpd)
|
||||
* [Nginx](https://github.com/h5bp/server-configs-nginx)
|
||||
* [Node.js](https://github.com/h5bp/server-configs-node)
|
||||
* [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
|
||||
* [main.css](https://github.com/h5bp/main.css) — the main.css file included with HTML5 Boilerplate
|
||||
|
||||
@@ -8,19 +8,11 @@ HTML5 Boilerplate's CSS includes:
|
||||
* [Normalize.css](#normalizecss)
|
||||
* [main.css](#maincss)
|
||||
|
||||
This starting CSS does not rely on the presence of
|
||||
[conditional class names](https://www.paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/),
|
||||
[conditional style sheets](https://css-tricks.com/how-to-create-an-ie-only-stylesheet/),
|
||||
or [Modernizr](https://modernizr.com/), and it is ready to use no matter what
|
||||
your development preferences happen to be.
|
||||
|
||||
|
||||
## Normalize.css
|
||||
|
||||
In order to make browsers render all elements more consistently and in line
|
||||
with modern standards, we include
|
||||
[Normalize.css](https://necolas.github.io/normalize.css/) — a modern, HTML5-ready
|
||||
alternative to CSS resets.
|
||||
In order to make browsers render all elements more consistently and in line with
|
||||
modern standards, we include Normalize.css — a modern, HTML5-ready alternative
|
||||
to CSS resets.
|
||||
|
||||
As opposed to CSS resets, Normalize.css:
|
||||
|
||||
@@ -32,14 +24,11 @@ As opposed to CSS resets, Normalize.css:
|
||||
* has better documentation
|
||||
|
||||
For more information about Normalize.css, please refer to its [project
|
||||
page](https://necolas.github.com/normalize.css/), as well as this
|
||||
[blog post](http://nicolasgallagher.com/about-normalize-css/).
|
||||
|
||||
page](https://necolas.github.io/normalize.css/).
|
||||
|
||||
## main.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
|
||||
* protect against unwanted `text-shadow` during text highlighting
|
||||
@@ -48,4 +37,8 @@ styles:
|
||||
* style the prompt that is displayed to users using an outdated browser
|
||||
* and more...
|
||||
|
||||
These styles are included in [main.css](https://github.com/h5bp/html5-boilerplate/blob/master/dist/css/main.css). See the [main.css](https://github.com/h5bp/main.css) project [documentation](https://github.com/h5bp/main.css/blob/master/README.md#features) for a full discussion of these styles.
|
||||
These styles are included in
|
||||
[main.css](https://github.com/h5bp/html5-boilerplate/blob/master/dist/css/main.css).
|
||||
See the [main.css](https://github.com/h5bp/main.css) project
|
||||
[documentation](https://github.com/h5bp/main.css/blob/master/README.md#features)
|
||||
for a full discussion of these styles.
|
||||
|
||||
@@ -4,9 +4,8 @@ table of contents](TOC.md)
|
||||
# Extend and customise HTML5 Boilerplate
|
||||
|
||||
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 everything fits with everyone's needs.
|
||||
|
||||
Boilerplate even better. We don't want to include it all by default, as not
|
||||
everything fits with everyone's needs.
|
||||
|
||||
* [App Stores](#app-stores)
|
||||
* [DNS prefetching](#dns-prefetching)
|
||||
@@ -24,8 +23,11 @@ not everything fits with everyone's needs.
|
||||
|
||||
### Smart App Banners in iOS 6+ Safari
|
||||
|
||||
Stop bothering everyone with gross modals advertising your entry in the
|
||||
App Store. Including the following [meta tag](https://developer.apple.com/library/content/documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html) will unobtrusively give the user the option to download your iOS app, or open it with some data about the user's current state on the website.
|
||||
Stop bothering everyone with gross modals advertising your entry in the App
|
||||
Store. Including the following [meta
|
||||
tag](https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html)
|
||||
will unobtrusively give the user the option to download your iOS app, or open it
|
||||
with some data about the user's current state on the website.
|
||||
|
||||
```html
|
||||
<meta name="apple-itunes-app" content="app-id=APP_ID,app-argument=SOME_TEXT">
|
||||
@@ -35,42 +37,29 @@ App Store. Including the following [meta tag](https://developer.apple.com/librar
|
||||
|
||||
In short, DNS Prefetching is a method of informing the browser of domain names
|
||||
referenced on a site so that the client can resolve the DNS for those hosts,
|
||||
cache them, and when it comes time to use them, have a faster turn around on
|
||||
the request.
|
||||
cache them, and when it comes time to use them, have a faster turn around on the
|
||||
request.
|
||||
|
||||
### Implicit prefetches
|
||||
|
||||
There is a lot of prefetching done for you automatically by the browser. When
|
||||
the browser encounters an anchor in your html that does not share the same
|
||||
domain name as the current location the browser requests, from the client OS,
|
||||
the IP address for this new domain. The client first checks its cache and
|
||||
then, lacking a cached copy, makes a request from a DNS server. These requests
|
||||
happen in the background and are not meant to block the rendering of the
|
||||
page.
|
||||
the IP address for this new domain. The client first checks its cache and then,
|
||||
lacking a cached copy, makes a request from a DNS server. These requests happen
|
||||
in the background and are not meant to block the rendering of the page.
|
||||
|
||||
The goal of this is that when the foreign IP address is finally needed it will
|
||||
already be in the client cache and will not block the loading of the foreign
|
||||
content. Fewer requests result in faster page load times. The perception of this
|
||||
is increased on a mobile platform where DNS latency can be greater.
|
||||
|
||||
#### Disable implicit prefetching
|
||||
|
||||
```html
|
||||
<meta http-equiv="x-dns-prefetch-control" content="off">
|
||||
```
|
||||
|
||||
Even with X-DNS-Prefetch-Control meta tag (or http header) browsers will still
|
||||
prefetch any explicit dns-prefetch links.
|
||||
|
||||
**_WARNING:_** THIS MAY MAKE YOUR SITE SLOWER IF YOU RELY ON RESOURCES FROM
|
||||
FOREIGN DOMAINS.
|
||||
|
||||
### Explicit prefetches
|
||||
|
||||
Typically the browser only scans the HTML for foreign domains. If you have
|
||||
resources that are outside of your HTML (a javascript request to a remote
|
||||
server or a CDN that hosts content that may not be present on every page of
|
||||
your site, for example) then you can queue up a domain name to be prefetched.
|
||||
resources that are outside of your HTML (a javascript request to a remote server
|
||||
or a CDN that hosts content that may not be present on every page of your site,
|
||||
for example) then you can queue up a domain name to be prefetched.
|
||||
|
||||
```html
|
||||
<link rel="dns-prefetch" href="//example.com">
|
||||
@@ -80,8 +69,8 @@ your site, for example) then you can queue up a domain name to be prefetched.
|
||||
You can use as many of these as you need, but it's best if they are all
|
||||
immediately after the [Meta
|
||||
Charset](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#attr-charset)
|
||||
element (which should go right at the top of the `head`), so the browser can
|
||||
act on them ASAP.
|
||||
element (which should go right at the top of the `head`), so the browser can act
|
||||
on them ASAP.
|
||||
|
||||
#### Common Prefetch Links
|
||||
|
||||
@@ -108,8 +97,7 @@ Microsoft Ajax Content Delivery Network:
|
||||
|
||||
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-DNS-Prefetch-Control
|
||||
* https://dev.chromium.org/developers/design-documents/dns-prefetching
|
||||
* https://blogs.msdn.microsoft.com/ie/2011/03/17/internet-explorer-9-network-performance-improvements/
|
||||
|
||||
* https://docs.microsoft.com/en-us/archive/blogs/ie/internet-explorer-9-network-performance-improvements
|
||||
|
||||
## Google Universal Analytics
|
||||
|
||||
@@ -126,23 +114,9 @@ ga('create', 'UA-XXXXX-X', 'auto'); ga('send', 'pageview');
|
||||
To customize further, see Google's [Advanced
|
||||
Setup](https://developers.google.com/analytics/devguides/collection/analyticsjs/),
|
||||
[Pageview](https://developers.google.com/analytics/devguides/collection/analyticsjs/pages),
|
||||
and [Event](https://developers.google.com/analytics/devguides/collection/analyticsjs/events) Docs.
|
||||
|
||||
### Anonymize IP addresses
|
||||
|
||||
In some countries, no personal data may be transferred outside jurisdictions
|
||||
that do not have similarly strict laws (i.e. from Germany to outside the EU).
|
||||
Thus a webmaster using the Google Universal Analytics may have to ensure that
|
||||
no personal (trackable) data is transferred to the US. You can do that with
|
||||
[the `ga('set', 'anonymizeIp', true);`
|
||||
parameter](https://developers.google.com/analytics/devguides/collection/analyticsjs/advanced#anonymizeip)
|
||||
before sending any events/pageviews. In use it looks like this:
|
||||
|
||||
```js
|
||||
ga('create', 'UA-XXXXX-X', 'auto');
|
||||
ga('set', 'anonymizeIp', true);
|
||||
ga('send', 'pageview');
|
||||
```
|
||||
and
|
||||
[Event](https://developers.google.com/analytics/devguides/collection/analyticsjs/events)
|
||||
Docs.
|
||||
|
||||
### Track jQuery AJAX requests in Google Analytics
|
||||
|
||||
@@ -190,7 +164,7 @@ Add this function after `ga` is defined:
|
||||
|
||||
### Track page scroll
|
||||
|
||||
Add this function after `ga` is defined:
|
||||
Add this function after `ga` is defined. Note, the following snippet requires jQuery.
|
||||
|
||||
```js
|
||||
$(function(){
|
||||
@@ -218,8 +192,9 @@ $(function(){
|
||||
|
||||
Enabling your application for pinning will allow IE users to add it to their
|
||||
Windows Taskbar and Start Menu. This comes with a range of new tools that you
|
||||
can easily configure with the elements below. See more [documentation on IE
|
||||
Pinned Sites](https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/samples/gg491731(v%3dvs.85)).
|
||||
can easily configure with the elements below. See more [documentation on IE
|
||||
Pinned
|
||||
Sites](https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/samples/gg491731(v%3dvs.85)).
|
||||
|
||||
### Name the Pinned Site for Windows
|
||||
|
||||
@@ -253,8 +228,8 @@ track the number of pinned users, like so:
|
||||
### Recolor IE's controls manually for a Pinned Site
|
||||
|
||||
IE will automatically use the overall color of your Pinned Site's favicon to
|
||||
shade its browser buttons. UNLESS you give it another color here. Only use
|
||||
named colors (`red`) or hex colors (`#ff0000`).
|
||||
shade its browser buttons. UNLESS you give it another color here. Only use named
|
||||
colors (`red`) or hex colors (`#ff0000`).
|
||||
|
||||
```html
|
||||
<meta name="msapplication-navbutton-color" content="#ff0000">
|
||||
@@ -263,8 +238,7 @@ named colors (`red`) or hex colors (`#ff0000`).
|
||||
### Manually set the window size of a Pinned Site
|
||||
|
||||
If the site should open at a certain window size once pinned, you can specify
|
||||
the dimensions here. It only supports static pixel dimensions. 800x600
|
||||
minimum.
|
||||
the dimensions here. It only supports static pixel dimensions. 800x600 minimum.
|
||||
|
||||
```html
|
||||
<meta name="msapplication-window" content="width=800;height=600">
|
||||
@@ -274,8 +248,7 @@ minimum.
|
||||
|
||||
Add Jump List Tasks that will appear when the Pinned Site's icon gets a
|
||||
right-click. Each Task goes to the specified URL, and gets its own mini icon
|
||||
(essentially a favicon, a 16x16 .ICO). You can add as many of these as you
|
||||
need.
|
||||
(essentially a favicon, a 16x16 .ICO). You can add as many of these as you need.
|
||||
|
||||
```html
|
||||
<meta name="msapplication-task" content="name=Task 1;action-uri=http://host/Page1.html;icon-uri=http://host/icon1.ico">
|
||||
@@ -286,42 +259,31 @@ need.
|
||||
|
||||
Windows 8 adds the ability for you to provide a PNG tile image and specify the
|
||||
tile's background color. [Full details on the IE
|
||||
blog](https://blogs.msdn.microsoft.com/ie/2012/06/08/high-quality-visuals-for-pinned-sites-in-windows-8/).
|
||||
blog](https://docs.microsoft.com/en-us/archive/blogs/ie/high-quality-visuals-for-pinned-sites-in-windows-8).
|
||||
|
||||
* Create a 144x144 image of your site icon, filling all of the canvas, and
|
||||
using a transparent background.
|
||||
* Save this image as a 32-bit PNG and optimize it without reducing
|
||||
colour-depth. It can be named whatever you want (e.g. `metro-tile.png`).
|
||||
* To reference the tile and its color, add the HTML `meta` elements described
|
||||
in the IE Blog post.
|
||||
* Create a 144x144 image of your site icon, filling all of the canvas, and using
|
||||
a transparent background.
|
||||
* Save this image as a 32-bit PNG and optimize it without reducing colour-depth.
|
||||
It can be named whatever you want (e.g. `metro-tile.png`).
|
||||
* To reference the tile and its color, add the HTML `meta` elements described in
|
||||
the IE Blog post.
|
||||
|
||||
### (Windows 8) Badges for Pinned Sites
|
||||
|
||||
IE will poll an XML document for badge information to display on your app's
|
||||
tile in the Start screen. The user will be able to receive these badge updates
|
||||
even when your app isn't actively running. The badge's value can be a number,
|
||||
or one of a predefined list of glyphs.
|
||||
IE will poll an XML document for badge information to display on your app's tile
|
||||
in the Start screen. The user will be able to receive these badge updates even
|
||||
when your app isn't actively running. The badge's value can be a number, or one
|
||||
of a predefined list of glyphs.
|
||||
|
||||
* [Tutorial on IEBlog with link to badge XML schema](https://blogs.msdn.microsoft.com/ie/2012/04/03/pinned-sites-in-windows-8/)
|
||||
* [Available badge values](https://docs.microsoft.com/en-us/uwp/schemas/tiles/badgeschema/element-badge)
|
||||
* [Tutorial on IEBlog with link to badge XML
|
||||
schema](https://docs.microsoft.com/en-us/archive/blogs/ie/pinned-sites-in-windows-8)
|
||||
* [Available badge
|
||||
values](https://docs.microsoft.com/en-us/uwp/schemas/tiles/badgeschema/element-badge)
|
||||
|
||||
```html
|
||||
<meta name="msapplication-badge" value="frequency=NUMBER_IN_MINUTES;polling-uri=https://www.example.com/path/to/file.xml">
|
||||
```
|
||||
|
||||
### Disable link highlighting upon tap in IE10
|
||||
|
||||
Similar to [-webkit-tap-highlight-color](https://davidwalsh.name/mobile-highlight-color)
|
||||
in iOS Safari. Unlike that CSS property, this is an HTML meta element, and its
|
||||
value is boolean rather than a color. It's all or nothing.
|
||||
|
||||
```html
|
||||
<meta name="msapplication-tap-highlight" content="no" />
|
||||
```
|
||||
|
||||
You can read about this useful element and more techniques in
|
||||
[Microsoft's documentation on adapting WebKit-oriented apps for IE10](https://blogs.windows.com/buildingapps/2012/11/15/adapting-your-webkit-optimized-site-for-internet-explorer-10/)
|
||||
|
||||
## Search
|
||||
|
||||
### Direct search spiders to your sitemap
|
||||
@@ -332,9 +294,8 @@ Submit it to search engine tool:
|
||||
* [Google](https://www.google.com/webmasters/tools/sitemap-list)
|
||||
* [Bing](https://www.bing.com/toolbox/webmaster)
|
||||
* [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:
|
||||
* [Baidu](https://zhanzhang.baidu.com/) OR Insert the following line anywhere in
|
||||
your robots.txt file, specifying the path to your sitemap:
|
||||
```
|
||||
Sitemap: https://example.com/sitemap_location.xml
|
||||
```
|
||||
@@ -365,17 +326,14 @@ plugin](https://www.google.com/search?ie=UTF-8&q=how+to+make+browser+search+plug
|
||||
|
||||
## Miscellaneous
|
||||
|
||||
* Use [polyfills](https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills).
|
||||
* Use
|
||||
[polyfills](https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills).
|
||||
|
||||
* Use [Microformats](http://microformats.org/wiki/Main_Page) (via
|
||||
[microdata](http://microformats.org/wiki/microdata)) for optimum search
|
||||
results
|
||||
[visibility](https://webmasters.googleblog.com/2009/05/introducing-rich-snippets.html).
|
||||
|
||||
* If you're building a web app you may want [native style momentum scrolling in
|
||||
iOS 5+](https://www.johanbrook.com/writings/native-style-momentum-scrolling-to-arrive-in-ios-5/)
|
||||
using `-webkit-overflow-scrolling: touch`.
|
||||
|
||||
* If you want to disable the translation prompt in Chrome or block Google
|
||||
Translate from translating your web page, use [`<meta name="google"
|
||||
content="notranslate">`](https://support.google.com/webmasters/answer/79812).
|
||||
@@ -396,7 +354,7 @@ plugin](https://www.google.com/search?ie=UTF-8&q=how+to+make+browser+search+plug
|
||||
### RSS
|
||||
|
||||
Have an RSS feed? Link to it here. Want to [learn how to write an RSS feed from
|
||||
scratch](http://www.rssboard.org/rss-specification)?
|
||||
scratch](https://www.rssboard.org/rss-specification)?
|
||||
|
||||
```html
|
||||
<link rel="alternate" type="application/rss+xml" title="RSS" href="/rss.xml">
|
||||
@@ -404,8 +362,8 @@ scratch](http://www.rssboard.org/rss-specification)?
|
||||
|
||||
### Atom
|
||||
|
||||
Atom is similar to RSS, and you might prefer to use it instead of or in
|
||||
addition to it. [See what Atom's all
|
||||
Atom is similar to RSS, and you might prefer to use it instead of or in addition
|
||||
to it. [See what Atom's all
|
||||
about](https://en.wikipedia.org/wiki/Atom_(Web_standard)).
|
||||
|
||||
```html
|
||||
@@ -414,16 +372,19 @@ about](https://en.wikipedia.org/wiki/Atom_(Web_standard)).
|
||||
|
||||
### Pingbacks
|
||||
|
||||
Your server may be notified when another site links to yours. The href
|
||||
attribute should contain the location of your pingback service.
|
||||
Your server may be notified when another site links to yours. The href attribute
|
||||
should contain the location of your pingback service.
|
||||
|
||||
```html
|
||||
<link rel="pingback" href="">
|
||||
```
|
||||
|
||||
* High-level explanation: https://codex.wordpress.org/Introduction_to_Blogging#Pingbacks
|
||||
* Step-by-step example case: https://www.hixie.ch/specs/pingback/pingback-1.0#TOC5
|
||||
* PHP pingback service: https://web.archive.org/web/20131211032834/http://blog.perplexedlabs.com/2009/07/15/xmlrpc-pingbacks-using-php/
|
||||
* High-level explanation:
|
||||
https://codex.wordpress.org/Introduction_to_Blogging#Pingbacks
|
||||
* Step-by-step example case:
|
||||
https://www.hixie.ch/specs/pingback/pingback-1.0#TOC5
|
||||
* PHP pingback service:
|
||||
https://web.archive.org/web/20131211032834/http://blog.perplexedlabs.com/2009/07/15/xmlrpc-pingbacks-using-php/
|
||||
|
||||
|
||||
|
||||
@@ -440,11 +401,11 @@ Take full advantage of Facebook's support for complex data and activity by
|
||||
following the [Open Graph
|
||||
tutorial](https://developers.facebook.com/docs/sharing/webmasters/getting-started).
|
||||
|
||||
For a reference of Open Graph's markup and properties, you may check
|
||||
[Facebook's Open Graph Protocol reference](http://ogp.me/). Finally,
|
||||
you can validate your markup with the [Facebook Object
|
||||
Debugger](https://developers.facebook.com/tools/debug/) (needs
|
||||
registration to Facebook).
|
||||
For a reference of Open Graph's markup and properties, you may check [Facebook's
|
||||
Open Graph Protocol reference](https://ogp.me). Finally, you can validate your
|
||||
markup with the [Facebook Object
|
||||
Debugger](https://developers.facebook.com/tools/debug/) (needs registration to
|
||||
Facebook).
|
||||
|
||||
```html
|
||||
<meta property="fb:app_id" content="123456789">
|
||||
@@ -460,11 +421,13 @@ registration to Facebook).
|
||||
### Twitter Cards
|
||||
|
||||
Twitter provides a snippet specification that serves a similar purpose to Open
|
||||
Graph. In fact, Twitter will use Open Graph when Cards is not available. You
|
||||
can read more about the various snippet formats and application process in the
|
||||
[official Twitter Cards documentation](https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/abouts-cards),
|
||||
and you can validate your markup with the [Card validator](https://cards-dev.twitter.com/validator)
|
||||
(needs registration to Twitter).
|
||||
Graph. In fact, Twitter will use Open Graph when Cards is not available. You can
|
||||
read more about the various snippet formats in the
|
||||
[official Twitter Cards
|
||||
documentation](https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/abouts-cards),
|
||||
and you can validate your markup with the [Card
|
||||
validator](https://cards-dev.twitter.com/validator) (needs registration to
|
||||
Twitter).
|
||||
|
||||
```html
|
||||
<meta name="twitter:card" content="summary">
|
||||
@@ -476,31 +439,29 @@ and you can validate your markup with the [Card validator](https://cards-dev.twi
|
||||
<meta name="twitter:image" content="https://www.example.com/path/to/image.jpg">
|
||||
```
|
||||
|
||||
### Google+ / Schema.org
|
||||
### Schema.org
|
||||
|
||||
Google also provides a snippet specification that serves a similar
|
||||
purpose to Facebook's Open Graph or Twitter Cards. While it helps you
|
||||
to control information displayed on Google+, this metadata is a subset
|
||||
of [schema.org's microdata vocabulary](https://schema.org/), which
|
||||
covers many other schemas that can describe the content of your pages
|
||||
to search engines. For this reason, this metadata is more generic for
|
||||
SEO, notably for Google's search-engine, although this vocabulary is
|
||||
also used by Microsoft, Pinterest and Yandex.
|
||||
Google also provides a snippet specification that serves a similar purpose to
|
||||
Facebook's Open Graph or Twitter Cards. This metadata is a subset of
|
||||
[schema.org's microdata vocabulary](https://schema.org/), which covers many
|
||||
other schemas that can describe the content of your pages to search engines. For
|
||||
this reason, this metadata is more generic for SEO, notably for Google's
|
||||
search-engine, although this vocabulary is also used by Microsoft, Pinterest and
|
||||
Yandex.
|
||||
|
||||
You can validate your markup with the [Structured Data Testing
|
||||
Tool](https://developers.google.com/structured-data/testing-tool/).
|
||||
Also, please note that this markup requires to add attributes to your
|
||||
top `html` tag.
|
||||
Tool](https://search.google.com/structured-data/testing-tool). Also, please
|
||||
note that this markup requires to add attributes to your top `html` tag.
|
||||
|
||||
```html
|
||||
<html class="no-js" lang="" itemscope itemtype="http://schema.org/Article">
|
||||
<head>
|
||||
<html class="no-js" lang="" itemscope itemtype="https://schema.org/Article">
|
||||
<head>
|
||||
|
||||
<link rel="author" href="">
|
||||
<link rel="publisher" href="">
|
||||
<meta itemprop="name" content="">
|
||||
<meta itemprop="description" content="">
|
||||
<meta itemprop="image" content="">
|
||||
<link rel="author" href="">
|
||||
<link rel="publisher" href="">
|
||||
<meta itemprop="name" content="">
|
||||
<meta itemprop="description" content="">
|
||||
<meta itemprop="image" content="">
|
||||
```
|
||||
|
||||
## URLs
|
||||
@@ -519,15 +480,16 @@ the cleaner, more accurate `https://www.example.com/cart.html`.
|
||||
### Separate mobile URLs
|
||||
|
||||
If you use separate URLs for desktop and mobile users, you should consider
|
||||
helping search engine algorithms better understand the configuration on your
|
||||
web site.
|
||||
helping search engine algorithms better understand the configuration on your web
|
||||
site.
|
||||
|
||||
This can be done by adding the following annotations in your HTML pages:
|
||||
|
||||
* on the desktop page, add the `link rel="alternate"` tag pointing to the
|
||||
corresponding mobile URL, e.g.:
|
||||
|
||||
`<link rel="alternate" media="only screen and (max-width: 640px)" href="https://m.example.com/page.html" >`
|
||||
`<link rel="alternate" media="only screen and (max-width: 640px)"
|
||||
href="https://m.example.com/page.html" >`
|
||||
|
||||
* on the mobile page, add the `link rel="canonical"` tag pointing to the
|
||||
corresponding desktop URL, e.g.:
|
||||
@@ -545,8 +507,8 @@ There are a couple of meta tags that provide information about a web app when
|
||||
added to the Home Screen on iOS:
|
||||
|
||||
* 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
|
||||
default view by adding `apple-mobile-web-app-status-bar-style`.
|
||||
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`.
|
||||
|
||||
```html
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
@@ -554,25 +516,25 @@ default view by adding `apple-mobile-web-app-status-bar-style`.
|
||||
```
|
||||
|
||||
* You can use `apple-mobile-web-app-title` to add a specific sites name for the
|
||||
Home Screen icon. This works since iOS 6.
|
||||
Home Screen icon.
|
||||
|
||||
```html
|
||||
<meta name="apple-mobile-web-app-title" content="">
|
||||
```
|
||||
|
||||
For further information please read the [official
|
||||
documentation](https://developer.apple.com/library/safari/#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.
|
||||
|
||||
|
||||
### Apple Touch Icons
|
||||
|
||||
Apple touch icons are used as icons when a user adds your webapp to the home
|
||||
screen of aniOS devices.
|
||||
Apple touch icons are used as icons when a user adds your webapp to the home
|
||||
screen of an iOS devices.
|
||||
|
||||
Though the dimensions of the icon can vary between iOS devices and versions
|
||||
one `180×180px` touch icon named `icon.png` and including the following in
|
||||
the `<head>` of the page is enough:
|
||||
Though the dimensions of the icon can vary between iOS devices and versions one
|
||||
`180×180px` touch icon named `icon.png` and including the following in the
|
||||
`<head>` of the page is enough:
|
||||
|
||||
```html
|
||||
<link rel="apple-touch-icon" href="icon.png">
|
||||
@@ -587,8 +549,8 @@ Icons](https://mathiasbynens.be/notes/touch-icons).
|
||||
Apart from that it is possible to add start-up screens for web apps on iOS. This
|
||||
basically works by defining `apple-touch-startup-image` with an according link
|
||||
to the image. Since iOS devices have different screen resolutions it maybe
|
||||
necessary to add media queries to detect which image to load. Here is an
|
||||
example for an iPhone:
|
||||
necessary to add media queries to detect which image to load. Here is an example
|
||||
for an iPhone:
|
||||
|
||||
```html
|
||||
<link rel="apple-touch-startup-image" media="(max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)" href="img/startup.png">
|
||||
@@ -613,10 +575,11 @@ Same applies to the touch icons:
|
||||
|
||||
### Theme Color
|
||||
|
||||
You can add the [`theme-color` meta extension](https://html.spec.whatwg.org/multipage/semantics.html#meta-theme-color)
|
||||
in the `<head>` of your pages to suggest the color that browsers and
|
||||
OSes should use if they customize the display of individual pages in
|
||||
their UIs with varying colors.
|
||||
You can add the [`theme-color` meta
|
||||
extension](https://html.spec.whatwg.org/multipage/semantics.html#meta-theme-color)
|
||||
in the `<head>` of your pages to suggest the color that browsers and OSes should
|
||||
use if they customize the display of individual pages in their UIs with varying
|
||||
colors.
|
||||
|
||||
```html
|
||||
<meta name="theme-color" content="#ff69b4">
|
||||
@@ -624,17 +587,19 @@ their UIs with varying colors.
|
||||
|
||||
The `content` attribute extension can take any valid CSS color.
|
||||
|
||||
Currently, the `theme-color` meta extension is supported by [Chrome 39+
|
||||
for Android Lollipop](https://developers.google.com/web/updates/2014/11/Support-for-theme-color-in-Chrome-39-for-Android).
|
||||
Currently, the `theme-color` meta extension is supported by [Chrome 39+ for
|
||||
Android
|
||||
Lollipop](https://developers.google.com/web/updates/2014/11/Support-for-theme-color-in-Chrome-39-for-Android).
|
||||
|
||||
|
||||
## security.txt
|
||||
|
||||
When security risks in web services are discovered by users they often lack the
|
||||
channels to disclose them properly. As a result, security issues may be left unreported.
|
||||
channels to disclose them properly. As a result, security issues may be left
|
||||
unreported.
|
||||
|
||||
Security.txt defines a standard to help organizations define the process for
|
||||
users to disclose security vulnerabilities securely. Include a text
|
||||
file on your server at `.well-known/security.txt` with the relevant contact details.
|
||||
Security.txt defines a standard to help organizations define the process for
|
||||
users to disclose security vulnerabilities securely. Include a text file on your
|
||||
server at `.well-known/security.txt` with the relevant contact details.
|
||||
|
||||
Check [https://securitytxt.org/](https://securitytxt.org/) for more details.
|
||||
|
||||
@@ -4,9 +4,8 @@ table of contents](TOC.md)
|
||||
# Frequently asked questions
|
||||
|
||||
* [Why is the Google Analytics code at the bottom? Google recommends it be
|
||||
placed in the `<head>`.](#why-is-the-google-analytics-code-at-the-bottom-google-recommends-it-be-placed-in-the-head)
|
||||
* [How can I integrate Bootstrap with HTML5
|
||||
Boilerplate?](#how-can-i-integrate-bootstrap-with-html5-boilerplate)
|
||||
placed in the
|
||||
`<head>`.](#why-is-the-google-analytics-code-at-the-bottom-google-recommends-it-be-placed-in-the-head)
|
||||
* [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)
|
||||
* [Where can I get help with support
|
||||
@@ -14,29 +13,30 @@ table of contents](TOC.md)
|
||||
|
||||
---
|
||||
|
||||
### Why is the Google Analytics code at the bottom? Google recommends it be placed in the `<head>`.
|
||||
## Why is the Google Analytics code at the bottom? Google recommends it be placed in the `<head>`.
|
||||
|
||||
The main advantage of placing it in the `<head>` is that you will track the
|
||||
user's `pageview` even if they leave the page before it has been fully loaded.
|
||||
|
||||
Here's a handy quote from [Mathias Bynens](https://mathiasbynens.be/notes/async-analytics-snippet#comment-50) about our placement choice.
|
||||
Here's a handy quote from [Mathias
|
||||
Bynens](https://mathiasbynens.be/notes/async-analytics-snippet#comment-50) about
|
||||
our placement choice.
|
||||
>I should point out that it’s Google — not me — recommending to place this
|
||||
script before all other scripts in the document. The only real advantage is to
|
||||
catch a pageView call if your page fails to load completely (for example, if
|
||||
the user aborts loading, or quickly closes the page, etc.). Personally, I
|
||||
wouldn’t count that as a page view, so I actually prefer to place this script
|
||||
at the bottom, after all other scripts. This keeps all the scripts together and
|
||||
reinforces that scripts at the bottom are the right move. (Usually I
|
||||
concatenate and minify all my scripts into one .js file — the GA snippet being
|
||||
the suffix.)
|
||||
catch a pageView call if your page fails to load completely (for example, if the
|
||||
user aborts loading, or quickly closes the page, etc.). Personally, I wouldn’t
|
||||
count that as a page view, so I actually prefer to place this script at the
|
||||
bottom, after all other scripts. This keeps all the scripts together and
|
||||
reinforces that scripts at the bottom are the right move. (Usually I concatenate
|
||||
and minify all my scripts into one .js file — the GA snippet being the suffix.)
|
||||
|
||||
### 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?
|
||||
|
||||
No, just as you don't normally replace the foundation of a house once it
|
||||
was built. However, there is nothing stopping you from trying to work in the
|
||||
latest changes, but you'll have to assess the costs/benefits of doing so.
|
||||
No, just as you don't normally replace the foundation of a house once it was
|
||||
built. However, there is nothing stopping you from trying to work in the latest
|
||||
changes, but you'll have to assess the costs/benefits of doing so.
|
||||
|
||||
### Where can I get help with support questions?
|
||||
## Where can I get help with support questions?
|
||||
|
||||
Please ask for help on
|
||||
[StackOverflow](https://stackoverflow.com/questions/tagged/html5boilerplate).
|
||||
|
||||
264
src/doc/html.md
264
src/doc/html.md
@@ -9,22 +9,20 @@ By default, HTML5 Boilerplate provides two `html` pages:
|
||||
basis of all pages on your website
|
||||
* `404.html` - a placeholder 404 error page
|
||||
|
||||
|
||||
## `index.html`
|
||||
|
||||
|
||||
### The `no-js` Class
|
||||
|
||||
The `no-js` class is provided in order to allow you to more easily and
|
||||
explicitly add custom styles based on whether JavaScript is disabled
|
||||
(`.no-js`) or enabled (`.js`). Using this technique also helps [avoid the
|
||||
explicitly add custom styles based on whether JavaScript is disabled (`.no-js`)
|
||||
or enabled (`.js`). Using this technique also helps [avoid the
|
||||
FOUC](https://www.paulirish.com/2009/avoiding-the-fouc-v3/).
|
||||
|
||||
### Language Attribute
|
||||
|
||||
## Language Attribute
|
||||
|
||||
Please consider specifying the language of your content by adding a [value](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry) to the `lang`
|
||||
attribute in the `<html>` as in this example:
|
||||
Please consider specifying the language of your content by adding a
|
||||
[value](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry)
|
||||
to the `lang` attribute in the `<html>` as in this example:
|
||||
|
||||
```html
|
||||
<html class="no-js" lang="en">
|
||||
@@ -32,174 +30,224 @@ attribute in the `<html>` as in this example:
|
||||
|
||||
### The order of the `<title>` and `<meta>` tags
|
||||
|
||||
The charset declaration (`<meta charset="utf-8">`) must be included completely
|
||||
within the [first 1024 bytes of the document](https://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#charset)
|
||||
and should be specified as early as possible (before any content that could
|
||||
be controlled by an attacker, such as a `<title>` element) in order to avoid a
|
||||
potential [encoding-related security issue](https://code.google.com/archive/p/doctype-mirror/wikis/ArticleUtf7.wiki)
|
||||
The charset declaration (`<meta charset="utf-8">`) must be included completely
|
||||
within the [first 1024 bytes of the
|
||||
document](https://html.spec.whatwg.org/multipage/semantics.html#charset)
|
||||
and should be specified as early as possible (before any content that could be
|
||||
controlled by an attacker, such as a `<title>` element) in order to avoid a
|
||||
potential [encoding-related security
|
||||
issue](https://code.google.com/archive/p/doctype-mirror/wikis/ArticleUtf7.wiki)
|
||||
in Internet Explorer
|
||||
|
||||
## Meta Description
|
||||
### Meta Description
|
||||
|
||||
The `description` meta tag provides a short description of the page.
|
||||
In some situations this description is used as a part of the snippet
|
||||
shown in the search results.
|
||||
The `description` meta tag provides a short description of the page. In some
|
||||
situations this description is used as a part of the snippet shown in the search
|
||||
results.
|
||||
|
||||
```html
|
||||
<meta name="description" content="This is a description">
|
||||
```
|
||||
|
||||
Google's [Create good meta descriptions](https://support.google.com/webmasters/answer/35624?hl=en#meta-descriptions)
|
||||
Google's [Create good meta
|
||||
descriptions](https://support.google.com/webmasters/answer/35624?hl=en#meta-descriptions)
|
||||
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 [`viewport` meta
|
||||
tag](https://docs.google.com/present/view?id=dkx3qtm_22dxsrgcf4 "Viewport and
|
||||
Media Queries - The Complete Idiot's Guide"). You can find out more in [the
|
||||
MDN Web Docs](https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag).
|
||||
HTML5 Boilerplate comes with a simple setup that strikes a good balance for general use cases.
|
||||
Media Queries - The Complete Idiot's Guide"). You can find out more in [the MDN
|
||||
Web
|
||||
Docs](https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag).
|
||||
HTML5 Boilerplate comes with a simple setup that strikes a good balance for
|
||||
general use cases.
|
||||
|
||||
```html
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
```
|
||||
|
||||
If you want to take advantage of edge-to-edge displays of iPhone X/XS/XR you can do
|
||||
so with additional viewport parameters. [Check the WebKit blog](https://webkit.org/blog/7929/designing-websites-for-iphone-x/)
|
||||
for details.
|
||||
If you want to take advantage of edge-to-edge displays of iPhone X/XS/XR you
|
||||
can do so with additional viewport parameters. [Check the WebKit
|
||||
blog](https://webkit.org/blog/7929/designing-websites-for-iphone-x/) for
|
||||
details.
|
||||
|
||||
## Web App Manifest
|
||||
### Open Graph Metadata
|
||||
|
||||
HTML5 Boilerplate includes a simple web app manifest file.
|
||||
The [Open Graph Protocol](https://ogp.me/) allows you to define the way your
|
||||
site is presented when referenced on third party sites and applications
|
||||
(Facebook, Twitter, LinkedIn). The protocol provides a series of meta elements
|
||||
that define the details of your site. The required attributes define the title,
|
||||
preview image, URL, and [type](https://ogp.me/#types) (e.g., video, music,
|
||||
website, article).
|
||||
|
||||
The web app manifest is a simple JSON file that allows you to control how your
|
||||
app appears on a device's home screen, what it looks like when it launches
|
||||
in that context and what happens when it is launched. This allows for much greater
|
||||
control over the UI of a saved site or web app on a mobile device.
|
||||
``` html
|
||||
<meta property="og:title" content="">
|
||||
<meta property="og:type" content="">
|
||||
<meta property="og:url" content="">
|
||||
<meta property="og:image" content="">
|
||||
```
|
||||
|
||||
In addition to these four attributes there are many more attributes you can use
|
||||
to add more richness to the description of your site. This just represents the
|
||||
most basic implementation.
|
||||
|
||||
To see a working example, the following is the open graph metadata for the HTML5
|
||||
Boilerplate site. In addition to the required fields we add `og:description` to
|
||||
describe the site in more detail.
|
||||
|
||||
``` html
|
||||
<meta name="og:url" content="https://html5boilerplate.com/">
|
||||
<meta name="og:title" content="HTML5 ★ BOILERPLATE">
|
||||
<meta name="og:type" content="website">
|
||||
<meta name="og:description" content="The web’s most popular front-end template which helps you build fast, robust, and adaptable web apps or sites.">
|
||||
<meta name="og:image" content="https://html5boilerplate.com/icon.png">
|
||||
```
|
||||
|
||||
### Web App Manifest
|
||||
|
||||
HTML5 Boilerplate includes a simple web app manifest file.
|
||||
|
||||
The web app manifest is a simple JSON file that allows you to control how your
|
||||
app appears on a device's home screen, what it looks like when it launches in
|
||||
that context and what happens when it is launched. This allows for much greater`
|
||||
control over the UI of a saved site or web app on a mobile device.
|
||||
|
||||
It's linked to from the HTML as follows:
|
||||
|
||||
```html
|
||||
<link rel="manifest" href="site.webmanifest">
|
||||
```
|
||||
Our [site.webmanifest](https://github.com/h5bp/html5-boilerplate/blob/master/src/site.webmanifest) contains a very skeletal "app" definition, just to show the basic usage.
|
||||
You should fill this file out with [more information about your site or application](https://developer.mozilla.org/en-US/docs/Web/Manifest)
|
||||
|
||||
## Favicons and Touch Icon
|
||||
Our
|
||||
[site.webmanifest](https://github.com/h5bp/html5-boilerplate/blob/master/src/site.webmanifest)
|
||||
contains a very skeletal "app" definition, just to show the basic usage. You
|
||||
should fill this file out with [more information about your site or
|
||||
application](https://developer.mozilla.org/en-US/docs/Web/Manifest)
|
||||
|
||||
The shortcut icons should be put in the root directory of your site. `favicon.ico`
|
||||
is automatically picked up by browsers if it's placed in the root. HTML5
|
||||
Boilerplate comes with a default set of icons (include favicon and one Apple
|
||||
Touch Icon) that you can use as a baseline to create your own.
|
||||
### Favicons and Touch Icon
|
||||
|
||||
The shortcut icons should be put in the root directory of your site.
|
||||
`favicon.ico` is automatically picked up by browsers if it's placed in the root.
|
||||
HTML5 Boilerplate comes with a default set of icons (include favicon and one
|
||||
Apple Touch Icon) that you can use as a baseline to create your own.
|
||||
|
||||
Please refer to the more detailed description in the [Extend section](extend.md)
|
||||
of these docs.
|
||||
|
||||
## The Content Area
|
||||
### The Content Area
|
||||
|
||||
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 app development.
|
||||
intentional, in order to make the boilerplate suitable for both web page and web
|
||||
app development.
|
||||
|
||||
### Browser Upgrade Prompt
|
||||
|
||||
The main content area of the boilerplate includes a prompt to install an up to
|
||||
date browser for users of IE 9 and lower. If you intended to support IE, then you
|
||||
should edit or remove the snippet of code.
|
||||
|
||||
## Modernizr
|
||||
### Modernizr
|
||||
|
||||
HTML5 Boilerplate uses a custom build of Modernizr.
|
||||
|
||||
[Modernizr](https://modernizr.com/) is a JavaScript library which adds classes to
|
||||
the `html` element based on the results of feature test and which ensures that
|
||||
all browsers can make use of HTML5 elements (as it includes the HTML5 Shiv).
|
||||
This allows you to target parts of your CSS and JavaScript based on the
|
||||
[Modernizr](https://modernizr.com/) is a JavaScript library which adds classes
|
||||
to the `html` element based on the results of feature test and which ensures
|
||||
that all browsers can make use of HTML5 elements (as it includes the HTML5
|
||||
Shiv). This allows you to target parts of your CSS and JavaScript based on the
|
||||
features supported by a browser.
|
||||
|
||||
Starting with version 3 Modernizr can be customized using the [modernizr-config.json](https://github.com/h5bp/html5-boilerplate/blob/master/modernizr-config.json) and the
|
||||
[Modernizr command line utility](https://www.npmjs.com/package/modernizr-cli).
|
||||
Starting with version 3 Modernizr can be customized using the
|
||||
[modernizr-config.json](https://github.com/h5bp/html5-boilerplate/blob/master/modernizr-config.json)
|
||||
and the [Modernizr command line
|
||||
utility](https://www.npmjs.com/package/modernizr-cli).
|
||||
|
||||
## What About Polyfills?
|
||||
### What About Polyfills?
|
||||
|
||||
If you need to include [polyfills](https://remysharp.com/2010/10/08/what-is-a-polyfill)
|
||||
in your project, you must make sure those load before any other JavaScript. If you're
|
||||
using a polyfill CDN service, like [cdn.polyfill.io](https://cdn.polyfill.io/),
|
||||
just put it before the other scripts in the bottom of the page:
|
||||
If you need to include
|
||||
[polyfills](https://remysharp.com/2010/10/08/what-is-a-polyfill) in your
|
||||
project, you must make sure those load before any other JavaScript. If you're
|
||||
using a polyfill CDN service, like [polyfill.io](https://polyfill.io/v3/), just put
|
||||
it before the other scripts in the bottom of the page:
|
||||
|
||||
```html
|
||||
<script src="js/vendor/modernizr-3.7.1.min.js"></script>
|
||||
<script src="https://cdn.polyfill.io/v3/polyfill.min.js"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
|
||||
<script>window.jQuery || document.write('<script src="js/vendor/jquery-3.4.1.min.js"><\/script>')</script>
|
||||
<script src="js/vendor/modernizr-3.10.0.min.js"></script>
|
||||
<script src="https://polyfill.io/v3/polyfill.min.js"></script>
|
||||
<script src="js/plugins.js"></script>
|
||||
<script src="js/main.js"></script>
|
||||
</body>
|
||||
```
|
||||
|
||||
If you like to just include the polyfills yourself, you could include them in
|
||||
`js/plugins.js`. When you have a bunch of polyfills to load in, you could
|
||||
also create a `polyfills.js` file in the `js/vendor` directory or include the files
|
||||
individually and combine them using a build tool. Always ensure that the polyfills
|
||||
are all loaded before any other JavaScript.
|
||||
`js/plugins.js`. When you have a bunch of polyfills to load in, you could also
|
||||
create a `polyfills.js` file in the `js/vendor` directory or include the files
|
||||
individually and combine them using a build tool. Always ensure that the
|
||||
polyfills are all loaded before any other JavaScript.
|
||||
|
||||
There are some misconceptions about Modernizr and polyfills. It's important
|
||||
to understand that Modernizr just handles feature checking, not polyfilling
|
||||
itself. The only thing Modernizr does regarding polyfills is that the team
|
||||
maintains [a huge list of cross Browser polyfills](https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills).
|
||||
There are some misconceptions about Modernizr and polyfills. It's important to
|
||||
understand that Modernizr just handles feature checking, not polyfilling itself.
|
||||
The only thing Modernizr does regarding polyfills is that the team maintains [a
|
||||
huge list of cross Browser
|
||||
polyfills](https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills).
|
||||
|
||||
### jQuery CDN for jQuery
|
||||
### jQuery
|
||||
|
||||
The jQuery CDN version of the jQuery JavaScript library is referenced towards
|
||||
the bottom of the page. A local fallback of jQuery is included for rare instances
|
||||
when the CDN version might not be available, and to facilitate offline
|
||||
development.
|
||||
As of v8.0.0 we no longer include jQuery by default. Web development has
|
||||
changed a lot since we started this project and while many millions of sites
|
||||
still use jQuery there are many sites and applications that don't. 10 years ago
|
||||
jQuery _was_ JavaScript for most developers. That's not the case any more so
|
||||
we've made the decision to remove jQuery from the project.
|
||||
|
||||
The jQuery CDN version was chosen over other potential candidates
|
||||
([like Google's Hosted Libraries](https://developers.google.com/speed/libraries/))
|
||||
because it's fast ([comparable or faster than Google by some
|
||||
measures](https://www.cdnperf.com/#jsdelivr,cdnjs,google,yandex,microsoft,jquery,bootstrapcdn/https/90))
|
||||
and, (unlike Google's CDN) is available to China's hundreds of millions of internet users.
|
||||
For many years we [chose](https://github.com/h5bp/html5-boilerplate/issues/1191)
|
||||
the Google Hosted version over the jQuery CDN because it was available
|
||||
over HTTPS (the jQuery CDN was not,) and it offered a better chance of
|
||||
hitting the cache lottery owing to the popularity of the Google CDN.
|
||||
The first issue is no longer valid and the second is far outweighed by
|
||||
being able to serve jQuery to users in China.
|
||||
If you're interested in including it, you can easily install jQuery using the
|
||||
following command:
|
||||
|
||||
While the jQuery CDN is a strong default solution your site or application may
|
||||
require a different configuration. Testing your site with services like
|
||||
[WebPageTest](https://www.webpagetest.org/) and browser tools like
|
||||
[PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights/) will help you examine the real
|
||||
world performance of your site and can show where you can optimize your specific
|
||||
site or application.
|
||||
```
|
||||
npm install jQuery
|
||||
```
|
||||
|
||||
You can then copy the minified file into the `vendor` folder and add jQuery
|
||||
to the `index.html` manually.
|
||||
|
||||
To load jQuery from a CDN with a local fallback you can use the following:
|
||||
|
||||
``` html
|
||||
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
|
||||
<script>window.jQuery || document.write('<script src="js/vendor/jquery-3.5.1.min.js"><\/script>')</script>
|
||||
```
|
||||
|
||||
### Google Universal Analytics Tracking Code
|
||||
|
||||
Finally, an optimized version of the Google Universal Analytics tracking code is
|
||||
included.
|
||||
|
||||
We use `analytics.js` rather than the newer `gtag.js` as
|
||||
[it's faster and supports tasks and plugins](https://github.com/philipwalton/analyticsjs-boilerplate/issues/19#issuecomment-333714370)
|
||||
We use `analytics.js` rather than the newer `gtag.js` as [it's faster and
|
||||
supports tasks and
|
||||
plugins](https://github.com/philipwalton/analyticsjs-boilerplate/issues/19#issuecomment-333714370)
|
||||
|
||||
The beacon transport mechanism is used to send all hits [which saves HTTP requests and improves performance](https://philipwalton.com/articles/the-google-analytics-setup-i-use-on-every-site-i-build/#loading-analytics.js).
|
||||
Starting with version 8.0.0 we, by default, [anonymize IP
|
||||
addresses](https://support.google.com/analytics/answer/2763052). By
|
||||
default Google Analytics records the full IP address of a user visiting the
|
||||
site, but that full IP address is never available to the Google Analytics
|
||||
property admin. By anonymizing the IP address you can make your site more
|
||||
GDPR-compliant as a full IP address can be defined as PII (personally
|
||||
identifiable information.)
|
||||
|
||||
Google recommends that this script be placed at the top of the page.
|
||||
Factors to consider: if you place this script at the top of the page, you’ll
|
||||
be able to count users who don’t fully load the page, and you’ll incur the max
|
||||
number of simultaneous connections of the browser.
|
||||
The beacon transport mechanism is used to send all hits [which saves HTTP
|
||||
requests and improves
|
||||
performance](https://philipwalton.com/articles/the-google-analytics-setup-i-use-on-every-site-i-build/#loading-analytics.js).
|
||||
|
||||
Google recommends that this script be placed at the top of the page. Factors to
|
||||
consider: if you place this script at the top of the page, you’ll be able to
|
||||
count users who don’t fully load the page, and you’ll incur the max number of
|
||||
simultaneous connections of the browser.
|
||||
|
||||
Please be aware that while Google [states that it is fully GDPR compliant](https://privacy.google.com/businesses/compliance/),
|
||||
it is still possible to use analytics to violate GDPR.
|
||||
|
||||
Further information:
|
||||
|
||||
- [Introduction to
|
||||
* [Introduction to
|
||||
Analytics.js](https://developers.google.com/analytics/devguides/collection/analyticsjs/)
|
||||
- [Google Analytics Demos & Tools](https://ga-dev-tools.appspot.com/)
|
||||
* [Google Analytics Demos & Tools](https://ga-dev-tools.appspot.com/)
|
||||
* [Privacy Controls in Google Analytics](https://support.google.com/analytics/answer/9019185)
|
||||
|
||||
**N.B.** The Google Analytics snippet is included by default mainly
|
||||
because Google Analytics is [currently one of the most popular tracking
|
||||
**N.B.** The Google Analytics snippet is included by default mainly because
|
||||
Google Analytics is [currently one of the most popular tracking
|
||||
solutions](https://trends.builtwith.com/analytics/Google-Analytics) out there.
|
||||
However, its usage isn't set in stone, and you SHOULD consider exploring the
|
||||
[alternatives](https://en.wikipedia.org/wiki/List_of_web_analytics_software)
|
||||
and use whatever suits your needs best.
|
||||
|
||||
|
||||
[alternatives](https://en.wikipedia.org/wiki/List_of_web_analytics_software) and
|
||||
use whatever suits your needs best.
|
||||
|
||||
@@ -7,30 +7,29 @@ Information about the default JavaScript included in the project.
|
||||
|
||||
## main.js
|
||||
|
||||
This file can be used to contain or reference your site/app JavaScript code.
|
||||
If you're working on something more advanced you might replace this file
|
||||
entirely. That's cool.
|
||||
This file can be used to contain or reference your site/app JavaScript code. If
|
||||
you're working on something more advanced you might replace this file entirely.
|
||||
That's cool.
|
||||
|
||||
## plugins.js
|
||||
|
||||
This file can be used to contain all your plugins, such as jQuery plugins and
|
||||
other 3rd party scripts for a simple site.
|
||||
|
||||
One approach is to put jQuery plugins inside of a `(function($){ ...
|
||||
})(jQuery);` closure to make sure they're in the jQuery namespace safety
|
||||
blanket. Read more about [jQuery plugin
|
||||
authoring](https://learn.jquery.com/plugins/#Getting_Started).
|
||||
One approach is to put jQuery plugins inside of a `(function($){ ...})(jQuery);`
|
||||
closure to make sure they're in the jQuery namespace safety blanket. Read more
|
||||
about [jQuery plugin authoring](https://learn.jquery.com/plugins/).
|
||||
|
||||
By default the `plugins.js` file contains a small script to avoid `console`
|
||||
errors in browsers that lack a `console`. The script will make sure that, if
|
||||
a console method isn't available, that method will have the value of empty
|
||||
errors in browsers that lack a `console`. The script will make sure that, if a
|
||||
console method isn't available, that method will have the value of empty
|
||||
function, thus, preventing the browser from throwing an error.
|
||||
|
||||
## vendor
|
||||
|
||||
This directory can be used to contain all 3rd party library code.
|
||||
|
||||
Minified versions of the latest jQuery and Modernizr libraries are included by
|
||||
default. You may wish to create your own [custom Modernizr
|
||||
build with the online builder](https://www.modernizr.com/download/) or [command
|
||||
line tool](https://modernizr.com/docs#command-line-config).
|
||||
Our custom build of the Modernizr library is included by
|
||||
default. You may wish to create your own [custom Modernizr build with the online
|
||||
builder](https://modernizr.com/download/) or [command line
|
||||
tool](https://modernizr.com/docs#command-line-config).
|
||||
|
||||
@@ -9,6 +9,7 @@ table of contents](TOC.md)
|
||||
* [robots.txt](#robotstxt)
|
||||
* [humans.txt](#humanstxt)
|
||||
* [browserconfig.xml](#browserconfigxml)
|
||||
* [package.json](#packagejson)
|
||||
|
||||
--
|
||||
|
||||
@@ -31,10 +32,9 @@ globally ignore:
|
||||
excludesfile = ~/.gitignore
|
||||
```
|
||||
|
||||
* More on global ignores: https://help.github.com/articles/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
|
||||
|
||||
|
||||
## .editorconfig
|
||||
|
||||
The `.editorconfig` file is provided in order to encourage and help you and
|
||||
@@ -58,7 +58,6 @@ access to `.editorconfig` files, as they can disclose sensitive information!
|
||||
For more details, please refer to the [EditorConfig
|
||||
project](https://editorconfig.org/).
|
||||
|
||||
|
||||
## Server Configuration
|
||||
|
||||
H5BP includes a [`.htaccess`](#htaccess) file for the [Apache HTTP
|
||||
@@ -80,11 +79,10 @@ The `.htaccess` file is mostly used for:
|
||||
|
||||
If you have access to the main server configuration file (usually called
|
||||
`httpd.conf`), you should add the logic from the `.htaccess` file in, for
|
||||
example, a <Directory> section in the main configuration file. This is usually
|
||||
example, a `<Directory>` section in the main configuration file. This is usually
|
||||
the recommended way, as using .htaccess files slows down Apache!
|
||||
|
||||
To enable Apache modules locally, please see:
|
||||
https://github.com/h5bp/server-configs-apache/wiki/How-to-enable-Apache-modules.
|
||||
To enable Apache modules locally, please see [the Apache modules documentation](https://github.com/h5bp/server-configs-apache#enable-apache-httpd-modules)
|
||||
|
||||
In the repo the `.htaccess` is used for:
|
||||
|
||||
@@ -113,7 +111,6 @@ section](https://httpd.apache.org/docs/current/howto/htaccess.html).
|
||||
Notice that the original repo for the `.htaccess` file is [this
|
||||
one](https://github.com/h5bp/server-configs-apache).
|
||||
|
||||
|
||||
## robots.txt
|
||||
|
||||
The `robots.txt` file is used to give instructions to web robots on what can
|
||||
@@ -121,8 +118,8 @@ be crawled from the website.
|
||||
|
||||
By default, the file provided by this project includes the next two lines:
|
||||
|
||||
* `User-agent: *` - the following rules apply to all web robots
|
||||
* `Disallow:` - everything on the website is allowed to be crawled
|
||||
* `User-agent: *` - the following rules apply to all web robots
|
||||
* `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
|
||||
`Disallow` directive (e.g.: `Disallow: /path`) or, if you want to disallow
|
||||
@@ -137,8 +134,8 @@ you want to block access to private content, use proper authentication instead.
|
||||
|
||||
For more information about `robots.txt`, please see:
|
||||
|
||||
* [robotstxt.org](http://www.robotstxt.org/)
|
||||
* [How Google handles the `robots.txt` file](https://developers.google.com/webmasters/control-crawl-index/docs/robots_txt)
|
||||
* [robotstxt.org](https://www.robotstxt.org/)
|
||||
* [How Google handles the `robots.txt` file](https://developers.google.com/search/reference/robots_txt)
|
||||
|
||||
## humans.txt
|
||||
|
||||
@@ -147,19 +144,18 @@ the website.
|
||||
|
||||
The provided file contains three sections:
|
||||
|
||||
* `TEAM` - this is intended to list the group of people responsible for the website
|
||||
* `THANKS` - this is intended to list the group of people that have contributed
|
||||
* `TEAM` - this is intended to list the group of people responsible for the website
|
||||
* `THANKS` - this is intended to list the group of people that have contributed
|
||||
to the website
|
||||
* `TECHNOLOGY COLOPHON` - the section lists technologies used to make the website
|
||||
|
||||
For more information about `humans.txt`, please see: http://humanstxt.org/
|
||||
* `TECHNOLOGY COLOPHON` - the section lists technologies used to make the website
|
||||
|
||||
For more information about `humans.txt`, please see: http://humanstxt.org/
|
||||
|
||||
## browserconfig.xml
|
||||
|
||||
The `browserconfig.xml` file is used to customize the tile displayed when users
|
||||
pin your site to the Windows 8.1 start screen. In there you can define custom
|
||||
tile colors, custom images or even [live tiles](https://msdn.microsoft.com/library/dn455106.aspx#CreatingLiveTiles).
|
||||
tile colors, custom images or even [live tiles](https://docs.microsoft.com/previous-versions/windows/internet-explorer/ie-developer/samples/dn455106(v=vs.85)).
|
||||
|
||||
By default, the file points to 2 placeholder tile images:
|
||||
|
||||
@@ -170,4 +166,38 @@ By default, the file points to 2 placeholder tile images:
|
||||
Notice that IE11 uses the same images when adding a site to the `favorites`.
|
||||
|
||||
For more in-depth information about the `browserconfig.xml` file, please
|
||||
see [MSDN](https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/dn320426(v=vs.85)).
|
||||
see [MSDN](https://docs.microsoft.com/previous-versions/windows/internet-explorer/ie-developer/platform-apis/dn320426(v=vs.85)).
|
||||
|
||||
## package.json
|
||||
|
||||
`package.json` is used to define attributes of your site or application for
|
||||
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:
|
||||
|
||||
* `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)
|
||||
and be unique.
|
||||
* `version` - indicates the version of your site application using semantic
|
||||
versioning ([semver](https://docs.npmjs.com/misc/semver))
|
||||
* `description` - describes your site.
|
||||
* `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)
|
||||
related to the package lifecycle that node understands automatically. You can
|
||||
also define custom scripts for use with your application development. We
|
||||
provide three custom scripts that work with Parcel to get you up and running
|
||||
quickly with a bundler for your assets and a simple development server.
|
||||
|
||||
* `start` builds your site and starts a server
|
||||
* `build` builds your `index.html` using Parcel
|
||||
* `dev` serves your `index.html` with a simple development server
|
||||
|
||||
* `keywords` - an array of keywords used to discover your app in the npm
|
||||
registry
|
||||
* `author` - defines the author of a package. There is also an alternative
|
||||
[contributors](https://docs.npmjs.com/files/package.json#people-fields-author-contributors)
|
||||
field if there's more than one author.
|
||||
* `license` - the license for your application. Must conform to
|
||||
[specific rules](https://docs.npmjs.com/files/package.json#license)
|
||||
* `devDependencies` - development dependencies for your package. In our case
|
||||
it's a single dependency, Parcel, which we use to bundle files and run a
|
||||
simple web server.
|
||||
|
||||
@@ -38,7 +38,6 @@ A basic HTML5 Boilerplate site initially looks something like this:
|
||||
│ ├── main.js
|
||||
│ ├── plugins.js
|
||||
│ └── vendor
|
||||
│ ├── jquery.min.js
|
||||
│ └── modernizr.min.js
|
||||
├── .editorconfig
|
||||
├── .htaccess
|
||||
@@ -48,6 +47,7 @@ A basic HTML5 Boilerplate site initially looks something like this:
|
||||
├── humans.txt
|
||||
├── icon.png
|
||||
├── index.html
|
||||
├── package.json
|
||||
├── robots.txt
|
||||
├── site.webmanifest
|
||||
├── tile.png
|
||||
@@ -80,8 +80,9 @@ refer to the [Apache Server Configs
|
||||
repository](https://github.com/h5bp/server-configs-apache).
|
||||
|
||||
Host your site on a server other than Apache? You're likely to find the
|
||||
corresponding server configs project listed in our [Server Configs
|
||||
](https://github.com/h5bp/server-configs/blob/master/README.md) repository.
|
||||
corresponding server configs project listed in our [Server
|
||||
Configs](https://github.com/h5bp/server-configs/blob/master/README.md)
|
||||
repository.
|
||||
|
||||
### 404.html
|
||||
|
||||
@@ -91,14 +92,14 @@ A helpful custom 404 to get you started.
|
||||
|
||||
This file contains all settings regarding custom tiles for IE11 and Edge.
|
||||
|
||||
For more info on this topic, please refer to
|
||||
[Microsoft's Docs](https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/dn320426(v=vs.85)).
|
||||
For more info on this topic, please refer to [Microsoft's
|
||||
Docs](https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/dn320426(v=vs.85)).
|
||||
|
||||
### .editorconfig
|
||||
|
||||
The `.editorconfig` file is provided in order to encourage and help you and
|
||||
your team to maintain consistent coding styles between different
|
||||
editors and IDEs. [Read more about the `.editorconfig` file](misc.md#editorconfig).
|
||||
The `.editorconfig` file is provided in order to encourage and help you and your
|
||||
team to maintain consistent coding styles between different editors and IDEs.
|
||||
[Read more about the `.editorconfig` file](misc.md#editorconfig).
|
||||
|
||||
### index.html
|
||||
|
||||
@@ -117,14 +118,19 @@ corresponding snippet at the bottom to include your analytics ID.
|
||||
Edit this file to include the team that worked on your site/app, and the
|
||||
technology powering it.
|
||||
|
||||
### package.json
|
||||
|
||||
Edit this file to describe your application, add dependencies, scripts and
|
||||
other properties related to node based development and the npm registry
|
||||
|
||||
### robots.txt
|
||||
|
||||
Edit this file to include any pages you need hidden from search engines.
|
||||
|
||||
### Icons
|
||||
|
||||
Replace the default `favicon.ico`, `tile.png`, `tile-wide.png` and Apple
|
||||
Touch Icon with your own.
|
||||
Replace the default `favicon.ico`, `tile.png`, `tile-wide.png` and Apple Touch
|
||||
Icon with your own.
|
||||
|
||||
If you want to use different Apple Touch Icons for different resolutions please
|
||||
refer to the [according documentation](extend.md#apple-touch-icons).
|
||||
|
||||
@@ -7,6 +7,11 @@
|
||||
<meta name="description" content="">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<meta property="og:title" content="">
|
||||
<meta property="og:type" content="">
|
||||
<meta property="og:url" content="">
|
||||
<meta property="og:image" content="">
|
||||
|
||||
<link rel="manifest" href="site.webmanifest">
|
||||
<link rel="apple-touch-icon" href="icon.png">
|
||||
<!-- Place favicon.ico in the root directory -->
|
||||
@@ -18,22 +23,17 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!--[if IE]>
|
||||
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="https://browsehappy.com/">upgrade your browser</a> to improve your experience and security.</p>
|
||||
<![endif]-->
|
||||
|
||||
<!-- Add your site or application content here -->
|
||||
<p>Hello world! This is HTML5 Boilerplate.</p>
|
||||
<script src="js/vendor/modernizr-{{MODERNIZR_VERSION}}.min.js"></script>
|
||||
<script src="https://code.jquery.com/jquery-{{JQUERY_VERSION}}.min.js" integrity="{{JQUERY_SRI_HASH}}" crossorigin="anonymous"></script>
|
||||
<script>window.jQuery || document.write('<script src="js/vendor/jquery-{{JQUERY_VERSION}}.min.js"><\/script>')</script>
|
||||
<script src="js/plugins.js"></script>
|
||||
<script src="js/main.js"></script>
|
||||
|
||||
<!-- Google Analytics: change UA-XXXXX-Y to be your site's ID. -->
|
||||
<script>
|
||||
window.ga = function () { ga.q.push(arguments) }; ga.q = []; ga.l = +new Date;
|
||||
ga('create', 'UA-XXXXX-Y', 'auto'); ga('set','transport','beacon'); ga('send', 'pageview')
|
||||
ga('create', 'UA-XXXXX-Y', 'auto'); ga('set', 'anonymizeIp', true); ga('set', 'transport', 'beacon'); ga('send', 'pageview')
|
||||
</script>
|
||||
<script src="https://www.google-analytics.com/analytics.js" async></script>
|
||||
</body>
|
||||
|
||||
7450
src/package-lock.json
generated
Normal file
7450
src/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
17
src/package.json
Normal file
17
src/package.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": " ",
|
||||
"version": "0.0.1",
|
||||
"description": "",
|
||||
"keywords": "",
|
||||
"license": "",
|
||||
"author": "",
|
||||
"scripts": {
|
||||
"build": "parcel build index.html",
|
||||
"dev": "parcel index.html --open",
|
||||
"start": "npm run build && npm run dev",
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"parcel-bundler": "^1.12.4"
|
||||
}
|
||||
}
|
||||
@@ -56,16 +56,6 @@ function runTests() {
|
||||
checkString(path.resolve(dir, '.htaccess'), string, done);
|
||||
});
|
||||
|
||||
it('"index.html" should contain the correct jQuery version in the CDN URL', (done) => {
|
||||
const string = `code.jquery.com/jquery-${pkg.devDependencies.jquery}.min.js`;
|
||||
checkString(path.resolve(dir, 'index.html'), string, done);
|
||||
});
|
||||
|
||||
it('"index.html" should contain the correct jQuery version in the local URL', (done) => {
|
||||
const string = `js/vendor/jquery-${pkg.devDependencies.jquery}.min.js`;
|
||||
checkString(path.resolve(dir, 'index.html'), string, done);
|
||||
});
|
||||
|
||||
it('"index.html" should contain the correct Modernizr version in the local URL', (done) => {
|
||||
const string = `js/vendor/modernizr-${pkg.devDependencies.modernizr}.min.js`;
|
||||
checkString(path.resolve(dir, 'index.html'), string, done);
|
||||
|
||||
@@ -18,6 +18,7 @@ const expectedFilesInDistDir = [
|
||||
'.gitignore',
|
||||
'.htaccess',
|
||||
'404.html',
|
||||
'package.json',
|
||||
'browserconfig.xml',
|
||||
|
||||
'css/', // for directories, a `/` character
|
||||
@@ -49,7 +50,6 @@ const expectedFilesInDistDir = [
|
||||
'js/main.js',
|
||||
'js/plugins.js',
|
||||
'js/vendor/',
|
||||
`js/vendor/jquery-${pkg.devDependencies.jquery}.min.js`,
|
||||
`js/vendor/modernizr-${pkg.devDependencies.modernizr}.min.js`,
|
||||
|
||||
'LICENSE.txt',
|
||||
@@ -67,6 +67,12 @@ function checkFiles(directory, expectedFiles) {
|
||||
// Get the list of files from the specified directory
|
||||
const files = glob.sync('**/*', {
|
||||
'cwd': directory,
|
||||
'ignore': [
|
||||
'**/node_modules/**',
|
||||
'package-lock.json',
|
||||
'**/dist/**',
|
||||
'**/.cache/**',
|
||||
],
|
||||
'dot': true, // include hidden files
|
||||
'mark': true // add a `/` character to directory matches
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user