Compare commits

...

173 Commits

Author SHA1 Message Date
Rob Larsen
e1c4afe46a Merge pull request #2169 from h5bp/release/ship-v7.3.0
Release/ship v7.3.0
2019-11-19 13:43:13 -05:00
Rob Larsen
106a575359 updating the date in the changelog 2019-11-19 13:39:09 -05:00
Rob Larsen
d403a0d6d9 Final touches for the 7.3.0 release 2019-11-19 11:04:40 -05:00
Rob Larsen
04e14e29e5 updated version number 2019-11-07 10:45:43 -05:00
Rob Larsen
95e3bd5928 Readying the 7.30 release 2019-11-06 15:47:46 -05:00
Rob Larsen
c6872a598e Update npmpublish.yml 2019-11-06 11:01:38 -05:00
Rob Larsen
f4409d6845 version number, updates changelog 2019-11-06 10:54:54 -05:00
Rob Larsen
7bc43bd391 Documenting the different quick start options 2019-11-06 10:41:43 -05:00
Rob Larsen
e7ae4b371c adds action 2019-11-05 12:14:33 -05:00
Rob Larsen
fb3b47212d Merge branch 'master' into release/ship-v7.3.0 2019-11-05 12:12:38 -05:00
Rob Larsen
2b2bb45391 added modernizr 3.8
also updated with bet a flag to test github actions
2019-10-26 10:03:21 -04:00
Rob Larsen
551f0675c5 Update npmpublish.yml 2019-10-26 09:46:11 -04:00
Rob Larsen
f4cc1f2c52 create npm publish action 2019-10-26 09:40:35 -04:00
Rob Larsen
ff475a0bcb updated docs, package-lock and main.css 2019-10-25 14:47:58 -04:00
Rob Larsen
e3949f38dd Merge remote-tracking branch 'h5bp/master' into release/ship-v7.3.0 2019-10-25 14:46:49 -04:00
Rob Larsen
2aa0d1e4ff Merge pull request #2170 from dhurlburtusa/bugfix/remove-faq-question
Remove Question with No Answer
2019-10-25 14:33:41 -04:00
Danny Hurlburt
603b8c733c Remove Question with No Answer 2019-10-25 12:13:36 -06:00
Rob Larsen
0d7d807322 Update CHANGELOG.md 2019-10-25 14:12:56 -04:00
Rob Larsen
00e40b8d4e Merge pull request #2167 from h5bp/indenting-fix-to-2-spaces
Change indenting to 2 spaces to match `.editorconfig` code guide
2019-10-25 11:18:16 -04:00
Rob Larsen
859f2759c7 Merge pull request #2168 from h5bp/minor-docs-link-updates
HTTPS link to www.robotstxt.org and remove repeat links to normalize.css
2019-10-25 11:17:49 -04:00
Christian Oliff
666c6fd992 HTTPS link to www.robotstxt.org and remove repeat links to normalize.css 2019-10-24 12:09:43 +09:00
Christian Oliff
c79799382f Change indenting to 2 spaces to match editorconfig code guide 2019-10-24 12:00:40 +09:00
Christian Oliff
f1dd1c55ee Updates for v7.3.0
- Minor devdeps update for glob and mocha
- Update CHANGELOG with additonal changes and formatting fix (remove leading spaces and extraenous linebreak)
- Bump version number in `package.json`
2019-10-24 11:45:41 +09:00
Rob Larsen
04a90d7918 Update CHANGELOG.md 2019-10-23 15:12:33 -04:00
Rob Larsen
1cdbbd1cac Merge pull request #2164 from h5bp/enable-apache-config-link
update links to enable-apache-httpd-modules
2019-10-21 13:38:56 -04:00
Rob Larsen
a2edf757ca Merge pull request #2165 from h5bp/modernizr-link
remove www from modernizr.com link
2019-10-21 13:38:15 -04:00
Christian Oliff
3d055ba802 remove www from modernizr.com link
prevents a redirect... and remove an unneeded trailing space
2019-10-17 15:44:15 +09:00
Christian Oliff
cf06e83c34 update links to enable-apache-httpd-modules
The h5bp/server-configs-apache wiki is no longer online
2019-10-17 15:41:26 +09:00
Christian Oliff
1335de667b Merge pull request #2162 from h5bp/package-json-update
Add bugs URL and keywords array to `package.json`
2019-10-17 14:38:04 +09:00
Christian Oliff
d2abd41f4c Add bugs URL and keywords array to package.json
Rearanged a bit so the name and version at the top- I think this makes more logical sense.

Added bugs and keywords which could be useful for users.

REF:
- https://docs.npmjs.com/files/package.json#keywords
- https://docs.npmjs.com/files/package.json#bugs
2019-10-16 11:25:11 +09:00
Rob Larsen
8bf8ef7f10 Merge pull request #2161 from h5bp/update-dev-deps
update dev deps
2019-10-15 21:38:43 -04:00
Christian Oliff
6aad78be96 update dev deps
+all tests pass.

Note: the build removes `-webkit-box-shadow: none !important;` from the compiled CSS. I don't think that should have been there before. The webkit prefixed version hasn't been needed for a looooooong time. https://caniuse.com/#feat=mdn-css_properties_box-shadow
2019-10-15 14:35:03 +09:00
Rob Larsen
e7790563e7 Merge pull request #2153 from h5bp/jscsrc
remove .jscsrc config and remove gulp-jscs from package.json
2019-10-14 13:41:04 -04:00
Rob Larsen
60beb6f1ea Merge pull request #2157 from h5bp/editorconfig-rules
remove redundant rules from .editorconfig
2019-10-14 13:40:18 -04:00
Christian Oliff
f5aa308399 remove redundant rules from .editorconfig 2019-09-09 13:05:38 +09:00
Rob Larsen
ceb4620c78 Merge pull request #2155 from h5bp/https-ogp-me
HTTPS link to https://ogp.me/
2019-09-04 18:12:25 -04:00
Christian Oliff
b1afbb7736 HTTPS link to https://ogp.me/
Saves a HTTP redirect
2019-09-05 02:03:30 +09:00
Christian Oliff
d1fe0cae18 remove .jscsrc config and remove gulp-jscs from package.json
All tests pass and build completes.
This is no longer needed since we migrated to eslint. (REF: https://eslint.org/docs/user-guide/migrating-from-jscs)
2019-09-04 11:39:29 +09:00
Rob Larsen
4c9a2757ce Merge pull request #2151 from Symro/master
upgrade to gulp 4 and update others dev dependencies
2019-09-03 14:49:43 -04:00
Rob Larsen
978b1e3599 Merge pull request #2152 from h5bp/browserconfig-indent
browserconfig.xml: change indent size to 2
2019-09-03 14:24:05 -04:00
Christian Oliff
2d1a17aa53 change indent size to 2 to match editorconfig code styleguide
also reduces filesize from 417 bytes to 381. :-)
2019-09-03 12:36:09 +09:00
Sylvain
ef39fca315 eslint fixes 2019-09-02 07:00:39 -04:00
Sylvain
87e2c1762d update travis conf 2019-08-29 15:33:05 -04:00
Sylvain
fd5466914b fix npm run test task error caused by wrong babel import 2019-08-29 15:24:33 -04:00
Sylvain
0fe68e9ef0 upgrade to gulp 4 and update others dev dependencies 2019-08-29 14:43:43 -04:00
Rob Larsen
abe20877fd adds package-lock.json 2019-08-15 21:54:50 -04:00
Rob Larsen
cec65d5b04 Merge pull request #2145 from fendorio/master
Removed package-lock.json from .gitignore
2019-08-15 21:50:42 -04:00
Lee Brindley
d809a3118a Removed package-lock.json from .gitignore
Removed package-lock.json from .gitignore

package-lock.json is intended to be checked into source control, without a package-lock.json using npm makes little sense over yarn. 

I see this was added in 2017, when there was an issue with the package-lock.json updating, this issue is now long resolved.
2019-08-15 22:22:09 +01:00
Rob Larsen
5f00e40672 Merge pull request #2142 from h5bp/node-v8-min
bump lowest supported version of node to 8.x
2019-06-10 13:39:09 -04:00
Christian Oliff
6d925f6bbd bump lowest supported version of node to 8.x
previous versions are end-of-life.

REF: https://github.com/nodejs/Release
2019-06-08 13:40:19 +09:00
Rob Larsen
70c8822eb9 Merge pull request #2141 from h5bp/coliff-patch-1
Add docs update PRs to CHANGELOG
2019-06-04 12:42:45 -04:00
Christian Oliff
65911df321 Add docs update PRs to CHANGELOG 2019-06-05 01:18:32 +09:00
Rob Larsen
d6d7941c76 Merge pull request #2140 from h5bp/gulp-load-plugins-update
update version number in main.css by making a new build
2019-06-04 11:53:12 -04:00
Christian Oliff
5e369556ed update version number in main.css
+ security vuln devdep update
2019-06-05 00:28:25 +09:00
Christian Oliff
733e0b95e9 Revert "gulp-load-plugins update"
This reverts commit ec96be3eb8.
2019-06-05 00:25:56 +09:00
Christian Oliff
ec96be3eb8 gulp-load-plugins update
fix a security vuln https://github.com/jackfranklin/gulp-load-plugins#changelog
2019-06-05 00:20:52 +09:00
Rob Larsen
f3edff262b Merge pull request #2139 from h5bp/v720-package
update version number to v7.2.0
2019-06-04 11:01:55 -04:00
Christian Oliff
374d8f64d5 update version number to v7.2.0 2019-06-04 23:55:49 +09:00
Rob Larsen
77ee3d23f3 Merge pull request #2134 from h5bp/7.2.0
v7.2.0 release
2019-06-04 10:53:39 -04:00
Rob Larsen
4c5a0e4ecc Merge pull request #2138 from h5bp/update-css-docs
fix broken links in TOC
2019-06-04 10:53:09 -04:00
Christian Oliff
e0850d4fa2 fix broken links in TOC 2019-06-04 21:42:49 +09:00
Rob Larsen
0376ff1206 added main.css change 2019-06-04 08:15:50 -04:00
Rob Larsen
0562cf78d2 Merge pull request #2135 from h5bp/main-css-2
updating main.css
2019-06-04 07:23:14 -04:00
Rob Larsen
836b8b4a32 Merge pull request #2137 from h5bp/readme-badges
Add License, NPM Download counter and GitHub Stars counter badges
2019-06-04 07:23:00 -04:00
Christian Oliff
05a34396ed Add License, NPM Download counter and GitHub Stars counter badges 2019-06-04 12:10:40 +09:00
Rob Larsen
d260b75a49 updating main.css 2019-06-03 15:55:04 -04:00
Christian Oliff
a9f034bb5a Update CHANGELOG.md 2019-06-04 00:26:42 +09:00
Rob Larsen
bb95d69ce4 Merge pull request #2132 from h5bp/remove-analytics-defer
Remove 'defer' from Google Analytics snippet
2019-06-03 07:20:24 -04:00
Christian Oliff
e942f9c383 Remove defer from Google Analytics snippet 2019-06-03 10:38:05 +09:00
Rob Larsen
d3515538a9 Merge pull request #2128 from h5bp/ApacheServerConfigs321
update Apache Server Configs to 3.2.1
2019-05-28 11:16:25 -04:00
Christian Oliff
49c1bb2173 update Apache Server Configs to 3.2.1 2019-05-24 15:48:52 +09:00
Rob Larsen
0b3b843008 Merge pull request #2126 from h5bp/jquery-341
Update to jQuery 3.4.1
2019-05-02 08:05:25 -04:00
Christian Oliff
c5fff142db Update to jQuery 3.4.1
+ minor devdeps update
2019-05-02 20:57:58 +09:00
Rob Larsen
f52376f9bf Merge pull request #2125 from h5bp/html-docs-update
update jQuery and Modernizr (Docs)
2019-05-02 07:48:33 -04:00
Christian Oliff
035fa6554e update jQuery and Modernizr 2019-04-16 01:25:03 +09:00
Rob Larsen
6badd51420 Merge pull request #2124 from h5bp/jquery-341
update jQuery to v3.4.0
2019-04-11 14:28:59 -04:00
Christian Oliff
7293770809 update jQuery to v3.4.0
Improved performance and a minor vulnerability fix

REF: http://blog.jquery.com/2019/04/10/jquery-3-4-0-released/
2019-04-11 10:32:10 +09:00
Rob Larsen
b846ed928d Merge pull request #2122 from h5bp/jquery-cdn
jQuery CDN docs - remove unnecessary info
2019-03-19 16:37:47 -04:00
Christian Oliff
7bd9a8b4e9 revert removal of paragraph and instead clarify 'serve jQuery to users in China' 2019-03-19 12:34:36 +09:00
Rob Larsen
f38338068d Merge pull request #2121 from roblarsen/7.1.1
Upgrading modernizr and bumping version
2019-03-18 13:16:07 -04:00
Christian Oliff
2ef1629a5b remove unnessecary info 2019-03-18 10:01:49 +09:00
Christian Oliff
58618a202e update version to v7.1.0
+ minor devdeps update
+ update CHANGELOG.md
2019-03-18 09:55:13 +09:00
Rob Larsen
8372416cba Upgrading modernizr and bumping version 2019-03-15 16:04:53 -04:00
Christian Oliff
751dc34d02 Update modernizr-3.7.0.min.js (#2120)
This wasn't done correctly in the previous PR.
2019-03-11 10:38:52 -04:00
Christian Oliff
c9a3d57b8d Update Google Analytics docs and snippet (#2118)
- We now include ` ga('set','transport','beacon');` in the `index.html` analytics snippet for improved peformance
- Docs updated mentioning why we are using 'analytics.js' rather than 'gtag.js'. Removed link to mathias bynens old blog post as its not so relevant since the async snippet is included in the official Google Develoepr docs. There's a link to Philip Walton's excellent guide to advanced setup.
2019-03-08 16:55:46 -05:00
Christian Oliff
ec1a2165ba update CSS from main.css in dist (#2119) 2019-03-08 12:22:01 -05:00
Christian Oliff
95557efa65 Update Modernizr to 3.7.0 (#2116) 2019-03-07 14:59:42 -05:00
Christian Oliff
de8c28334e minor docs update (#2115)
Update https://cdn.polyfill.io from v2 to v3
Remove unneeded shrink-to-fit=no meta tag
2019-02-20 16:15:41 -05:00
Christian Oliff
fe815176cb Minor update to eslint-plugin-mocha and eslint (#2114) 2019-02-20 14:15:37 -05:00
Christian Oliff
b91f2a95a1 Merge pull request #2113 from mattbrundage/patch-1
Update index.html
2019-02-14 12:16:14 +09:00
Matt Brundage
81cd508b4d Update index.html 2019-02-13 12:16:38 -05:00
Matt Brundage
09729c6899 Update index.html
A more succinct way of writing the conditional comment -- still recognized by IE 5-9. (IE10+ doesn't support conditional comments)
2019-02-13 10:50:09 -05:00
Rob Larsen
409309c31e 7.0.1 (#2112)
updates main.css to latest, updates changelog and bumps version
2019-02-11 22:28:17 -05:00
Rob Larsen
32b38722c2 npm published 2019-02-09 08:37:36 -05:00
Rob Larsen
7069a1b789 Typo 2019-02-08 16:45:06 -05:00
Rob Larsen
61a8e30d74 Merge pull request #2107 from h5bp/changelog-update
Update CHANGELOG.md
2019-02-08 16:08:33 -05:00
Rob Larsen
81a3fef3d3 updating changelog 2019-02-08 15:33:52 -05:00
Rob Larsen
34dbedf293 Merge pull request #2110 from LeoColomb/patch-1
Bump apache-server-configs to v3.1.0
2019-02-08 10:55:42 -05:00
Léo Colombaro
81537a3827 Update .htaccess with config v3.1.0 2019-02-08 14:03:48 +01:00
Léo Colombaro
45ae13440f Bump apache-server-configs to v3.1.0 2019-02-08 14:00:10 +01:00
Rob Larsen
2c4c508a8a Merge pull request #2108 from h5bp/devdeps-update
Update package.json
2019-02-08 06:29:12 -05:00
Rob Larsen
9eae72a59b Merge pull request #2109 from h5bp/fix-for-dist-build
the CSS and html MD files hadn't been updated
2019-02-08 06:28:14 -05:00
Christian Oliff
d186e2c98f the CSS and html MD files hadn't been updated 2019-02-08 16:35:10 +09:00
Christian Oliff
26c4c0f8c7 Update package.json 2019-02-08 16:29:42 +09:00
Christian Oliff
36b68af67d Update CHANGELOG.md 2019-02-08 16:22:27 +09:00
Rob Larsen
bbe9e8ad10 Merge pull request #2074 from h5bp/v7.0
v7.0 Docs Update
2019-02-07 13:30:07 -05:00
Scott O'Hara
bad98c453e remove instances of shrink-to-fit=no (#2103)
closes #2102

Per my findings, the need for it as a default was rectified with the release of iOS 9.3, where the viewport no longer shrunk to accommodate overflow, as was introduced in iOS 9.
2018-12-17 15:52:18 -05:00
Richie Bendall
49130f6cfe Upgrade Normalize.css from 8.0.0 to 8.0.1 (#2104)
* Upgrade Normalize.css from 8.0.0 to 8.0.1

* Update Normalizecss version
2018-12-17 15:51:56 -05:00
Rob Larsen
cfc5f3a92c Merge branch 'master' into v7.0 2018-11-24 08:55:33 -05:00
Maxim Mazurok
c8767e30c9 Removed link to #404html (#2099)
I've removed link to #404html section of the page, since there is on section for 404 page and in IDE I'm getting "Cannot resolve anchor #404html" warning. I hope that it makes sense.
2018-11-02 21:35:43 -04:00
Christian Oliff
3170d21177 Removes "display": "standalone" from manifest (#2096) 2018-11-01 07:08:04 -04:00
Rob Larsen
570a5ef6ac updating CSS docs to reference main.css (#2079)
Also, o need to dupe this documentation over two repos.
2018-10-23 10:47:06 -04:00
Rob Larsen
41d8f945af removing travis-after-all (#2078)
closes #2020
2018-10-10 16:03:54 -04:00
Rob Larsen
a37fcc3dec Removes out of date comments (#2077)
Fixes #2052
2018-10-09 16:18:17 -04:00
Rob Larsen
e1e7277024 copies main.css from main.css project (#2066)
This code updates the package.json, build and tests to pull main.css from the main.css npm package.
2018-10-09 11:31:27 -04:00
coliff
85f99b9d5b Add security.txt details 2018-10-09 14:54:28 +09:00
coliff
c6b5f62d58 Add <meta name="theme-color" content="#fafafa"> 2018-10-09 01:16:42 +09:00
Christian Oliff
35c6157f34 Merge pull request #2060 from Richienb/patch-1
Improve PWA manifest
2018-10-09 01:11:40 +09:00
Richie Bendall
db6a08d4f6 Re Add display standalone attribute 2018-10-04 19:49:02 +13:00
Richie Bendall
b6cf4c1bb6 Re Add display standalone attribute 2018-10-04 19:48:36 +13:00
coliff
b3d07b191b update README to links to previous versions
- update package,json deps
2018-10-04 12:50:28 +09:00
coliff
a75c3a394f v7.0 (WIP)
- Remove unneeded x-ua-compatible - not needed for IE11
- Update many external links
- Fix typos
- Add info for creating a good meta description
- Add link for iPhone X viewport info
- Update browser upgrade prompt
- Remove integrating Bootstrap with H5BP (it was written a longtime ago and I don't think is relevant so much)
- Remove statement that Twitter Cards requires registering a domain
- Remove official shortlink section, it was always very poorly supported
- Made the touch icons sections more consise (no need at all to mention about non-retina iPhones and iOS versions prior to iOS 6 etc)
2018-10-04 12:36:59 +09:00
Christian Oliff
e7adcb40bc Merge pull request #2064 from h5bp/eslint-version
bump eslint version to 5.6.0
2018-10-04 11:33:37 +09:00
Christian Oliff
c52802b540 Fixing links on the EXTEND page (#2065)
- Removed dead link to http://dayofjs.com/videos/22158462/web-browsers_alex-russel
- Fix many redirects to browser docs on Mozilla, Apple, Faceook and Microsoft sites
2018-09-18 13:12:31 -04:00
Christian Oliff
05314199f3 bump eslint version to 5.6.0 2018-09-18 12:17:46 +09:00
Christian Oliff
2805813d1e Add Install with Yarn option (#2063)
Yarn is popular these days and H5BP is currently getting 2.4K downloads per month so I think it'd be good to add this here.
I changed the list of options to unnumbered as they aren't steps/instructions so bullets make more sense imho.
2018-09-17 23:14:33 -04:00
Christian Oliff
a139645651 update links (#2062)
- Fix for link to Google for mobile seperate links
- https link to hixie.ch
- fix link for Twitter Cards for Developers
2018-09-17 23:02:23 -04:00
Richie Bendall
11d70553eb Merge pull request #1 from h5bp/master
[pull] latest from master
2018-08-31 17:37:51 +12:00
Richie Bendall
1200a880cf Update dist manifest 2018-08-31 17:33:45 +12:00
Richie Bendall
64d90afde8 Update src manifest 2018-08-31 17:33:36 +12:00
Christian Oliff
2e754d881c updates to dev deps (#2061) 2018-08-30 11:59:20 -04:00
Richie Bendall
59961d6431 Update correct site manifest and apply suggestions 2018-08-30 23:38:27 +12:00
Richie Bendall
b6248446ed Reset incorrect site manifest 2018-08-30 23:38:06 +12:00
Richie Bendall
31fa69f21d Improve manifest 2018-08-29 23:56:04 +12:00
Rob Larsen
26316e0643 Update TOC.md 2018-08-15 13:03:56 -04:00
Waren Gonzaga
24c8fb2059 Update dev deps (#2058)
* Update dev deps

* Update package.json

update eslint again

* Update file_existence.js
2018-08-08 22:52:41 -04:00
Rob Larsen
2e32b433f7 removes package-lock.json 2018-07-05 12:41:41 -04:00
Christian Oliff
60198fa998 Ignore package-lock.json
We already do this on the html5boilerplate.com site
REF: https://github.com/h5bp/html5boilerplate.com/blob/master/.gitignore
2018-07-05 12:41:41 -04:00
Christian Oliff
7e74f27208 https links to editorconfig (#2055) 2018-05-30 12:15:41 -04:00
Christian Oliff
9dcf42b2a1 Update dev deps (#2053)
updates to:
```
babel-preset-env
gulp-rename
gulp-replace
mocha
```
2018-05-21 19:48:17 -04:00
子骅
7737439ab9 change the attribute of "notranslate" to "content" (#2050)
* change the key of "notranslate" to "content"

"value" is not a valid attribute on element meta (http://w3c.github.io/html/single-page.html#the-meta-element).
According to https://support.google.com/webmasters/answer/79812?hl=en,
content="notranslate" is recommended to use.

* don't specify the language on the Google site
2018-05-16 14:15:09 -04:00
Christian Oliff
269f72796f Prepare 6.1 release (#2045)
- Update `CHANGELOG.md` date
- Update dev deps
- Indenting on `index.html` to 2 space (was 4 space)
2018-05-01 12:36:59 -04:00
Rob Larsen
1b96f0fc4d adds 2042 2018-04-30 21:35:01 -04:00
Rob Larsen
1debe1a9b0 adds 2037 2018-04-30 21:35:01 -04:00
Christian Oliff
c7780e2a69 Update CHANGELOG.md 2018-04-30 21:35:01 -04:00
Léo Colombaro
b191874842 Bump Apache Server Config to v3 (#2042) 2018-04-17 13:19:36 -04:00
Rob Larsen
f121b53023 Features/eslint (#2037)
Fixes #1913

* Drops node 4

* update node engine to >=6 (#2035)

* syncs changes to spacing across different editorconfigs

* adds eslint with minimally invasive configuration- basically moving from 4 to 2 spaces.
2018-04-06 17:31:27 -04:00
Rob Larsen
2c8c4ea3c2 getting indent lined up across the project 2018-04-06 14:48:05 -04:00
Christian Oliff
475424abe2 HTTPS links (#2036)
* https a link

* https more links

* Fix paramaters typo

* Remove trailing . (unneeded)
2018-04-04 21:59:48 -04:00
Christian Oliff
0922cc62af Update package.json (#2034) 2018-03-29 22:59:15 -04:00
Christian Oliff
44f71e7e60 update devdeps (#2032) 2018-03-29 08:50:16 -04:00
Thomas Vantuycom
7523c41733 Replace node-sri with ssri (#2031)
Closes #1997.
2018-03-29 08:49:29 -04:00
Vladimir Kutepov
d6561f2c47 Add .babelrc and .prettierrc to .gitattributes (#2030) 2018-03-19 22:49:47 -04:00
Rob Larsen
d2f1bba395 Adding a note about PRs 2018-03-14 13:13:42 -04:00
Christian Oliff
ec30531d64 Update JS head snippets (#2029)
plus correct capitalization of JavaScript
2018-03-06 10:20:01 -05:00
Christian Oliff
39cb6359da Devdeps update (mocha, modernizr, normalize and gulp-autoprefixer) (#2028)
* Update Dev Dependencies

mocha, modernizr, gulp-autoprefixer updates.
The build tests run fine with no changes. The dist CSS is different as the PR from 2025 didn't include changes in the dist dir.

* Update Normalize
2018-03-05 21:50:53 -05:00
Gaël Poupard
24d1a3287d Remove clip-path (#2025)
Revert #1920 to fix #2021.
2018-02-05 20:27:42 -05:00
Christian Oliff
33648c2e21 update link to Atom RSS (#2024) 2018-02-05 12:45:20 -05:00
Christian Oliff
86df1ead6f Minor CSS comments update (#2019) 2018-01-26 07:43:02 -05:00
Christian Oliff
1359bb9322 Update to jQuery 3.3.1 (#2018) 2018-01-25 07:57:54 -05:00
Christian Oliff
7e7460e904 update dev dependencies (#2017) 2018-01-22 11:09:14 -05:00
Christian Oliff
23f2322ec5 Update to jQuery 3.3.0 (#2016) 2018-01-20 22:08:04 -05:00
Christian Oliff
698776558f Remove info about Flash in Metro mode IE10 (no longer applicable) (#2015)
This was addressed nearly 5 years ago:
https://blogs.msdn.microsoft.com/ie/2013/03/11/flash-in-windows-8/
2018-01-12 12:48:03 -05:00
Sumit Kumar
76f6b7d953 Upgrading to babel-preset-env (#2010) 2017-11-28 21:17:35 -05:00
Chris Watson
0ca2bc2f55 Updated tests (Travis and Mocha) and dependencies, rebuilt dist (#2009)
* docs: remove trailing whitespace in CHANGELOG.md

* test: update node versions & add trusty to travis

* test: update deps and test script in package.json

* refactor: rebuild & add updated docs, css, & html

* docs: remove duplicate 'be' in usage.md
2017-11-28 14:13:45 -05:00
Christian Oliff
33e0d7613a Create CODE_OF_CONDUCT.md (#2011) 2017-11-28 14:13:19 -05:00
byog
6180cd90fc Update extend.md (#2006)
* Update extend.md

* Update extend.md
2017-11-07 20:54:07 -05:00
Léo Colombaro
9a176f57af Update .htaccess to v2.15.0 from h5bp/server-configs-apache (#2003) 2017-10-31 09:34:48 -04:00
Azeem Bande-Ali
b831c7621f Add documentation for humans.txt (#2007)
* Add documentation for humans.txt

* Change src instead of dist
2017-10-31 09:31:34 -04:00
Abdel_95
37871286b4 double word on line 21 (be) (#1996)
Please the word 'be' duplicated and corrected that. 
Thanks.
2017-10-03 14:56:04 -04:00
Brayan Febles
4eb36b3c79 What about the meta tag, shrink-to-fit=no (#1984)
https://stackoverflow.com/questions/33767533/what-does-the-shrink-to-fit-viewport-meta-attribute-do
It worth?
I am trying to help please don't blame me
2017-09-25 21:14:07 -04:00
Jan Willem
f11f2fe2ab Fixed JSHint errors (#1994) 2017-09-25 21:13:05 -04:00
Rob Larsen
7db4ba338d adding npm instructions 2017-09-25 14:38:07 -04:00
54 changed files with 11259 additions and 2129 deletions

View File

@@ -1,22 +1,16 @@
# For more information about the properties used in
# this file, please see the EditorConfig documentation:
# http://editorconfig.org/
# https://editorconfig.org/
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_size = 2
indent_style = space
insert_final_newline = true
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

17
.eslintrc.js Normal file
View File

@@ -0,0 +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"]
}
};

46
.github/CODE_OF_CONDUCT.md vendored Normal file
View File

@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at h5bp@htmlcssjavascript.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [https://contributor-covenant.org/version/1/4][version]
[homepage]: https://contributor-covenant.org
[version]: https://contributor-covenant.org/version/1/4/

View File

@@ -130,7 +130,7 @@ included in the project:
```
4. Commit your changes in logical chunks. Please adhere to these [git commit
message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
message guidelines](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
or your code is unlikely be merged into the main project. Use Git's
[interactive rebase](https://help.github.com/articles/about-git-rebase/)
feature to tidy up your commits before making them public.

View File

@@ -14,5 +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.
Thanks!

32
.github/workflows/npmpublish.yml vendored Normal file
View File

@@ -0,0 +1,32 @@
name: publish npm
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
- run: npm ci
- run: npm run build
publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

68
.jscsrc
View File

@@ -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": "'"
}

View File

@@ -1,32 +0,0 @@
{
// Enforcing options
// http://jshint.com/docs/options/#enforcing-options
"bitwise": true,
"eqeqeq": true,
"forin": true,
"latedef": true,
"noarg": true,
"nonbsp": true,
"nonew": true,
"undef": true,
"unused": true,
// - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Relaxing options
// http://jshint.com/docs/options/#relaxing-options
"esnext": true,
// - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Environments
// http://jshint.com/docs/options/#environments
"browser": true,
"jquery": true,
"node": true
}

View File

@@ -2,31 +2,15 @@
# in this file, please see the Travis CI documentation:
# https://docs.travis-ci.com
after_success:
- |
# Automatically update the content from the `dist/` directory
$(npm bin)/travis-after-all \
&& $(npm bin)/set-up-ssh -k "$encrypted_7289798db853_key" \
-iv "$encrypted_7289798db853_iv" \
--path-encrypted-key ".travis/github_deploy_key.enc" \
&& $(npm bin)/commit-changes --branch "master" \
--commands "npm run build" \
--commit-message "Update content from the \`dist\` directory [skip ci]"
env:
global:
- secure: "uZ0R71TG9AR+kbfM9rwa8PPNr3f9E0C4OuA0s6g0Gq15bBcpVxPvus0/eJdW+O2NSzZE1GbzS//hBiP+chK/8X4DyNIRutlGk5RYdnTTFEaZo9jp0BvlvprUYlGgpprR/531zQ9ahkc0STwVvzurGzlcF4NNMiISAJJ1IdQZABc="
git:
depth: 10
language: node_js
node_js:
- 4
- 6
- 7
- 8
- 9
- 10
dist: trusty
sudo: false

View File

@@ -1,8 +1,63 @@
### 7.3.0 (November 19, 2019)
* Updated to Modernizr 3.8 ([2b2bb45](https://github.com/h5bp/html5-boilerplate/commit/2b2bb453916b4b09a6f0929340290dc2505f7ce9))
* Updated to Gulp 4 ([#2151](https://github.com/h5bp/html5-boilerplate/pull/2151))
* Updated package.json ([#2162](https://github.com/h5bp/html5-boilerplate/pull/#2162)) and enabled 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))
* Update Apache Server Configs to 3.2.1 ([#2128](https://github.com/h5bp/html5-boilerplate/pull/2128))
* Update main.css to v2.0.0 ([#2135](https://github.com/h5bp/html5-boilerplate/pull/2135))
* 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)
* 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))
* Minor docs updates ([#2115](https://github.com/h5bp/html5-boilerplate/pull/2115))
* 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)
* Bumps main.css to current version ([#2112](https://github.com/h5bp/html5-boilerplate/pull/2112))
### 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))
* Add theme-color meta tag to index.html ([#2074](https://github.com/h5bp/html5-boilerplate/pull/2074))
* Add 'install with yarn' steps to README ([#2063](https://github.com/h5bp/html5-boilerplate/pull/2063))
* Improved Webmanifest ([#2060](https://github.com/h5bp/html5-boilerplate/pull/2060))
* Upgrade Normalize to 8.0.1 ([#2104](https://github.com/h5bp/html5-boilerplate/pull/2104))
* Update .htaccess ([#2110](https://github.com/h5bp/html5-boilerplate/pull/2110))
* Remove instances of `shrink-to-fit=no` ([#2103](https://github.com/h5bp/html5-boilerplate/pull/2103))
* 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)
* [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 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))
* 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)
* Reverts .visuallyhidden (see [#1985](https://github.com/h5bp/html5-boilerplate/issues/1985))
### 6.0.0 (August 17, 2017)
* Fix Bug: .visuallyhidden on macOS VO fixes #1985 ([#1989](https://github.com/h5bp/html5-boilerplate/pull/1989))
@@ -10,16 +65,16 @@
* 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))
* Add the link for useful .gitignore templates ([#1936](https://github.com/h5bp/html5-boilerplate/pull/1936))
* Node plumbing updated ([#1925](https://github.com/h5bp/html5-boilerplate/pull/1925)) ([#1928](https://github.com/h5bp/html5-boilerplate/pull/1928)) ([#1931](https://github.com/h5bp/html5-boilerplate/pull/1931))
* Use es2015 syntax in mocha tests ([#1788](https://github.com/h5bp/html5-boilerplate/pull/1788))
* Use es2015 syntax in mocha tests ([#1788](https://github.com/h5bp/html5-boilerplate/pull/1788))
* Scope :first-letter selector for print styles ([#1904](https://github.com/h5bp/html5-boilerplate/pull/1904))
* Add SRI Hash for jQuery ([#1904](https://github.com/h5bp/html5-boilerplate/pull/1904))
* Add SRI Hash for jQuery ([#1904](https://github.com/h5bp/html5-boilerplate/pull/1904))
* Update .jshintrc ([#1903](https://github.com/h5bp/html5-boilerplate/pull/1903))
* Improve accessibility with visuallyhidden content ([#1900](https://github.com/h5bp/html5-boilerplate/pull/1900))
* Tell users that IE 8 and 9 are outdated
@@ -43,7 +98,7 @@
* 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)).
@@ -93,7 +148,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
@@ -112,7 +167,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
@@ -121,7 +176,7 @@
([#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)
@@ -132,11 +187,11 @@
* 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.
@@ -179,7 +234,7 @@
* 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.
@@ -188,7 +243,7 @@
* 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
@@ -219,7 +274,7 @@
* 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).
@@ -280,7 +335,7 @@
* Remove `handheld.css` as it has very poor device support.
* Remove touch-icon `link` elements from the HTML and include improved
touch-icon support.
* Remove the cache-busting query paramaters from files references in
* Remove the cache-busting query parameters from files references in
the HTML.
* Remove IE6 PNGFix.

View File

@@ -1,7 +1,10 @@
# [HTML5 Boilerplate](https://html5boilerplate.com/)
[![LICENSE](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://github.com/h5bp/html5-boilerplate/blob/master/LICENSE.txt)
[![Build Status](https://travis-ci.org/h5bp/html5-boilerplate.svg)](https://travis-ci.org/h5bp/html5-boilerplate)
[![devDependency Status](https://david-dm.org/h5bp/html5-boilerplate/dev-status.svg)](https://david-dm.org/h5bp/html5-boilerplate#info=devDependencies)
[![NPM Downloads](https://img.shields.io/npm/dt/html5-boilerplate.svg)](https://www.npmjs.com/package/html5-boilerplate)
[![github-stars-image](https://img.shields.io/github/stars/h5bp/html5-boilerplate.svg?label=github%20stars)](https://github.com/h5bp/html5-boilerplate)
HTML5 Boilerplate is a professional front-end template for building
fast, robust, and adaptable web apps or sites.
@@ -20,13 +23,19 @@ way that you want.
Choose one of the following options:
1. Download the latest stable release from
[html5boilerplate.com](https://html5boilerplate.com/).
2. 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.
* 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. 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.
## Features
@@ -55,17 +64,15 @@ Choose one of the following options:
* Chrome *(latest 2)*
* Edge *(latest 2)*
* Firefox *(latest 2)*
* Internet Explorer 9+
* Internet Explorer 11
* Opera *(latest 2)*
* Safari *(latest 2)*
*This doesn't mean that HTML5 Boilerplate cannot be used in older browsers,
just that we'll ensure compatibility with the ones mentioned above.*
If you need legacy browser support you
can use [HTML5 Boilerplate v4](https://github.com/h5bp/html5-boilerplate/tree/v4) (IE 6+, Firefox 3.6+, Safari 4+),
or [HTML5 Boilerplate v5](https://github.com/h5bp/html5-boilerplate/tree/v5.0.0) (IE8+). They are no longer actively developed.
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.
## Documentation
@@ -74,7 +81,6 @@ 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),
@@ -85,7 +91,6 @@ the [guidelines](.github/CONTRIBUTING.md):
* [Feature requests](.github/CONTRIBUTING.md#features)
* [Pull requests](.github/CONTRIBUTING.md#pull-requests)
## License
The code is available under the [MIT license](LICENSE.txt).

5
dist/.editorconfig vendored
View File

@@ -4,10 +4,7 @@ root = true
[*]
charset = utf-8
indent_size = 4
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false

38
dist/.gitattributes vendored
View File

@@ -46,8 +46,8 @@
*.xhtml text
## DOCKER
*.dockerignore text
Dockerfile text
*.dockerignore text
Dockerfile text
## DOCUMENTATION
*.markdown text
@@ -91,31 +91,33 @@ TODO text
*.twig text
## LINTERS
.babelrc text
.csslintrc text
.eslintrc text
.htmlhintrc text
.jscsrc text
.jshintrc text
.jshintignore text
.prettierrc text
.stylelintrc text
## CONFIGS
*.bowerrc text
*.cnf text
*.conf text
*.config text
.browserslistrc text
.editorconfig text
.gitattributes text
.gitconfig text
.gitignore text
.htaccess text
*.npmignore text
*.yaml text
*.yml text
browserslist text
Makefile text
makefile text
*.bowerrc text
*.cnf text
*.conf text
*.config text
.browserslistrc text
.editorconfig text
.gitattributes text
.gitconfig text
.gitignore text
.htaccess text
*.npmignore text
*.yaml text
*.yml text
browserslist text
Makefile text
makefile text
## HEROKU
Procfile text

558
dist/.htaccess vendored
View File

@@ -1,11 +1,11 @@
# Apache Server Configs v2.14.0 | MIT License
# Apache Server Configs v3.2.1 | MIT License
# https://github.com/h5bp/server-configs-apache
# (!) Using `.htaccess` files slows down Apache, therefore, if you have
# access to the main server configuration file (which is usually called
# `httpd.conf`), you should add this logic there.
#
# https://httpd.apache.org/docs/current/howto/htaccess.html.
# https://httpd.apache.org/docs/current/howto/htaccess.html
# ######################################################################
# # CROSS-ORIGIN #
@@ -18,8 +18,8 @@
# Allow cross-origin requests.
#
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS
# http://enable-cors.org/
# http://www.w3.org/TR/cors/
# https://enable-cors.org/
# https://www.w3.org/TR/cors/
# <IfModule mod_headers.c>
# Header set Access-Control-Allow-Origin "*"
@@ -48,6 +48,8 @@
# ----------------------------------------------------------------------
# Allow cross-origin access to web fonts.
#
# https://developers.google.com/fonts/docs/troubleshooting
<IfModule mod_headers.c>
<FilesMatch "\.(eot|otf|tt[cf]|woff2?)$">
@@ -66,14 +68,14 @@
# some of the attributes of the `PerformanceResourceTiming` object will
# be set to zero.
#
# http://www.w3.org/TR/resource-timing/
# http://www.stevesouders.com/blog/2014/08/21/resource-timing-practical-tips/
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Timing-Allow-Origin
# https://www.w3.org/TR/resource-timing/
# https://www.stevesouders.com/blog/2014/08/21/resource-timing-practical-tips/
# <IfModule mod_headers.c>
# Header set Timing-Allow-Origin: "*"
# </IfModule>
# ######################################################################
# # ERRORS #
# ######################################################################
@@ -83,6 +85,7 @@
# ----------------------------------------------------------------------
# Customize what Apache returns to the client in case of an error.
#
# https://httpd.apache.org/docs/current/mod/core.html#errordocument
ErrorDocument 404 /404.html
@@ -100,7 +103,6 @@ ErrorDocument 404 /404.html
Options -MultiViews
# ######################################################################
# # INTERNET EXPLORER #
# ######################################################################
@@ -120,36 +122,13 @@ Options -MultiViews
# consider enabling `Enterprise Mode` throughout your company.
#
# https://msdn.microsoft.com/en-us/library/ie/bg182625.aspx#docmode
# http://blogs.msdn.com/b/ie/archive/2014/04/02/stay-up-to-date-with-enterprise-mode-for-internet-explorer-11.aspx
# 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"
# `mod_headers` cannot match based on the content-type, however,
# the `X-UA-Compatible` response header should be send only for
# HTML documents and not for the other resources.
<FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
Header unset X-UA-Compatible
</FilesMatch>
Header set X-UA-Compatible "IE=edge" "expr=%{CONTENT_TYPE} =~ m#text/html#i"
</IfModule>
# ----------------------------------------------------------------------
# | Iframes cookies |
# ----------------------------------------------------------------------
# Allow cookies to be set from iframes in Internet Explorer.
#
# https://msdn.microsoft.com/en-us/library/ms537343.aspx
# http://www.w3.org/TR/2000/CR-P3P-20001215/
# <IfModule mod_headers.c>
# Header set P3P "policyref=\"/w3c/p3p.xml\", CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\""
# </IfModule>
# ######################################################################
# # MEDIA TYPES AND CHARACTER ENCODINGS #
# ######################################################################
@@ -171,16 +150,17 @@ Options -MultiViews
AddType application/json json map topojson
AddType application/ld+json jsonld
AddType application/rss+xml rss
AddType application/vnd.geo+json geojson
AddType application/xml rdf xml
AddType application/geo+json geojson
AddType application/rdf+xml rdf
AddType application/xml xml
# JavaScript
# Normalize to standard type.
# https://tools.ietf.org/html/rfc4329#section-7.2
# Servers should use text/javascript for JavaScript resources.
# https://html.spec.whatwg.org/multipage/scripting.html#scriptingLanguages
AddType application/javascript js
AddType text/javascript js mjs
# Manifest files
@@ -203,28 +183,25 @@ Options -MultiViews
AddType video/x-flv flv
# Serving `.ico` image files with a different media type
# prevents Internet Explorer from displaying then as images:
# prevents Internet Explorer from displaying them as images:
# https://github.com/h5bp/html5-boilerplate/commit/37b5fec090d00f38de64b591bcddcb205aadf8ee
AddType image/x-icon cur ico
# WebAssembly
AddType application/wasm wasm
# Web fonts
AddType application/font-woff woff
AddType application/font-woff2 woff2
AddType font/woff woff
AddType font/woff2 woff2
AddType application/vnd.ms-fontobject eot
# Browsers usually ignore the font media types and simply sniff
# the bytes to figure out the font type.
# https://mimesniff.spec.whatwg.org/#matching-a-font-type-pattern
#
# However, Blink and WebKit based browsers will show a warning
# in the console if the following font types are served with any
# other media types.
AddType application/x-font-ttf ttc ttf
AddType font/opentype otf
AddType font/ttf ttf
AddType font/collection ttc
AddType font/otf otf
# Other
@@ -234,6 +211,8 @@ Options -MultiViews
AddType application/x-chrome-extension crx
AddType application/x-opera-extension oex
AddType application/x-xpinstall xpi
AddType text/calendar ics
AddType text/markdown markdown md
AddType text/vcard vcard vcf
AddType text/vnd.rim.location.xloc xloc
AddType text/vtt vtt
@@ -260,25 +239,26 @@ AddDefaultCharset utf-8
# https://httpd.apache.org/docs/current/mod/mod_mime.html#addcharset
<IfModule mod_mime.c>
AddCharset utf-8 .atom \
AddCharset utf-8 .appcache \
.bbaw \
.css \
.geojson \
.htc \
.ics \
.js \
.json \
.jsonld \
.manifest \
.rdf \
.rss \
.map \
.markdown \
.md \
.mjs \
.topojson \
.vtt \
.webapp \
.vcard \
.vcf \
.webmanifest \
.xloc \
.xml
.xloc
</IfModule>
# ######################################################################
# # REWRITES #
# ######################################################################
@@ -347,60 +327,90 @@ AddDefaultCharset utf-8
# ----------------------------------------------------------------------
# Redirect from the `http://` to the `https://` version of the URL.
#
# 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.
#
# https://www.iana.org/assignments/well-known-uris/well-known-uris.xhtml
# https://tools.ietf.org/html/draft-ietf-acme-acme-12
# <IfModule mod_rewrite.c>
# RewriteEngine On
# RewriteCond %{HTTPS} !=on
# RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
# # (1)
# # RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/
# # RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[\w-]+$
# # RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
# RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# </IfModule>
# ----------------------------------------------------------------------
# | Suppressing / Forcing the `www.` at the beginning of URLs |
# | Suppressing the `www.` at the beginning of URLs |
# ----------------------------------------------------------------------
# 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.
#
# By default `Option 1` (no `www.`) is activated.
# http://no-www.org/faq.php?q=class_b
#
# If you would prefer to use `Option 2`, just comment out all the
# lines from `Option 1` and uncomment the ones from `Option 2`.
#
# (!) NEVER USE BOTH RULES AT THE SAME TIME!
# (!) NEVER USE BOTH WWW-RELATED RULES AT THE SAME TIME!
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Option 1: rewrite www.example.com → example.com
# (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.
#
# https://github.com/h5bp/server-configs-apache/issues/52
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !=on
# (1)
# RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ %{ENV:PROTO}://%1%{REQUEST_URI} [R=301,L]
</IfModule>
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# ----------------------------------------------------------------------
# | Forcing the `www.` at the beginning of URLs |
# ----------------------------------------------------------------------
# Option 2: rewrite example.com → www.example.com
# 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.
#
# (!) 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.
#
# https://github.com/h5bp/server-configs-apache/issues/52
# Be aware that the following might not be a good idea if you use "real"
# subdomains for certain parts of your website.
# <IfModule mod_rewrite.c>
# RewriteEngine On
# RewriteCond %{HTTPS} !=on
# # (1)
# # 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>
# ######################################################################
# # SECURITY #
# ######################################################################
@@ -435,22 +445,13 @@ AddDefaultCharset utf-8
# 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
# https://tools.ietf.org/html/rfc7034
# http://blogs.msdn.com/b/ieinternals/archive/2010/03/30/combating-clickjacking-with-x-frame-options.aspx
# https://blogs.msdn.microsoft.com/ieinternals/2010/03/30/combating-clickjacking-with-x-frame-options/
# https://www.owasp.org/index.php/Clickjacking
# <IfModule mod_headers.c>
# Header set X-Frame-Options "DENY"
# # `mod_headers` cannot match based on the content-type, however,
# # the `X-Frame-Options` response header should be send only for
# # HTML documents and not for the other resources.
# <FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
# Header unset X-Frame-Options
# </FilesMatch>
# Header set X-Frame-Options "DENY" "expr=%{CONTENT_TYPE} =~ m#text/html#i"
# </IfModule>
# ----------------------------------------------------------------------
@@ -463,29 +464,68 @@ AddDefaultCharset utf-8
# This can be done by setting a `Content Security Policy` which
# whitelists trusted sources of content for your website.
#
# The example header below allows ONLY scripts that are loaded from
# the current website's origin (no inline scripts, no CDN, etc).
# That almost certainly won't work as-is 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.
#
# To make things easier, you can use an online CSP header generator
# such as: http://cspisawesome.com/.
# The example policy below aims to:
#
# http://content-security-policy.com/
# http://www.html5rocks.com/en/tutorials/security/content-security-policy/
# http://www.w3.org/TR/CSP11/).
# (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.
#
# (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.
#
# (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'`.
#
# 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.
#
# (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.
#
# To make your CSP implementation easier, you can use an online CSP header
# generator such as:
# https://report-uri.com/home/generate/
#
# It is encouraged that you validate your CSP header using a CSP validator
# such as:
# https://csp-evaluator.withgoogle.com
#
# https://csp.withgoogle.com/docs/
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
# https://www.html5rocks.com/en/tutorials/security/content-security-policy/
# https://www.w3.org/TR/CSP/
# <IfModule mod_headers.c>
# Header set Content-Security-Policy "script-src 'self'; object-src 'self'"
# # `mod_headers` cannot match based on the content-type, however,
# # the `Content-Security-Policy` response header should be send
# # only for HTML documents and not for the other resources.
# <FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
# Header unset Content-Security-Policy
# </FilesMatch>
# # (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"
# </IfModule>
# ----------------------------------------------------------------------
@@ -535,7 +575,7 @@ AddDefaultCharset utf-8
# left by some text editors and can pose a security risk when anyone
# has access to them.
#
# http://feross.org/cmsploit/
# https://feross.org/cmsploit/
#
# (!) Update the `<FilesMatch>` regular expression from below to
# include any files that might end up on your production server and
@@ -543,21 +583,11 @@ AddDefaultCharset utf-8
# include: configuration files, files that contain metadata about the
# project (e.g.: project dependencies), build scripts, etc..
<FilesMatch "(^#.*#|\.(bak|conf|dist|fla|in[ci]|log|psd|sh|sql|sw[op])|~)$">
# Apache < 2.3
<IfModule !mod_authz_core.c>
Order allow,deny
Deny from all
Satisfy All
</IfModule>
# Apache ≥ 2.3
<IfModule mod_authz_core.c>
<IfModule mod_authz_core.c>
<FilesMatch "(^#.*#|\.(bak|conf|dist|fla|in[ci]|log|orig|psd|sh|sql|sw[op])|~)$">
Require all denied
</IfModule>
</FilesMatch>
</FilesMatch>
</IfModule>
# ----------------------------------------------------------------------
# | HTTP Strict Transport Security (HSTS) |
@@ -574,15 +604,39 @@ AddDefaultCharset utf-8
# 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.
#
# (!) Remove the `includeSubDomains` optional directive if the website's
# subdomains are not using HTTPS.
#
# http://www.html5rocks.com/en/tutorials/security/transport-layer-security/
# https://tools.ietf.org/html/draft-ietf-websec-strict-transport-sec-14#section-6.1
# http://blogs.msdn.com/b/ieinternals/archive/2014/08/18/hsts-strict-transport-security-attacks-mitigations-deployment-https.aspx
# (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://www.html5rocks.com/en/tutorials/security/transport-layer-security/
# https://blogs.msdn.microsoft.com/ieinternals/2014/08/18/strict-transport-security/
# <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=31536000; includeSubDomains; preload" "expr=%{HTTPS} == 'on'"
# </IfModule>
# ----------------------------------------------------------------------
@@ -596,9 +650,8 @@ AddDefaultCharset utf-8
# is serving user-uploaded content or content that could potentially be
# treated as executable by the browser.
#
# http://www.slideshare.net/hasegawayosuke/owasp-hasegawa
# http://blogs.msdn.com/b/ie/archive/2008/07/02/ie8-security-part-v-comprehensive-protection.aspx
# https://msdn.microsoft.com/en-us/library/ie/gg622941.aspx
# 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>
@@ -637,25 +690,65 @@ AddDefaultCharset utf-8
# you are taking all possible measures to prevent XSS attacks, the
# most obvious being: validating and sanitizing your website's inputs.
#
# http://blogs.msdn.com/b/ie/archive/2008/07/02/ie8-security-part-iv-the-xss-filter.aspx
# http://blogs.msdn.com/b/ieinternals/archive/2011/01/31/controlling-the-internet-explorer-xss-filter-with-the-x-xss-protection-http-header.aspx
# 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/
# https://blogs.msdn.microsoft.com/ieinternals/2011/01/31/controlling-the-xss-filter/
# https://www.owasp.org/index.php/Cross-site_Scripting_%28XSS%29
# <IfModule mod_headers.c>
# # (1) (2)
# Header set X-XSS-Protection "1; mode=block"
# # `mod_headers` cannot match based on the content-type, however,
# # the `X-XSS-Protection` response header should be send only for
# # HTML documents and not for the other resources.
# <FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
# Header unset X-XSS-Protection
# </FilesMatch>
# Header 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.
#
# This can be done by setting a `Referrer Policy` which
# whitelists trusted sources of content for your website.
#
# To check your referrer policy, you can use an online service
# such as: https://securityheaders.io/.
#
# 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"
# </IfModule>
# ----------------------------------------------------------------------
# | Disable TRACE HTTP Method |
# ----------------------------------------------------------------------
# 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
#
# 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!
#
# 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
# ----------------------------------------------------------------------
# | Server-side technology information |
# ----------------------------------------------------------------------
@@ -666,9 +759,9 @@ AddDefaultCharset utf-8
# (e.g.: ASP.NET, PHP), and its value contains information
# about them (e.g.: their name, version number)
#
# * doesn't provide any value as far as users are concern,
# and in some cases, the information provided by it can
# be used by attackers
# * 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
@@ -678,6 +771,7 @@ AddDefaultCharset utf-8
<IfModule mod_headers.c>
Header unset X-Powered-By
Header always unset X-Powered-By
</IfModule>
# ----------------------------------------------------------------------
@@ -703,8 +797,7 @@ ServerSignature Off
#
# https://httpd.apache.org/docs/current/mod/core.html#servertokens
#ServerTokens Prod
# ServerTokens Prod
# ######################################################################
# # WEB PERFORMANCE #
@@ -717,7 +810,9 @@ ServerSignature Off
<IfModule mod_deflate.c>
# Force compression for mangled `Accept-Encoding` request headers
# https://developer.yahoo.com/blogs/ydn/pushing-beyond-gzipping-25601.html
#
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding
# https://calendar.perfplanet.com/2010/pushing-beyond-gzipping/
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
@@ -730,11 +825,6 @@ ServerSignature Off
# Compress all output labeled with one of the following media types.
#
# (!) For Apache versions below version 2.3.7 you don't need to
# enable `mod_filter` and can remove the `<IfModule mod_filter.c>`
# and `</IfModule>` lines as `AddOutputFilterByType` is still in
# the core directives.
#
# https://httpd.apache.org/docs/current/mod/mod_filter.html#addoutputfilterbytype
<IfModule mod_filter.c>
@@ -746,8 +836,9 @@ ServerSignature Off
"application/rdf+xml" \
"application/rss+xml" \
"application/schema+json" \
"application/vnd.geo+json" \
"application/geo+json" \
"application/vnd.ms-fontobject" \
"application/wasm" \
"application/x-font-ttf" \
"application/x-javascript" \
"application/x-web-app-manifest+json" \
@@ -755,15 +846,17 @@ ServerSignature Off
"application/xml" \
"font/eot" \
"font/opentype" \
"font/otf" \
"image/bmp" \
"image/svg+xml" \
"image/vnd.microsoft.icon" \
"image/x-icon" \
"text/cache-manifest" \
"text/calendar" \
"text/css" \
"text/html" \
"text/javascript" \
"text/plain" \
"text/markdown" \
"text/vcard" \
"text/vnd.rim.location.xloc" \
"text/vtt" \
@@ -786,6 +879,7 @@ ServerSignature Off
# 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
<IfModule mod_mime.c>
@@ -794,6 +888,121 @@ ServerSignature Off
</IfModule>
# ----------------------------------------------------------------------
# | 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.
#
# (!) 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.
# https://www.chromestatus.com/feature/5420797577396224
#
# https://httpd.apache.org/docs/current/mod/mod_brotli.html#precompressed
# <IfModule mod_headers.c>
# RewriteCond %{HTTP:Accept-Encoding} br
# RewriteCond %{REQUEST_FILENAME}\.br -f
# RewriteRule \.(css|ics|js|json|html|svg)$ %{REQUEST_URI}.br [L]
# # Prevent mod_deflate double gzip
# RewriteRule \.br$ - [E=no-gzip:1]
# <FilesMatch "\.br$">
# <IfModule mod_mime.c>
# # Serve correct content types
# AddType text/css css.br
# AddType text/calendar ics.br
# AddType text/javascript js.br
# AddType application/json json.br
# AddType text/html html.br
# AddType image/svg+xml svg.br
# # Serve correct content charset
# AddCharset utf-8 .css.br \
# .ics.br \
# .js.br \
# .json.br
# </IfModule>
# # Force proxies to cache brotlied and non-brotlied files separately
# Header append Vary Accept-Encoding
# </FilesMatch>
# # Serve correct encoding type
# AddEncoding br .br
# </IfModule>
# ----------------------------------------------------------------------
# | 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.
#
# (!) 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
# <IfModule mod_headers.c>
# RewriteCond %{HTTP:Accept-Encoding} gzip
# RewriteCond %{REQUEST_FILENAME}\.gz -f
# RewriteRule \.(css|ics|js|json|html|svg)$ %{REQUEST_URI}.gz [L]
# # Prevent mod_deflate double gzip
# RewriteRule \.gz$ - [E=no-gzip:1]
# <FilesMatch "\.gz$">
# # Serve correct content types
# <IfModule mod_mime.c>
# # (1)
# RemoveType gz
# # Serve correct content types
# AddType text/css css.gz
# AddType text/calendar ics.gz
# AddType text/javascript js.gz
# AddType application/json json.gz
# AddType text/html html.gz
# AddType image/svg+xml svg.gz
# # Serve correct content charset
# AddCharset utf-8 .css.gz \
# .ics.gz \
# .js.gz \
# .json.gz
# </IfModule>
# # Force proxies to cache gzipped and non-gzipped files separately
# Header append Vary Accept-Encoding
# </FilesMatch>
# # Serve correct encoding type
# AddEncoding gzip .gz
# </IfModule>
# ----------------------------------------------------------------------
# | Content transformation |
# ----------------------------------------------------------------------
@@ -802,6 +1011,7 @@ ServerSignature Off
# used by mobile network providers) from modifying the website's
# content.
#
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
# https://tools.ietf.org/html/rfc2616#section-14.9.5
#
# (!) If you are using `mod_pagespeed`, please note that setting
@@ -822,6 +1032,7 @@ ServerSignature Off
# Remove `ETags` as resources are sent with far-future expires headers.
#
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag
# https://developer.yahoo.com/performance/rules.html#etags
# https://tools.ietf.org/html/rfc7232#section-2.3
@@ -833,15 +1044,17 @@ ServerSignature Off
FileETag None
# ----------------------------------------------------------------------
# | Expires headers |
# | Cache expiration |
# ----------------------------------------------------------------------
# Serve resources with far-future expires headers.
# Serve resources with 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.
#
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expires
# https://httpd.apache.org/docs/current/mod/mod_expires.html
<IfModule mod_expires.c>
@@ -863,8 +1076,9 @@ FileETag None
ExpiresByType application/json "access plus 0 seconds"
ExpiresByType application/ld+json "access plus 0 seconds"
ExpiresByType application/schema+json "access plus 0 seconds"
ExpiresByType application/vnd.geo+json "access plus 0 seconds"
ExpiresByType application/geo+json "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType text/calendar "access plus 0 seconds"
ExpiresByType text/xml "access plus 0 seconds"
@@ -892,6 +1106,11 @@ FileETag None
ExpiresByType text/cache-manifest "access plus 0 seconds"
# Markdown
ExpiresByType text/markdown "access plus 0 seconds"
# Media files
ExpiresByType audio/ogg "access plus 1 month"
@@ -906,17 +1125,27 @@ FileETag None
ExpiresByType video/webm "access plus 1 month"
# WebAssembly
ExpiresByType application/wasm "access plus 1 year"
# Web fonts
# Collection
ExpiresByType font/collection "access plus 1 month"
# Embedded OpenType (EOT)
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
ExpiresByType font/eot "access plus 1 month"
# OpenType
ExpiresByType font/opentype "access plus 1 month"
ExpiresByType font/otf "access plus 1 month"
# TrueType
ExpiresByType application/x-font-ttf "access plus 1 month"
ExpiresByType font/ttf "access plus 1 month"
# Web Open Font Format (WOFF) 1.0
ExpiresByType application/font-woff "access plus 1 month"
@@ -925,6 +1154,7 @@ FileETag None
# Web Open Font Format (WOFF) 2.0
ExpiresByType application/font-woff2 "access plus 1 month"
ExpiresByType font/woff2 "access plus 1 month"
# Other
@@ -951,6 +1181,7 @@ FileETag None
# specified files.
# <IfModule mod_include.c>
# <FilesMatch "\.combined\.js$">
# Options +Includes
# AddOutputFilterByType INCLUDES application/javascript \
@@ -958,11 +1189,13 @@ FileETag None
# text/javascript
# SetOutputFilter INCLUDES
# </FilesMatch>
# <FilesMatch "\.combined\.css$">
# Options +Includes
# AddOutputFilterByType INCLUDES text/css
# SetOutputFilter INCLUDES
# </FilesMatch>
# </IfModule>
# ----------------------------------------------------------------------
@@ -975,10 +1208,11 @@ FileETag None
#
# To understand why this is important and even a better solution than
# using something like `*.css?v231`, please see:
# http://www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/
# https://www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/
# <IfModule mod_rewrite.c>
# RewriteEngine On
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteRule ^(.+)\.(\d+)\.(bmp|css|cur|gif|ico|jpe?g|js|png|svgz?|webp|webmanifest)$ $1.$3 [L]
# RewriteRule ^(.+)\.(\w+)\.(bmp|css|cur|gif|ico|jpe?g|m?js|png|svgz?|webp|webmanifest)$ $1.$3 [L]
# </IfModule>

90
dist/404.html vendored
View File

@@ -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/ -->

View File

@@ -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>

290
dist/css/main.css vendored
View File

@@ -1,5 +1,6 @@
/*! HTML5 Boilerplate v6.0.1 | MIT License | https://html5boilerplate.com/ */
/*! HTML5 Boilerplate v7.3.0 | MIT License | https://html5boilerplate.com/ */
/* main.css 2.0.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,
@@ -11,9 +12,9 @@
========================================================================== */
html {
color: #222;
font-size: 1em;
line-height: 1.4;
color: #222;
font-size: 1em;
line-height: 1.4;
}
/*
@@ -27,13 +28,13 @@ html {
*/
::-moz-selection {
background: #b3d4fc;
text-shadow: none;
background: #b3d4fc;
text-shadow: none;
}
::selection {
background: #b3d4fc;
text-shadow: none;
background: #b3d4fc;
text-shadow: none;
}
/*
@@ -41,12 +42,12 @@ html {
*/
hr {
display: block;
height: 1px;
border: 0;
border-top: 1px solid #ccc;
margin: 1em 0;
padding: 0;
display: block;
height: 1px;
border: 0;
border-top: 1px solid #ccc;
margin: 1em 0;
padding: 0;
}
/*
@@ -61,7 +62,7 @@ iframe,
img,
svg,
video {
vertical-align: middle;
vertical-align: middle;
}
/*
@@ -69,9 +70,9 @@ video {
*/
fieldset {
border: 0;
margin: 0;
padding: 0;
border: 0;
margin: 0;
padding: 0;
}
/*
@@ -79,7 +80,7 @@ fieldset {
*/
textarea {
resize: vertical;
resize: vertical;
}
/* ==========================================================================
@@ -87,32 +88,16 @@ textarea {
========================================================================== */
.browserupgrade {
margin: 0.2em 0;
background: #ccc;
color: #000;
padding: 0.2em 0;
margin: 0.2em 0;
background: #ccc;
color: #000;
padding: 0.2em 0;
}
/* ==========================================================================
Author's custom styles
========================================================================== */
/* ==========================================================================
Helper classes
========================================================================== */
@@ -122,79 +107,78 @@ textarea {
*/
.hidden {
display: none !important;
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
*/
.visuallyhidden {
border: 0;
clip: rect(0 0 0 0);
-webkit-clip-path: inset(50%);
clip-path: inset(50%);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
white-space: nowrap; /* 1 */
.sr-only {
border: 0;
clip: rect(0, 0, 0, 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
white-space: nowrap;
width: 1px;
/* 1 */
}
/*
* Extends the .visuallyhidden 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
*/
.visuallyhidden.focusable:active,
.visuallyhidden.focusable:focus {
clip: auto;
-webkit-clip-path: none;
clip-path: none;
height: auto;
margin: 0;
overflow: visible;
position: static;
width: auto;
white-space: inherit;
.sr-only.focusable:active,
.sr-only.focusable:focus {
clip: auto;
height: auto;
margin: 0;
overflow: visible;
position: static;
white-space: inherit;
width: auto;
}
/*
* Hide visually and from screen readers, but maintain layout
*/
* Hide visually and from screen readers, but maintain layout
*/
.invisible {
visibility: hidden;
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 {
content: " "; /* 1 */
display: table; /* 2 */
content: " ";
/* 1 */
display: table;
/* 2 */
}
.clearfix:after {
clear: both;
clear: both;
}
/* ==========================================================================
@@ -204,88 +188,78 @@ textarea {
========================================================================== */
@media only screen and (min-width: 35em) {
/* Style adjustments for viewports that meet the condition */
/* Style adjustments for viewports that meet the condition */
}
@media print,
(-webkit-min-device-pixel-ratio: 1.25),
(min-resolution: 1.25dppx),
(min-resolution: 120dpi) {
/* Style adjustments for high resolution devices */
(-webkit-min-device-pixel-ratio: 1.25),
(min-resolution: 1.25dppx),
(min-resolution: 120dpi) {
/* Style adjustments for high resolution devices */
}
/* ==========================================================================
Print styles.
Inlined to avoid the additional HTTP request:
http://www.phpied.com/delay-loading-your-print-css/
https://www.phpied.com/delay-loading-your-print-css/
========================================================================== */
@media print {
*,
*:before,
*:after {
background: transparent !important;
color: #000 !important; /* Black prints faster:
http://www.sanbeiji.com/archives/953 */
box-shadow: none !important;
text-shadow: none !important;
}
a,
a:visited {
text-decoration: underline;
}
a[href]:after {
content: " (" attr(href) ")";
}
abbr[title]:after {
content: " (" attr(title) ")";
}
/*
*,
*:before,
*:after {
background: transparent !important;
color: #000 !important;
/* Black prints faster */
box-shadow: none !important;
text-shadow: none !important;
}
a,
a:visited {
text-decoration: underline;
}
a[href]:after {
content: " (" attr(href) ")";
}
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 {
content: "";
}
pre {
white-space: pre-wrap !important;
}
pre,
blockquote {
border: 1px solid #999;
page-break-inside: avoid;
}
/*
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:
* http://css-discuss.incutio.com/wiki/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;
}
thead {
display: table-header-group;
}
tr,
img {
page-break-inside: avoid;
}
p,
h2,
h3 {
orphans: 3;
widows: 3;
}
h2,
h3 {
page-break-after: avoid;
}
}

148
dist/css/normalize.css vendored
View File

@@ -1,17 +1,15 @@
/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
/* Document
========================================================================== */
/**
* 1. Correct the line height in all browsers.
* 2. Prevent adjustments of font size after orientation changes in
* IE on Windows Phone and in iOS.
* 2. Prevent adjustments of font size after orientation changes in iOS.
*/
html {
line-height: 1.15; /* 1 */
-ms-text-size-adjust: 100%; /* 2 */
-webkit-text-size-adjust: 100%; /* 2 */
}
@@ -19,7 +17,7 @@ html {
========================================================================== */
/**
* Remove the margin in all browsers (opinionated).
* Remove the margin in all browsers.
*/
body {
@@ -27,15 +25,10 @@ body {
}
/**
* Add the correct display in IE 9-.
* Render the `main` element consistently in IE.
*/
article,
aside,
footer,
header,
nav,
section {
main {
display: block;
}
@@ -52,25 +45,6 @@ h1 {
/* Grouping content
========================================================================== */
/**
* Add the correct display in IE 9-.
* 1. Add the correct display in IE.
*/
figcaption,
figure,
main { /* 1 */
display: block;
}
/**
* Add the correct margin in IE 8.
*/
figure {
margin: 1em 40px;
}
/**
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
@@ -96,17 +70,15 @@ pre {
========================================================================== */
/**
* 1. Remove the gray background on active links in IE 10.
* 2. Remove gaps in links underline in iOS 8+ and Safari 8+.
* Remove the gray background on active links in IE 10.
*/
a {
background-color: transparent; /* 1 */
-webkit-text-decoration-skip: objects; /* 2 */
background-color: transparent;
}
/**
* 1. Remove the bottom border in Chrome 57- and Firefox 39-.
* 1. Remove the bottom border in Chrome 57-
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
*/
@@ -116,15 +88,6 @@ abbr[title] {
text-decoration: underline dotted; /* 2 */
}
/**
* Prevent the duplicate application of `bolder` by the next rule in Safari 6.
*/
b,
strong {
font-weight: inherit;
}
/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/
@@ -146,23 +109,6 @@ samp {
font-size: 1em; /* 2 */
}
/**
* Add the correct font style in Android 4.3-.
*/
dfn {
font-style: italic;
}
/**
* Add the correct background and color in IE 9-.
*/
mark {
background-color: #ff0;
color: #000;
}
/**
* Add the correct font size in all browsers.
*/
@@ -196,44 +142,18 @@ sup {
========================================================================== */
/**
* Add the correct display in IE 9-.
*/
audio,
video {
display: inline-block;
}
/**
* Add the correct display in iOS 4-7.
*/
audio:not([controls]) {
display: none;
height: 0;
}
/**
* Remove the border on images inside links in IE 10-.
* Remove the border on images inside links in IE 10.
*/
img {
border-style: none;
}
/**
* Hide the overflow in IE.
*/
svg:not(:root) {
overflow: hidden;
}
/* Forms
========================================================================== */
/**
* 1. Change the font styles in all browsers (opinionated).
* 1. Change the font styles in all browsers.
* 2. Remove the margin in Firefox and Safari.
*/
@@ -242,7 +162,7 @@ input,
optgroup,
select,
textarea {
font-family: sans-serif; /* 1 */
font-family: inherit; /* 1 */
font-size: 100%; /* 1 */
line-height: 1.15; /* 1 */
margin: 0; /* 2 */
@@ -269,16 +189,14 @@ select { /* 1 */
}
/**
* 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
* controls in Android 4.
* 2. Correct the inability to style clickable types in iOS and Safari.
* Correct the inability to style clickable types in iOS and Safari.
*/
button,
html [type="button"], /* 1 */
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button; /* 2 */
-webkit-appearance: button;
}
/**
@@ -329,17 +247,15 @@ legend {
}
/**
* 1. Add the correct display in IE 9-.
* 2. Add the correct vertical alignment in Chrome, Firefox, and Opera.
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
*/
progress {
display: inline-block; /* 1 */
vertical-align: baseline; /* 2 */
vertical-align: baseline;
}
/**
* Remove the default vertical scrollbar in IE.
* Remove the default vertical scrollbar in IE 10+.
*/
textarea {
@@ -347,8 +263,8 @@ textarea {
}
/**
* 1. Add the correct box sizing in IE 10-.
* 2. Remove the padding in IE 10-.
* 1. Add the correct box sizing in IE 10.
* 2. Remove the padding in IE 10.
*/
[type="checkbox"],
@@ -377,10 +293,9 @@ textarea {
}
/**
* Remove the inner padding and cancel buttons in Chrome and Safari on macOS.
* Remove the inner padding in Chrome and Safari on macOS.
*/
[type="search"]::-webkit-search-cancel-button,
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
@@ -399,12 +314,10 @@ textarea {
========================================================================== */
/*
* Add the correct display in IE 9-.
* 1. Add the correct display in Edge, IE, and Firefox.
* Add the correct display in Edge, IE 10+, and Firefox.
*/
details, /* 1 */
menu {
details {
display: block;
}
@@ -416,30 +329,19 @@ summary {
display: list-item;
}
/* Scripting
/* Misc
========================================================================== */
/**
* Add the correct display in IE 9-.
*/
canvas {
display: inline-block;
}
/**
* Add the correct display in IE.
* Add the correct display in IE 10+.
*/
template {
display: none;
}
/* Hidden
========================================================================== */
/**
* Add the correct display in IE 10-.
* Add the correct display in IE 10.
*/
[hidden] {

3
dist/doc/TOC.md vendored
View File

@@ -31,5 +31,4 @@ aspects of your website/web app (e.g.: the performance, security, etc.).
* [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)
* [Ant Build Script](https://github.com/h5bp/ant-build-script) — Apache
Ant based build script.
* [Front-end Developer Interview Questions](https://github.com/h5bp/Front-end-Developer-Interview-Questions)

127
dist/doc/css.md vendored
View File

@@ -6,10 +6,7 @@ table of contents](TOC.md)
HTML5 Boilerplate's CSS includes:
* [Normalize.css](#normalizecss)
* [Useful defaults](#useful-defaults)
* [Common helpers](#common-helpers)
* [Placeholder media queries](#media-queries)
* [Print styles](#print-styles)
* [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/),
@@ -21,8 +18,7 @@ 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
with modern standards, we include Normalize.css — a modern, HTML5-ready
alternative to CSS resets.
As opposed to CSS resets, Normalize.css:
@@ -35,11 +31,10 @@ 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/).
## Useful defaults
## main.css
Several base styles are included that build upon `Normalize.css`. These
styles:
@@ -49,116 +44,6 @@ styles:
* tweak the default alignment of some elements (e.g.: `img`, `video`,
`fieldset`, `textarea`)
* style the prompt that is displayed to users using an outdated browser
* and more...
You are free and even encouraged to modify or add to these base styles as your
project requires.
## Common helpers
Along with the base styles, we also provide some commonly used helper classes.
#### `.hidden`
The `hidden` class can be added to any element that you want to hide visually
and from screen readers. It could be an element that will be populated and
displayed later, or an element you will hide with JavaScript.
#### `.visuallyhidden`
The `visuallyhidden` class can be added to any element that you want to hide
visually, while still have its content accessible to screen readers.
See also:
* [CSS in Action: Invisible Content Just for Screen Reader
Users](http://webaim.org/techniques/css/invisiblecontent/)
* [Hiding content for
accessibility](https://snook.ca/archives/html_and_css/hiding-content-for-accessibility)
* [HTML5 Boilerplate - Issue #194](https://github.com/h5bp/html5-boilerplate/issues/194).
__N.B.__ [The visuallyhidden class can be an accessibility issue for users using high contrast modes.](https://www.paciellogroup.com/blog/2012/08/notes-on-accessible-css-image-sprites/)
>Use JavaScript to detect when images are disabled and remove the CSS visually hidden display state of the text alternative.
Use JavaScript to detect when Windows high contrast mode is enabled and remove the CSS visually hidden display state of the text alternative.
#### `.invisible`
The `invisible` class can be added to any element that you want to hide
visually and from screen readers, but without affecting the layout.
As opposed to the `hidden` class that effectively removes the element from the
layout, the `invisible` class will simply make the element invisible while
keeping it in the flow and not affecting the positioning of the surrounding
content.
__N.B.__ Try to stay away from, and don't use the classes specified above for
[keyword stuffing](https://en.wikipedia.org/wiki/Keyword_stuffing) as you will
harm your site's ranking!
#### `.clearfix`
The `clearfix` class can be added to any element to ensure that it always fully
contains its floated children.
Over the years there have been many variants of the clearfix hack, but currently,
we use the [micro clearfix](http://nicolasgallagher.com/micro-clearfix-hack/).
## Media Queries
HTML5 Boilerplate makes it easy for you to get started with a
[_mobile first_](http://www.lukew.com/presos/preso.asp?26) and [_responsive web
design_](http://alistapart.com/article/responsive-web-design) approach to
development. But it's worth remembering that there are [no silver
bullets](https://cloudfour.com/thinks/css-media-query-for-mobile-is-fools-gold/).
We include placeholder media queries to help you build up your mobile styles for
wider viewports and high-resolution displays. It's recommended that you adapt
these media queries based on the content of your site rather than mirroring the
fixed dimensions of specific devices.
If you do not want to take the _mobile first_ approach, you can simply edit or
remove these placeholder media queries. One possibility would be to work from
wide viewports down, and use `max-width` media queries instead (e.g.:
`@media only screen and (max-width: 480px)`).
## Print styles
Lastly, we provide some useful print styles that will optimize the printing
process, as well as make the printed pages easier to read.
At printing time, these styles will:
* strip all background colors, change the font color to black, and remove the
`text-shadow` — done in order to [help save printer ink and speed up the
printing process](http://www.sanbeiji.com/archives/953)
* underline and expand links to include the URL — done in order to allow users
to know where to refer to<br>
(exceptions to this are: the links that are
[fragment identifiers](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-href),
or use the
[`javascript:` pseudo protocol](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/void#JavaScript_URIs))
* expand abbreviations to include the full description — done in order to allow
users to know what the abbreviations stands for
* provide instructions on how browsers should break the content into pages and
on [orphans/widows](https://en.wikipedia.org/wiki/Widows_and_orphans), namely,
we instruct
[supporting browsers](https://en.wikipedia.org/wiki/Comparison_of_layout_engines_%28Cascading_Style_Sheets%29#Grammar_and_rules)
that they should:
* ensure the table header (`<thead>`) is [printed on each page spanned by the
table](http://css-discuss.incutio.com/wiki/Printing_Tables)
* prevent block quotations, preformatted text, images and table rows from
being split onto two different pages
* ensure that headings never appear on a different page than the text they
are associated with
* ensure that
[orphans and widows](https://en.wikipedia.org/wiki/Widows_and_orphans) do
[not appear on printed pages](https://css-tricks.com/almanac/properties/o/orphans/)
The print styles are included along with the other `css` to [avoid the
additional HTTP request](http://www.phpied.com/delay-loading-your-print-css/).
Also, they should always be included last, so that the other styles can be
overwritten.
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.

150
dist/doc/extend.md vendored
View File

@@ -18,16 +18,14 @@ not everything fits with everyone's needs.
* [Social Networks](#social-networks)
* [URLs](#urls)
* [Web Apps](#web-apps)
* [security.txt](#security.txt)
## App Stores
### Smart App Banners in iOS 6+ Safari
Stop bothering everyone with gross modals advertising your entry in the
App Store. Include the following [meta tag](https://developer.apple.com/library/IOS/documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html#//apple_ref/doc/uid/TP40002051-CH6-SW2)
will unintrusively allow the user the option to download your iOS app,
or open it with some data about the user's current state on the website.
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.
```html
<meta name="apple-itunes-app" content="app-id=APP_ID,app-argument=SOME_TEXT">
@@ -108,10 +106,9 @@ Microsoft Ajax Content Delivery Network:
### Further reading about DNS prefetching
* https://developer.mozilla.org/en-US/docs/Controlling_DNS_prefetching
* 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/
* http://dayofjs.com/videos/22158462/web-browsers_alex-russel
## Google Universal Analytics
@@ -127,7 +124,7 @@ 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/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.
@@ -217,34 +214,12 @@ $(function(){
## Internet Explorer
### Prompt users to switch to "Desktop Mode" in IE10 Metro
### IE Pinned Sites
IE10 does not support plugins, such as Flash, in Metro mode. If
your site requires plugins, you can let users know that via the
`x-ua-compatible` meta element, which will prompt them to switch
to Desktop Mode.
```html
<meta http-equiv="x-ua-compatible" content="requiresActiveX=true">
```
Here's what it looks like alongside H5BP's default `x-ua-compatible`
values:
```html
<meta http-equiv="x-ua-compatible" content="ie=edge,requiresActiveX=true">
```
You can find more information in [Microsoft's IEBlog post about prompting for
plugin use in IE10 Metro
Mode](https://blogs.msdn.microsoft.com/ie/2012/01/31/web-sites-and-a-plug-in-free-web/).
### IE Pinned Sites (IE9+)
Enabling your application for pinning will allow IE9 users to add it to their
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 IE9
Pinned Sites](https://msdn.microsoft.com/en-us/library/gg131029.aspx).
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
@@ -277,7 +252,7 @@ track the number of pinned users, like so:
### Recolor IE's controls manually for a Pinned Site
IE9+ will automatically use the overall color of your Pinned Site's favicon to
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`).
@@ -322,13 +297,13 @@ blog](https://blogs.msdn.microsoft.com/ie/2012/06/08/high-quality-visuals-for-pi
### (Windows 8) Badges for Pinned Sites
IE10 will poll an XML document for badge information to display on your app's
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://msdn.microsoft.com/en-us/library/ie/br212849.aspx)
* [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">
@@ -398,18 +373,18 @@ plugin](https://www.google.com/search?ie=UTF-8&q=how+to+make+browser+search+plug
[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+](http://www.johanbrook.com/articles/native-style-momentum-scrolling-to-arrive-in-ios-5/)
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"
value="notranslate">`](https://support.google.com/translate/?hl=en#2641276).
content="notranslate">`](https://support.google.com/webmasters/answer/79812).
To disable translation for a particular section of the web page, add
[`class="notranslate"`](https://support.google.com/translate/?hl=en#2641276).
* If you want to disable the automatic detection and formatting of possible
phone numbers in Safari on iOS, use [`<meta name="format-detection"
content="telephone=no">`](https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html/#//apple_ref/doc/uid/TP40008193-SW5).
content="telephone=no">`](https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html).
* Avoid development/stage websites "leaking" into SERPs (search engine results
page) by [implementing X-Robots-tag
@@ -431,7 +406,7 @@ scratch](http://www.rssboard.org/rss-specification)?
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](http://www.atomenabled.org/developers/syndication/).
about](https://en.wikipedia.org/wiki/Atom_(Web_standard)).
```html
<link rel="alternate" type="application/atom+xml" title="Atom" href="/atom.xml">
@@ -447,7 +422,7 @@ attribute should contain the location of your pingback service.
```
* High-level explanation: https://codex.wordpress.org/Introduction_to_Blogging#Pingbacks
* Step-by-step example case: http://www.hixie.ch/specs/pingback/pingback-1.0#TOC5
* 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/
@@ -460,13 +435,13 @@ You can control the information that Facebook and others display when users
share your site. Below are just the most basic data points you might need. For
specific content types (including "website"), see [Facebook's built-in Open
Graph content
templates](https://developers.facebook.com/docs/opengraph/objects/builtin/).
templates](https://developers.facebook.com/docs/sharing/opengraph/using-objects).
Take full advantage of Facebook's support for complex data and activity by
following the [Open Graph
tutorial](https://developers.facebook.com/docs/opengraph/tutorial/).
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,
[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).
@@ -485,12 +460,10 @@ 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. Note
that, as of this writing, Twitter requires that app developers activate Cards
on a per-domain basis. You can read more about the various snippet formats
and application process in the [official Twitter Cards
documentation](https://dev.twitter.com/docs/cards), and you can validate
your markup with the [Card validator](https://cards-dev.twitter.com/validator)
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).
```html
@@ -503,16 +476,15 @@ your markup with the [Card validator](https://cards-dev.twitter.com/validator)
<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
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 or Yandex.
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/).
@@ -520,7 +492,7 @@ 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">
<html class="no-js" lang="" itemscope itemtype="https://schema.org/Article">
<head>
<link rel="author" href="">
@@ -543,16 +515,6 @@ the cleaner, more accurate `https://www.example.com/cart.html`.
<link rel="canonical" href="">
```
### Official shortlink
Signal to the world "This is the shortened URL to use this page!" Poorly
supported at this time. Learn more by reading the [article about shortlinks on
the Microformats wiki](http://microformats.org/wiki/rel-shortlink).
```html
<link rel="shortlink" href="h5bp.com">
```
### Separate mobile URLs
If you use separate URLs for desktop and mobile users, you should consider
@@ -573,8 +535,7 @@ This can be done by adding the following annotations in your HTML pages:
For more information please see:
* https://developers.google.com/webmasters/smartphone-sites/details#separateurls
* https://developers.google.com/webmasters/smartphone-sites/feature-phones
* https://developers.google.com/search/mobile-sites/mobile-seo/separate-urls
## Web Apps
@@ -605,39 +566,17 @@ on Apple's site.
### Apple Touch Icons
The Apple touch icons can be seen as the favicons of iOS devices.
Apple touch icons are used as icons when a user adds your webapp to the home
screen of aniOS devices.
The main sizes of the Apple touch icons are:
* `57×57px` iPhone with @1x display and iPod Touch
* `72×72px` iPad and iPad mini with @1x display running iOS ≤ 6
* `76×76px` iPad and iPad mini with @1x display running iOS ≥ 7
* `114×114px` iPhone with @2x display running iOS ≤ 6
* `120×120px` iPhone with @2x and @3x display running iOS ≥ 7
* `144×144px` iPad and iPad mini with @2x display running iOS ≤ 6
* `152×152px` iPad and iPad mini with @2x display running iOS 7
* `180×180px` iPad and iPad mini with @2x display running iOS 8
Displays meaning:
* @1x - non-Retina
* @2x - Retina
* @3x - Retina HD
More information about the displays of iOS devices can be found
[here](https://en.wikipedia.org/wiki/List_of_iOS_devices#Display).
In most cases, one `180×180px` touch icon named `icon.png`
and including:
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">
```
in the `<head>` of the page is enough. If you use art-direction and/or
want to have different content for each device, you can add more touch
icons as written above.
For a more comprehensive overview, please refer to Mathias' [article on Touch
Icons](https://mathiasbynens.be/notes/touch-icons).
@@ -646,19 +585,14 @@ 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 is
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 a retina iPhone:
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-retina.png">
<link rel="apple-touch-startup-image" media="(max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)" href="img/startup.png">
```
However, it is possible to detect which start-up image to use with JavaScript.
The Mobile Boilerplate provides a useful function for this. Please see
[helpers.js](https://github.com/h5bp/mobile-boilerplate/blob/v4.1.0/js/helper.js#L336-L383)
for the implementation.
### Chrome Mobile web apps
@@ -691,3 +625,15 @@ 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).
## 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.
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.

9
dist/doc/faq.md vendored
View File

@@ -5,8 +5,6 @@ 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)
* [How can I integrate Bootstrap with HTML5
Boilerplate?](#how-can-i-integrate-bootstrap-with-html5-boilerplate)
* [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
@@ -30,14 +28,9 @@ 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.)
### How can I integrate [Bootstrap](https://getbootstrap.com/) with HTML5 Boilerplate?
Here's Nicolas Gallagher writing about how [HTML5 Boilerplate and Bootstrap complement each
other](https://www.quora.com/Is-Bootstrap-a-complement-or-an-alternative-to-HTML5-Boilerplate-or-viceversa/answer/Nicolas-Gallagher).
### Do I need to upgrade my site each time a new version of HTML5 Boilerplate is released?
No, same as you don't normally replace the foundation of a house once it
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.

125
dist/doc/html.md vendored
View File

@@ -7,7 +7,7 @@ By default, HTML5 Boilerplate provides two `html` pages:
* [`index.html`](#indexhtml) - a default HTML skeleton that should form the
basis of all pages on your website
* [`404.html`](#404html) - a placeholder 404 error page
* `404.html` - a placeholder 404 error page
## `index.html`
@@ -23,7 +23,7 @@ FOUC](https://www.paulirish.com/2009/avoiding-the-fouc-v3/).
## Language Attribute
Please consider specifying the language of your content by adding a [value](http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry) to the `lang`
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
@@ -32,71 +32,12 @@ attribute in the `<html>` as in this example:
### The order of the `<title>` and `<meta>` tags
The order in which the `<title>` and the `<meta>` tags are specified is
important because:
1) 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)
* 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/p/doctype-mirror/wiki/ArticleUtf7) in
Internet Explorer
2) the meta tag for compatibility mode
(`<meta http-equiv="x-ua-compatible" content="ie=edge">`):
* [needs to be included before all other tags except for the `<title>` and
the other `<meta>`
tags](https://msdn.microsoft.com/en-us/library/cc288325.aspx)
### `x-ua-compatible`
Internet Explorer 8/9/10 support [document compatibility
modes](https://msdn.microsoft.com/en-us/library/cc288325.aspx) that affect the
way webpages are interpreted and displayed. Because of this, even if your site's
visitor is using, let's say, Internet Explorer 9, it's possible that IE will not
use the latest rendering engine, and instead, decide to render your page using
the Internet Explorer 5.5 rendering engine.
Specifying the `x-ua-compatible` meta tag:
```html
<meta http-equiv="x-ua-compatible" content="ie=edge">
```
or sending the page with the following HTTP response header
```
X-UA-Compatible: IE=edge
```
will force Internet Explorer 8/9/10 to render the webpage in the highest
available mode in [the various cases when it may
not](https://hsivonen.fi/doctype/#ie8), and therefore, ensure that anyone
browsing your site is treated to the best possible user experience that
browser can offer.
If possible, we recommend that you remove the `meta` tag and send only the
HTTP response header as the `meta` tag will not always work if your site is
served on a non-standard port, as Internet Explorer's preference option
`Display intranet sites in Compatibility View` is checked by default.
If you are using Apache as your webserver, including the
[`.htaccess`](https://github.com/h5bp/server-configs-apache) file takes care of
the HTTP header. If you are using a different server, check out our [other
server config](https://github.com/h5bp/server-configs).
Starting with Internet Explorer 11, [document modes are
deprecated](https://msdn.microsoft.com/library/bg182625.aspx#docmode).
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](https://blogs.msdn.microsoft.com/ie/2014/04/02/stay-up-to-date-with-enterprise-mode-for-internet-explorer-11/) throughout your company.
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)
in Internet Explorer
## Meta Description
@@ -108,20 +49,27 @@ shown in the search results.
<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)
documentation has useful tips on creating an effective description.
## 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
Apple developer docs](https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariWebContent/UsingtheViewport/UsingtheViewport.html).
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.
## 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
@@ -132,7 +80,7 @@ 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">
<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)
@@ -156,8 +104,8 @@ 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 8 and lower. If you intended to support IE 8, then you
should remove the snippet of code.
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
@@ -176,14 +124,14 @@ Starting with version 3 Modernizr can be customized using the [modernizr-config.
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 some polyfill CDN service, like [cdn.polyfill.io](https://cdn.polyfill.io/),
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:
```html
<script src="js/vendor/modernizr-3.5.0.min.js"></script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-3.2.1.min.js"><\/script>')</script>
<script src="js/vendor/modernizr-3.8.0.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/plugins.js"></script>
<script src="js/main.js"></script>
</body>
@@ -193,7 +141,7 @@ 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.
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
@@ -217,7 +165,7 @@ 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 Chinese users.
being able to serve jQuery to users in China.
While the jQuery CDN is a strong default solution your site or application may
require a different configuration. Testing your site with services like
@@ -229,22 +177,29 @@ site or application.
### Google Universal Analytics Tracking Code
Finally, an optimized version of the Google Universal Analytics tracking code is
included. Google recommends that this script be placed at the top of the page.
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)
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, youll
be able to count users who dont fully load the page, and youll incur the max
number of simultaneous connections of the browser.
Further information:
* [Optimizing the Google Universal Analytics
Snippet](https://mathiasbynens.be/notes/async-analytics-snippet#universal-analytics)
* [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/)
**N.B.** The Google Universal Analytics snippet is included by default mainly
**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!
and use whatever suits your needs best.

4
dist/doc/js.md vendored
View File

@@ -9,7 +9,7 @@ Information about the default JavaScript included in the project.
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.
entirely. That's cool.
## plugins.js
@@ -32,5 +32,5 @@ 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
build with the online builder](https://modernizr.com/download/) or [command
line tool](https://modernizr.com/docs#command-line-config).

29
dist/doc/misc.md vendored
View File

@@ -7,6 +7,7 @@ table of contents](TOC.md)
* [.editorconfig](#editorconfig)
* [Server Configuration](#server-configuration)
* [robots.txt](#robotstxt)
* [humans.txt](#humanstxt)
* [browserconfig.xml](#browserconfigxml)
--
@@ -41,21 +42,21 @@ your team define and maintain consistent coding styles between different
editors and IDEs.
By default, `.editorconfig` includes some basic
[properties](http://editorconfig.org/#supported-properties) that reflect the
[properties](https://editorconfig.org/#supported-properties) that reflect the
coding styles from the files provided by default, but you can easily change
them to better suit your needs.
In order for your editor/IDE to apply the
[properties](http://editorconfig.org/#supported-properties) from the
[properties](https://editorconfig.org/#supported-properties) from the
`.editorconfig` file, you may need to [install a
plugin]( http://editorconfig.org/#download).
plugin]( https://editorconfig.org/#download).
__N.B.__ If you aren't using the server configurations provided by HTML5
Boilerplate, we highly encourage you to configure your server to block
access to `.editorconfig` files, as they can disclose sensitive information!
For more details, please refer to the [EditorConfig
project](http://editorconfig.org/).
project](https://editorconfig.org/).
## Server Configuration
@@ -83,7 +84,7 @@ 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.
https://github.com/h5bp/server-configs-apache#enable-apache-httpd-modules.
In the repo the `.htaccess` is used for:
@@ -136,9 +137,23 @@ 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/)
* [robotstxt.org](https://www.robotstxt.org/)
* [How Google handles the `robots.txt` file](https://developers.google.com/webmasters/control-crawl-index/docs/robots_txt)
## humans.txt
The `humans.txt` file is used to provide information about people involved with
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
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/
## browserconfig.xml
@@ -155,4 +170,4 @@ 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://msdn.microsoft.com/library/dn320426.aspx).
see [MSDN](https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/dn320426(v=vs.85)).

4
dist/doc/usage.md vendored
View File

@@ -18,7 +18,7 @@ serve as the foundation for whatever you're interested in building.
Even the basic use-case of a simple static site can be enhanced by manipulating
the code through an automated build process. Moving up in complexity HTML5
Boilerplate can be be integrated with whatever front-end framework, CMS or
Boilerplate can be integrated with whatever front-end framework, CMS or
e-commerce platform you're working with. Mix-and-match to your heart's content.
Use what you need (toss it in a blender if you need to) and discard the rest.
HTML5 Boilerplate is a starting point, not a destination.
@@ -92,7 +92,7 @@ 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
[MSDN](https://msdn.microsoft.com/library/dn455106.aspx).
[Microsoft's Docs](https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/dn320426(v=vs.85)).
### .editorconfig

64
dist/index.html vendored
View File

@@ -1,37 +1,41 @@
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="manifest" href="site.webmanifest">
<link rel="apple-touch-icon" href="icon.png">
<!-- Place favicon.ico in the root directory -->
<head>
<meta charset="utf-8">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<!--[if lte IE 9]>
<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]-->
<link rel="manifest" href="site.webmanifest">
<link rel="apple-touch-icon" href="icon.png">
<!-- Place favicon.ico in the root directory -->
<!-- Add your site or application content here -->
<p>Hello world! This is HTML5 Boilerplate.</p>
<script src="js/vendor/modernizr-3.5.0.min.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-3.2.1.min.js"><\/script>')</script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css">
<meta name="theme-color" content="#fafafa">
</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.8.0.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/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')
</script>
<script src="https://www.google-analytics.com/analytics.js" async></script>
</body>
<!-- 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('send','pageview')
</script>
<script src="https://www.google-analytics.com/analytics.js" async defer></script>
</body>
</html>

32
dist/js/plugins.js vendored
View File

@@ -1,24 +1,24 @@
// Avoid `console` errors in browsers that lack a console.
(function() {
var method;
var noop = function () {};
var methods = [
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
'timeline', 'timelineEnd', 'timeStamp', 'trace', 'warn'
];
var length = methods.length;
var console = (window.console = window.console || {});
var method;
var noop = function () {};
var methods = [
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
'timeline', 'timelineEnd', 'timeStamp', 'trace', 'warn'
];
var length = methods.length;
var console = (window.console = window.console || {});
while (length--) {
method = methods[length];
while (length--) {
method = methods[length];
// Only stub undefined methods.
if (!console[method]) {
console[method] = noop;
}
// Only stub undefined methods.
if (!console[method]) {
console[method] = noop;
}
}
}());
// Place any jQuery/helper plugins in here.

File diff suppressed because one or more lines are too long

2
dist/js/vendor/jquery-3.4.1.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

3
dist/js/vendor/modernizr-3.8.0.min.js vendored Normal file

File diff suppressed because one or more lines are too long

16
dist/site.webmanifest vendored
View File

@@ -1,8 +1,12 @@
{
"icons": [{
"src": "icon.png",
"sizes": "192x192",
"type": "image/png"
}],
"start_url": "/"
"short_name": "",
"name": "",
"icons": [{
"src": "icon.png",
"type": "image/png",
"sizes": "192x192"
}],
"start_url": "/?utm_source=homescreen",
"background_color": "#fafafa",
"theme_color": "#fafafa"
}

View File

@@ -7,75 +7,150 @@ 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 sri from 'node-sri';
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', () => {
fs.mkdirSync(path.resolve(dirs.archive), '0755');
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,
'dot': true // include hidden files
});
const output = fs.createWriteStream(archiveName);
const archiveName = path.resolve(dirs.archive, `${pkg.name}_v${pkg.version}.zip`);
const zip = archiver('zip');
const files = glob.sync('**/*.*', {
'cwd': dirs.dist,
'dot': true // include hidden files
zip.on('error', (error) => {
done();
throw error;
});
output.on('close', done);
files.forEach((file) => {
const filePath = path.resolve(dirs.dist, file);
// `zip.bulk` does not maintain the file
// permissions, so we need to add files individually
zip.append(fs.createReadStream(filePath), {
'name': file,
'mode': fs.statSync(filePath).mode
});
const output = fs.createWriteStream(archiveName);
zip.on('error', (error) => {
done();
throw error;
});
output.on('close', done);
files.forEach( (file) => {
const filePath = path.resolve(dirs.dist, file);
// `zip.bulk` does not maintain the file
// permissions, so we need to add files individually
zip.append(fs.createReadStream(filePath), {
'name': file,
'mode': fs.statSync(filePath).mode
});
});
zip.pipe(output);
zip.finalize();
});
zip.pipe(output);
zip.finalize();
done();
});
gulp.task('clean', (done) => {
del([
dirs.archive,
dirs.dist
]).then( () => {
done();
});
del([
dirs.archive,
dirs.dist
]).then(() => {
done();
});
});
gulp.task('copy', [
gulp.task('copy:.htaccess', () =>
gulp.src('node_modules/apache-server-configs/dist/.htaccess')
.pipe(plugins().replace(/# ErrorDocument/g, 'ErrorDocument'))
.pipe(gulp.dest(dirs.dist))
);
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;
return gulp.src(`${dirs.src}/index.html`)
.pipe(plugins().replace(/{{JQUERY_VERSION}}/g, version))
.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))
);
gulp.task('copy:main.css', () => {
const banner = `/*! HTML5 Boilerplate v${pkg.version} | ${pkg.license} License | ${pkg.homepage} */\n\n`;
return gulp.src('node_modules/main.css/dist/main.css')
.pipe(plugins().header(banner))
.pipe(plugins().autoprefixer({
cascade: false
}))
.pipe(gulp.dest(`${dirs.dist}/css`));
});
gulp.task('copy:misc', () =>
gulp.src([
// Copy all files
`${dirs.src}/**/*`,
// Exclude the following files
// (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))
);
gulp.task('copy:normalize', () =>
gulp.src('node_modules/normalize.css/normalize.css')
.pipe(gulp.dest(`${dirs.dist}/css`))
);
gulp.task('modernizr', (done) => {
modernizr.build(modernizrConfig, (code) => {
fs.writeFile(`${dirs.dist}/js/vendor/modernizr-${pkg.devDependencies.modernizr}.min.js`, code, done);
});
});
gulp.task('lint:js', () =>
gulp.src([
`${dirs.src}/js/*.js`,
`${dirs.test}/*.js`
]).pipe(plugins().eslint())
.pipe(plugins().eslint.failOnError())
);
// ---------------------------------------------------------------------
// | Main tasks |
// ---------------------------------------------------------------------
gulp.task(
'copy',
gulp.series(
'copy:.htaccess',
'copy:index.html',
'copy:jquery',
@@ -83,114 +158,25 @@ gulp.task('copy', [
'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'))
.pipe(gulp.dest(dirs.dist))
)
);
gulp.task('copy:index.html', (done) =>
sri.hash('node_modules/jquery/dist/jquery.min.js', (err, hash) => {
if (err) throw err
let version = pkg.devDependencies.jquery;
let modernizrVersion = pkg.devDependencies.modernizr;
gulp.src(`${dirs.src}/index.html`)
.pipe(plugins().replace(/{{JQUERY_VERSION}}/g, version))
.pipe(plugins().replace(/{{MODERNIZR_VERSION}}/g, modernizrVersion))
.pipe(plugins().replace(/{{JQUERY_SRI_HASH}}/g, hash))
.pipe(gulp.dest(dirs.dist));
done();
})
gulp.task(
'build',
gulp.series(
gulp.parallel('clean', 'lint:js'),
'copy',
'modernizr'
)
);
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(
'archive',
gulp.series(
'build',
'archive:create_archive_dir',
'archive:zip'
)
);
gulp.task('copy:license', () =>
gulp.src('LICENSE.txt')
.pipe(gulp.dest(dirs.dist))
);
gulp.task('copy:main.css', () => {
const banner = `/*! HTML5 Boilerplate v${pkg.version} | ${pkg.license} License | ${pkg.homepage} */\n\n`;
gulp.src(`${dirs.src}/css/main.css`)
.pipe(plugins().header(banner))
.pipe(plugins().autoprefixer({
browsers: ['last 2 versions', 'ie >= 9', '> 1%'],
cascade: false
}))
.pipe(gulp.dest(`${dirs.dist}/css`));
});
gulp.task('copy:misc', () =>
gulp.src([
// Copy all files
`${dirs.src}/**/*`,
// Exclude the following files
// (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))
);
gulp.task('copy:normalize', () =>
gulp.src('node_modules/normalize.css/normalize.css')
.pipe(gulp.dest(`${dirs.dist}/css`))
);
gulp.task( 'modernizr', (done) =>{
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().jshint())
.pipe(plugins().jshint.reporter('jshint-stylish'))
.pipe(plugins().jshint.reporter('fail'))
);
// ---------------------------------------------------------------------
// | Main tasks |
// ---------------------------------------------------------------------
gulp.task('archive', (done) => {
runSequence(
'build',
'archive:create_archive_dir',
'archive:zip',
done)
});
gulp.task('build', (done) => {
runSequence(
['clean', 'lint:js'],
'copy', 'modernizr',
done)
});
gulp.task('default', ['build']);
gulp.task('default', gulp.series('build'));

9671
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,41 +1,65 @@
{
"name": "html5-boilerplate",
"version": "7.3.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": {
"@alrra/travis-scripts": "^3.0.1",
"apache-server-configs": "2.14.0",
"archiver": "^2.0.0",
"babel-core": "^6.25.0",
"babel-preset-es2015": "^6.18.0",
"babel-register": "^6.8.0",
"del": "^3.0.0",
"glob": "^7.1.2",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.1",
"gulp-header": "^1.8.8",
"gulp-jscs": "^4.0.0",
"gulp-jshint": "^2.0.4",
"gulp-load-plugins": "^1.5.0",
"gulp-rename": "^1.2.2",
"gulp-replace": "^0.6.1",
"jquery": "3.2.1",
"jshint": "^2.9.5",
"jshint-stylish": "^2.2.1",
"mocha": "^3.2.0",
"modernizr": "3.5.0",
"node-sri": "^1.1.1",
"normalize.css": "7.0.0",
"run-sequence": "^2.0.0",
"strip-json-comments": "^2.0.1",
"travis-after-all": "^1.4.5"
"@babel/core": "^7.7.2",
"@babel/preset-env": "^7.7.1",
"@babel/register": "^7.7.0",
"apache-server-configs": "^3.2.1",
"archiver": "^3.1.1",
"del": "^5.1.0",
"eslint": "^6.6.0",
"eslint-config-recommended": "^4.0.0",
"eslint-plugin-mocha": "^6.2.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.1",
"gulp-rename": "^1.4.0",
"gulp-replace": "^1.0.0",
"jquery": "3.4.1",
"main.css": "2.0.0",
"mocha": "^6.2.2",
"modernizr": "3.8.0",
"normalize.css": "8.0.1",
"ssri": "^7.1.0",
"strip-json-comments": "^3.0.1"
},
"engines": {
"node": ">=4",
"node": ">=10",
"npm": ">=3"
},
"babel": {
"presets": [
"es2015"
"@babel/preset-env"
]
},
"browserslist": [
"last 1 version",
"> 1%",
"IE 10"
],
"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 --compilers js:babel-register --reporter spec --timeout 5000"
},
"version": "6.0.1",
"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": {}
}

View File

@@ -4,10 +4,7 @@ root = true
[*]
charset = utf-8
indent_size = 4
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false

38
src/.gitattributes vendored
View File

@@ -46,8 +46,8 @@
*.xhtml text
## DOCKER
*.dockerignore text
Dockerfile text
*.dockerignore text
Dockerfile text
## DOCUMENTATION
*.markdown text
@@ -91,31 +91,33 @@ TODO text
*.twig text
## LINTERS
.babelrc text
.csslintrc text
.eslintrc text
.htmlhintrc text
.jscsrc text
.jshintrc text
.jshintignore text
.prettierrc text
.stylelintrc text
## CONFIGS
*.bowerrc text
*.cnf text
*.conf text
*.config text
.browserslistrc text
.editorconfig text
.gitattributes text
.gitconfig text
.gitignore text
.htaccess text
*.npmignore text
*.yaml text
*.yml text
browserslist text
Makefile text
makefile text
*.bowerrc text
*.cnf text
*.conf text
*.config text
.browserslistrc text
.editorconfig text
.gitattributes text
.gitconfig text
.gitignore text
.htaccess text
*.npmignore text
*.yaml text
*.yml text
browserslist text
Makefile text
makefile text
## HEROKU
Procfile text

View File

@@ -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/ -->

View File

@@ -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>

View File

@@ -1,281 +0,0 @@
/*
* What follows is the result of much research on cross-browser styling.
* Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
* Kroc Camen, and the H5BP dev community and team.
*/
/* ==========================================================================
Base styles: opinionated defaults
========================================================================== */
html {
color: #222;
font-size: 1em;
line-height: 1.4;
}
/*
* Remove text-shadow in selection highlight:
* https://twitter.com/miketaylr/status/12228805301
*
* Vendor-prefixed and regular ::selection selectors cannot be combined:
* https://stackoverflow.com/a/16982510/7133471
*
* Customize the background color to match your design.
*/
::selection {
background: #b3d4fc;
text-shadow: none;
}
/*
* A better looking default horizontal rule
*/
hr {
display: block;
height: 1px;
border: 0;
border-top: 1px solid #ccc;
margin: 1em 0;
padding: 0;
}
/*
* Remove the gap between audio, canvas, iframes,
* images, videos and the bottom of their containers:
* https://github.com/h5bp/html5-boilerplate/issues/440
*/
audio,
canvas,
iframe,
img,
svg,
video {
vertical-align: middle;
}
/*
* Remove default fieldset styles.
*/
fieldset {
border: 0;
margin: 0;
padding: 0;
}
/*
* Allow only vertical resizing of textareas.
*/
textarea {
resize: vertical;
}
/* ==========================================================================
Browser Upgrade Prompt
========================================================================== */
.browserupgrade {
margin: 0.2em 0;
background: #ccc;
color: #000;
padding: 0.2em 0;
}
/* ==========================================================================
Author's custom styles
========================================================================== */
/* ==========================================================================
Helper classes
========================================================================== */
/*
* Hide visually and from screen readers
*/
.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
*/
.visuallyhidden {
border: 0;
clip: rect(0 0 0 0);
clip-path: inset(50%);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
white-space: nowrap; /* 1 */
}
/*
* Extends the .visuallyhidden class to allow the element
* to be focusable when navigated to via the keyboard:
* https://www.drupal.org/node/897638
*/
.visuallyhidden.focusable:active,
.visuallyhidden.focusable:focus {
clip: auto;
clip-path: none;
height: auto;
margin: 0;
overflow: visible;
position: static;
width: auto;
white-space: inherit;
}
/*
* 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:before,
.clearfix:after {
content: " "; /* 1 */
display: table; /* 2 */
}
.clearfix:after {
clear: both;
}
/* ==========================================================================
EXAMPLE Media Queries for Responsive Design.
These examples override the primary ('mobile first') styles.
Modify as content requires.
========================================================================== */
@media only screen and (min-width: 35em) {
/* Style adjustments for viewports that meet the condition */
}
@media print,
(min-resolution: 1.25dppx),
(min-resolution: 120dpi) {
/* Style adjustments for high resolution devices */
}
/* ==========================================================================
Print styles.
Inlined to avoid the additional HTTP request:
http://www.phpied.com/delay-loading-your-print-css/
========================================================================== */
@media print {
*,
*:before,
*:after {
background: transparent !important;
color: #000 !important; /* Black prints faster:
http://www.sanbeiji.com/archives/953 */
box-shadow: none !important;
text-shadow: none !important;
}
a,
a:visited {
text-decoration: underline;
}
a[href]:after {
content: " (" attr(href) ")";
}
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 {
content: "";
}
pre {
white-space: pre-wrap !important;
}
pre,
blockquote {
border: 1px solid #999;
page-break-inside: avoid;
}
/*
* Printing Tables:
* 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;
}
}

View File

@@ -31,5 +31,4 @@ aspects of your website/web app (e.g.: the performance, security, etc.).
* [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)
* [Ant Build Script](https://github.com/h5bp/ant-build-script) — Apache
Ant based build script.
* [Front-end Developer Interview Questions](https://github.com/h5bp/Front-end-Developer-Interview-Questions)

View File

@@ -6,10 +6,7 @@ table of contents](TOC.md)
HTML5 Boilerplate's CSS includes:
* [Normalize.css](#normalizecss)
* [Useful defaults](#useful-defaults)
* [Common helpers](#common-helpers)
* [Placeholder media queries](#media-queries)
* [Print styles](#print-styles)
* [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/),
@@ -21,8 +18,7 @@ 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
with modern standards, we include Normalize.css — a modern, HTML5-ready
alternative to CSS resets.
As opposed to CSS resets, Normalize.css:
@@ -35,11 +31,10 @@ 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/).
## Useful defaults
## main.css
Several base styles are included that build upon `Normalize.css`. These
styles:
@@ -49,116 +44,6 @@ styles:
* tweak the default alignment of some elements (e.g.: `img`, `video`,
`fieldset`, `textarea`)
* style the prompt that is displayed to users using an outdated browser
* and more...
You are free and even encouraged to modify or add to these base styles as your
project requires.
## Common helpers
Along with the base styles, we also provide some commonly used helper classes.
#### `.hidden`
The `hidden` class can be added to any element that you want to hide visually
and from screen readers. It could be an element that will be populated and
displayed later, or an element you will hide with JavaScript.
#### `.visuallyhidden`
The `visuallyhidden` class can be added to any element that you want to hide
visually, while still have its content accessible to screen readers.
See also:
* [CSS in Action: Invisible Content Just for Screen Reader
Users](http://webaim.org/techniques/css/invisiblecontent/)
* [Hiding content for
accessibility](https://snook.ca/archives/html_and_css/hiding-content-for-accessibility)
* [HTML5 Boilerplate - Issue #194](https://github.com/h5bp/html5-boilerplate/issues/194).
__N.B.__ [The visuallyhidden class can be an accessibility issue for users using high contrast modes.](https://www.paciellogroup.com/blog/2012/08/notes-on-accessible-css-image-sprites/)
>Use JavaScript to detect when images are disabled and remove the CSS visually hidden display state of the text alternative.
Use JavaScript to detect when Windows high contrast mode is enabled and remove the CSS visually hidden display state of the text alternative.
#### `.invisible`
The `invisible` class can be added to any element that you want to hide
visually and from screen readers, but without affecting the layout.
As opposed to the `hidden` class that effectively removes the element from the
layout, the `invisible` class will simply make the element invisible while
keeping it in the flow and not affecting the positioning of the surrounding
content.
__N.B.__ Try to stay away from, and don't use the classes specified above for
[keyword stuffing](https://en.wikipedia.org/wiki/Keyword_stuffing) as you will
harm your site's ranking!
#### `.clearfix`
The `clearfix` class can be added to any element to ensure that it always fully
contains its floated children.
Over the years there have been many variants of the clearfix hack, but currently,
we use the [micro clearfix](http://nicolasgallagher.com/micro-clearfix-hack/).
## Media Queries
HTML5 Boilerplate makes it easy for you to get started with a
[_mobile first_](http://www.lukew.com/presos/preso.asp?26) and [_responsive web
design_](http://alistapart.com/article/responsive-web-design) approach to
development. But it's worth remembering that there are [no silver
bullets](https://cloudfour.com/thinks/css-media-query-for-mobile-is-fools-gold/).
We include placeholder media queries to help you build up your mobile styles for
wider viewports and high-resolution displays. It's recommended that you adapt
these media queries based on the content of your site rather than mirroring the
fixed dimensions of specific devices.
If you do not want to take the _mobile first_ approach, you can simply edit or
remove these placeholder media queries. One possibility would be to work from
wide viewports down, and use `max-width` media queries instead (e.g.:
`@media only screen and (max-width: 480px)`).
## Print styles
Lastly, we provide some useful print styles that will optimize the printing
process, as well as make the printed pages easier to read.
At printing time, these styles will:
* strip all background colors, change the font color to black, and remove the
`text-shadow` — done in order to [help save printer ink and speed up the
printing process](http://www.sanbeiji.com/archives/953)
* underline and expand links to include the URL — done in order to allow users
to know where to refer to<br>
(exceptions to this are: the links that are
[fragment identifiers](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-href),
or use the
[`javascript:` pseudo protocol](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/void#JavaScript_URIs))
* expand abbreviations to include the full description — done in order to allow
users to know what the abbreviations stands for
* provide instructions on how browsers should break the content into pages and
on [orphans/widows](https://en.wikipedia.org/wiki/Widows_and_orphans), namely,
we instruct
[supporting browsers](https://en.wikipedia.org/wiki/Comparison_of_layout_engines_%28Cascading_Style_Sheets%29#Grammar_and_rules)
that they should:
* ensure the table header (`<thead>`) is [printed on each page spanned by the
table](http://css-discuss.incutio.com/wiki/Printing_Tables)
* prevent block quotations, preformatted text, images and table rows from
being split onto two different pages
* ensure that headings never appear on a different page than the text they
are associated with
* ensure that
[orphans and widows](https://en.wikipedia.org/wiki/Widows_and_orphans) do
[not appear on printed pages](https://css-tricks.com/almanac/properties/o/orphans/)
The print styles are included along with the other `css` to [avoid the
additional HTTP request](http://www.phpied.com/delay-loading-your-print-css/).
Also, they should always be included last, so that the other styles can be
overwritten.
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.

View File

@@ -18,16 +18,14 @@ not everything fits with everyone's needs.
* [Social Networks](#social-networks)
* [URLs](#urls)
* [Web Apps](#web-apps)
* [security.txt](#security.txt)
## App Stores
### Smart App Banners in iOS 6+ Safari
Stop bothering everyone with gross modals advertising your entry in the
App Store. Include the following [meta tag](https://developer.apple.com/library/IOS/documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html#//apple_ref/doc/uid/TP40002051-CH6-SW2)
will unintrusively allow the user the option to download your iOS app,
or open it with some data about the user's current state on the website.
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.
```html
<meta name="apple-itunes-app" content="app-id=APP_ID,app-argument=SOME_TEXT">
@@ -108,10 +106,9 @@ Microsoft Ajax Content Delivery Network:
### Further reading about DNS prefetching
* https://developer.mozilla.org/en-US/docs/Controlling_DNS_prefetching
* 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/
* http://dayofjs.com/videos/22158462/web-browsers_alex-russel
## Google Universal Analytics
@@ -127,7 +124,7 @@ 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/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.
@@ -217,34 +214,12 @@ $(function(){
## Internet Explorer
### Prompt users to switch to "Desktop Mode" in IE10 Metro
### IE Pinned Sites
IE10 does not support plugins, such as Flash, in Metro mode. If
your site requires plugins, you can let users know that via the
`x-ua-compatible` meta element, which will prompt them to switch
to Desktop Mode.
```html
<meta http-equiv="x-ua-compatible" content="requiresActiveX=true">
```
Here's what it looks like alongside H5BP's default `x-ua-compatible`
values:
```html
<meta http-equiv="x-ua-compatible" content="ie=edge,requiresActiveX=true">
```
You can find more information in [Microsoft's IEBlog post about prompting for
plugin use in IE10 Metro
Mode](https://blogs.msdn.microsoft.com/ie/2012/01/31/web-sites-and-a-plug-in-free-web/).
### IE Pinned Sites (IE9+)
Enabling your application for pinning will allow IE9 users to add it to their
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 IE9
Pinned Sites](https://msdn.microsoft.com/en-us/library/gg131029.aspx).
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
@@ -277,7 +252,7 @@ track the number of pinned users, like so:
### Recolor IE's controls manually for a Pinned Site
IE9+ will automatically use the overall color of your Pinned Site's favicon to
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`).
@@ -322,13 +297,13 @@ blog](https://blogs.msdn.microsoft.com/ie/2012/06/08/high-quality-visuals-for-pi
### (Windows 8) Badges for Pinned Sites
IE10 will poll an XML document for badge information to display on your app's
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://msdn.microsoft.com/en-us/library/ie/br212849.aspx)
* [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">
@@ -398,18 +373,18 @@ plugin](https://www.google.com/search?ie=UTF-8&q=how+to+make+browser+search+plug
[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+](http://www.johanbrook.com/articles/native-style-momentum-scrolling-to-arrive-in-ios-5/)
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"
value="notranslate">`](https://support.google.com/translate/?hl=en#2641276).
content="notranslate">`](https://support.google.com/webmasters/answer/79812).
To disable translation for a particular section of the web page, add
[`class="notranslate"`](https://support.google.com/translate/?hl=en#2641276).
* If you want to disable the automatic detection and formatting of possible
phone numbers in Safari on iOS, use [`<meta name="format-detection"
content="telephone=no">`](https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html/#//apple_ref/doc/uid/TP40008193-SW5).
content="telephone=no">`](https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html).
* Avoid development/stage websites "leaking" into SERPs (search engine results
page) by [implementing X-Robots-tag
@@ -431,7 +406,7 @@ scratch](http://www.rssboard.org/rss-specification)?
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](http://www.atomenabled.org/developers/syndication/).
about](https://en.wikipedia.org/wiki/Atom_(Web_standard)).
```html
<link rel="alternate" type="application/atom+xml" title="Atom" href="/atom.xml">
@@ -447,7 +422,7 @@ attribute should contain the location of your pingback service.
```
* High-level explanation: https://codex.wordpress.org/Introduction_to_Blogging#Pingbacks
* Step-by-step example case: http://www.hixie.ch/specs/pingback/pingback-1.0#TOC5
* 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/
@@ -460,13 +435,13 @@ You can control the information that Facebook and others display when users
share your site. Below are just the most basic data points you might need. For
specific content types (including "website"), see [Facebook's built-in Open
Graph content
templates](https://developers.facebook.com/docs/opengraph/objects/builtin/).
templates](https://developers.facebook.com/docs/sharing/opengraph/using-objects).
Take full advantage of Facebook's support for complex data and activity by
following the [Open Graph
tutorial](https://developers.facebook.com/docs/opengraph/tutorial/).
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,
[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).
@@ -485,12 +460,10 @@ 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. Note
that, as of this writing, Twitter requires that app developers activate Cards
on a per-domain basis. You can read more about the various snippet formats
and application process in the [official Twitter Cards
documentation](https://dev.twitter.com/docs/cards), and you can validate
your markup with the [Card validator](https://cards-dev.twitter.com/validator)
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).
```html
@@ -503,16 +476,15 @@ your markup with the [Card validator](https://cards-dev.twitter.com/validator)
<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
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 or Yandex.
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/).
@@ -520,7 +492,7 @@ 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">
<html class="no-js" lang="" itemscope itemtype="https://schema.org/Article">
<head>
<link rel="author" href="">
@@ -543,16 +515,6 @@ the cleaner, more accurate `https://www.example.com/cart.html`.
<link rel="canonical" href="">
```
### Official shortlink
Signal to the world "This is the shortened URL to use this page!" Poorly
supported at this time. Learn more by reading the [article about shortlinks on
the Microformats wiki](http://microformats.org/wiki/rel-shortlink).
```html
<link rel="shortlink" href="h5bp.com">
```
### Separate mobile URLs
If you use separate URLs for desktop and mobile users, you should consider
@@ -573,8 +535,7 @@ This can be done by adding the following annotations in your HTML pages:
For more information please see:
* https://developers.google.com/webmasters/smartphone-sites/details#separateurls
* https://developers.google.com/webmasters/smartphone-sites/feature-phones
* https://developers.google.com/search/mobile-sites/mobile-seo/separate-urls
## Web Apps
@@ -605,39 +566,17 @@ on Apple's site.
### Apple Touch Icons
The Apple touch icons can be seen as the favicons of iOS devices.
Apple touch icons are used as icons when a user adds your webapp to the home
screen of aniOS devices.
The main sizes of the Apple touch icons are:
* `57×57px` iPhone with @1x display and iPod Touch
* `72×72px` iPad and iPad mini with @1x display running iOS ≤ 6
* `76×76px` iPad and iPad mini with @1x display running iOS ≥ 7
* `114×114px` iPhone with @2x display running iOS ≤ 6
* `120×120px` iPhone with @2x and @3x display running iOS ≥ 7
* `144×144px` iPad and iPad mini with @2x display running iOS ≤ 6
* `152×152px` iPad and iPad mini with @2x display running iOS 7
* `180×180px` iPad and iPad mini with @2x display running iOS 8
Displays meaning:
* @1x - non-Retina
* @2x - Retina
* @3x - Retina HD
More information about the displays of iOS devices can be found
[here](https://en.wikipedia.org/wiki/List_of_iOS_devices#Display).
In most cases, one `180×180px` touch icon named `icon.png`
and including:
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">
```
in the `<head>` of the page is enough. If you use art-direction and/or
want to have different content for each device, you can add more touch
icons as written above.
For a more comprehensive overview, please refer to Mathias' [article on Touch
Icons](https://mathiasbynens.be/notes/touch-icons).
@@ -646,19 +585,14 @@ 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 is
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 a retina iPhone:
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-retina.png">
<link rel="apple-touch-startup-image" media="(max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)" href="img/startup.png">
```
However, it is possible to detect which start-up image to use with JavaScript.
The Mobile Boilerplate provides a useful function for this. Please see
[helpers.js](https://github.com/h5bp/mobile-boilerplate/blob/v4.1.0/js/helper.js#L336-L383)
for the implementation.
### Chrome Mobile web apps
@@ -691,3 +625,15 @@ 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).
## 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.
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.

View File

@@ -5,8 +5,6 @@ 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)
* [How can I integrate Bootstrap with HTML5
Boilerplate?](#how-can-i-integrate-bootstrap-with-html5-boilerplate)
* [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
@@ -30,14 +28,9 @@ 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.)
### How can I integrate [Bootstrap](https://getbootstrap.com/) with HTML5 Boilerplate?
Here's Nicolas Gallagher writing about how [HTML5 Boilerplate and Bootstrap complement each
other](https://www.quora.com/Is-Bootstrap-a-complement-or-an-alternative-to-HTML5-Boilerplate-or-viceversa/answer/Nicolas-Gallagher).
### Do I need to upgrade my site each time a new version of HTML5 Boilerplate is released?
No, same as you don't normally replace the foundation of a house once it
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.

View File

@@ -7,7 +7,7 @@ By default, HTML5 Boilerplate provides two `html` pages:
* [`index.html`](#indexhtml) - a default HTML skeleton that should form the
basis of all pages on your website
* [`404.html`](#404html) - a placeholder 404 error page
* `404.html` - a placeholder 404 error page
## `index.html`
@@ -23,7 +23,7 @@ FOUC](https://www.paulirish.com/2009/avoiding-the-fouc-v3/).
## Language Attribute
Please consider specifying the language of your content by adding a [value](http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry) to the `lang`
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
@@ -32,71 +32,12 @@ attribute in the `<html>` as in this example:
### The order of the `<title>` and `<meta>` tags
The order in which the `<title>` and the `<meta>` tags are specified is
important because:
1) 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)
* 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/p/doctype-mirror/wiki/ArticleUtf7) in
Internet Explorer
2) the meta tag for compatibility mode
(`<meta http-equiv="x-ua-compatible" content="ie=edge">`):
* [needs to be included before all other tags except for the `<title>` and
the other `<meta>`
tags](https://msdn.microsoft.com/en-us/library/cc288325.aspx)
### `x-ua-compatible`
Internet Explorer 8/9/10 support [document compatibility
modes](https://msdn.microsoft.com/en-us/library/cc288325.aspx) that affect the
way webpages are interpreted and displayed. Because of this, even if your site's
visitor is using, let's say, Internet Explorer 9, it's possible that IE will not
use the latest rendering engine, and instead, decide to render your page using
the Internet Explorer 5.5 rendering engine.
Specifying the `x-ua-compatible` meta tag:
```html
<meta http-equiv="x-ua-compatible" content="ie=edge">
```
or sending the page with the following HTTP response header
```
X-UA-Compatible: IE=edge
```
will force Internet Explorer 8/9/10 to render the webpage in the highest
available mode in [the various cases when it may
not](https://hsivonen.fi/doctype/#ie8), and therefore, ensure that anyone
browsing your site is treated to the best possible user experience that
browser can offer.
If possible, we recommend that you remove the `meta` tag and send only the
HTTP response header as the `meta` tag will not always work if your site is
served on a non-standard port, as Internet Explorer's preference option
`Display intranet sites in Compatibility View` is checked by default.
If you are using Apache as your webserver, including the
[`.htaccess`](https://github.com/h5bp/server-configs-apache) file takes care of
the HTTP header. If you are using a different server, check out our [other
server config](https://github.com/h5bp/server-configs).
Starting with Internet Explorer 11, [document modes are
deprecated](https://msdn.microsoft.com/library/bg182625.aspx#docmode).
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](https://blogs.msdn.microsoft.com/ie/2014/04/02/stay-up-to-date-with-enterprise-mode-for-internet-explorer-11/) throughout your company.
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)
in Internet Explorer
## Meta Description
@@ -108,20 +49,27 @@ shown in the search results.
<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)
documentation has useful tips on creating an effective description.
## 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
Apple developer docs](https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariWebContent/UsingtheViewport/UsingtheViewport.html).
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.
## 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
@@ -132,7 +80,7 @@ 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">
<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)
@@ -156,8 +104,8 @@ 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 8 and lower. If you intended to support IE 8, then you
should remove the snippet of code.
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
@@ -176,14 +124,14 @@ Starting with version 3 Modernizr can be customized using the [modernizr-config.
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 some polyfill CDN service, like [cdn.polyfill.io](https://cdn.polyfill.io/),
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:
```html
<script src="js/vendor/modernizr-3.5.0.min.js"></script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-3.2.1.min.js"><\/script>')</script>
<script src="js/vendor/modernizr-3.8.0.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/plugins.js"></script>
<script src="js/main.js"></script>
</body>
@@ -193,7 +141,7 @@ 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.
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
@@ -217,7 +165,7 @@ 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 Chinese users.
being able to serve jQuery to users in China.
While the jQuery CDN is a strong default solution your site or application may
require a different configuration. Testing your site with services like
@@ -229,22 +177,29 @@ site or application.
### Google Universal Analytics Tracking Code
Finally, an optimized version of the Google Universal Analytics tracking code is
included. Google recommends that this script be placed at the top of the page.
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)
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, youll
be able to count users who dont fully load the page, and youll incur the max
number of simultaneous connections of the browser.
Further information:
* [Optimizing the Google Universal Analytics
Snippet](https://mathiasbynens.be/notes/async-analytics-snippet#universal-analytics)
* [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/)
**N.B.** The Google Universal Analytics snippet is included by default mainly
**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!
and use whatever suits your needs best.

View File

@@ -9,7 +9,7 @@ Information about the default JavaScript included in the project.
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.
entirely. That's cool.
## plugins.js
@@ -32,5 +32,5 @@ 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
build with the online builder](https://modernizr.com/download/) or [command
line tool](https://modernizr.com/docs#command-line-config).

View File

@@ -7,6 +7,7 @@ table of contents](TOC.md)
* [.editorconfig](#editorconfig)
* [Server Configuration](#server-configuration)
* [robots.txt](#robotstxt)
* [humans.txt](#humanstxt)
* [browserconfig.xml](#browserconfigxml)
--
@@ -41,21 +42,21 @@ your team define and maintain consistent coding styles between different
editors and IDEs.
By default, `.editorconfig` includes some basic
[properties](http://editorconfig.org/#supported-properties) that reflect the
[properties](https://editorconfig.org/#supported-properties) that reflect the
coding styles from the files provided by default, but you can easily change
them to better suit your needs.
In order for your editor/IDE to apply the
[properties](http://editorconfig.org/#supported-properties) from the
[properties](https://editorconfig.org/#supported-properties) from the
`.editorconfig` file, you may need to [install a
plugin]( http://editorconfig.org/#download).
plugin]( https://editorconfig.org/#download).
__N.B.__ If you aren't using the server configurations provided by HTML5
Boilerplate, we highly encourage you to configure your server to block
access to `.editorconfig` files, as they can disclose sensitive information!
For more details, please refer to the [EditorConfig
project](http://editorconfig.org/).
project](https://editorconfig.org/).
## Server Configuration
@@ -83,7 +84,7 @@ 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.
https://github.com/h5bp/server-configs-apache#enable-apache-httpd-modules.
In the repo the `.htaccess` is used for:
@@ -136,9 +137,23 @@ 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/)
* [robotstxt.org](https://www.robotstxt.org/)
* [How Google handles the `robots.txt` file](https://developers.google.com/webmasters/control-crawl-index/docs/robots_txt)
## humans.txt
The `humans.txt` file is used to provide information about people involved with
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
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/
## browserconfig.xml
@@ -155,4 +170,4 @@ 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://msdn.microsoft.com/library/dn320426.aspx).
see [MSDN](https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/dn320426(v=vs.85)).

View File

@@ -18,7 +18,7 @@ serve as the foundation for whatever you're interested in building.
Even the basic use-case of a simple static site can be enhanced by manipulating
the code through an automated build process. Moving up in complexity HTML5
Boilerplate can be be integrated with whatever front-end framework, CMS or
Boilerplate can be integrated with whatever front-end framework, CMS or
e-commerce platform you're working with. Mix-and-match to your heart's content.
Use what you need (toss it in a blender if you need to) and discard the rest.
HTML5 Boilerplate is a starting point, not a destination.
@@ -92,7 +92,7 @@ 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
[MSDN](https://msdn.microsoft.com/library/dn455106.aspx).
[Microsoft's Docs](https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/dn320426(v=vs.85)).
### .editorconfig

View File

@@ -1,37 +1,41 @@
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="manifest" href="site.webmanifest">
<link rel="apple-touch-icon" href="icon.png">
<!-- Place favicon.ico in the root directory -->
<head>
<meta charset="utf-8">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<!--[if lte IE 9]>
<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]-->
<link rel="manifest" href="site.webmanifest">
<link rel="apple-touch-icon" href="icon.png">
<!-- Place favicon.ico in the root directory -->
<!-- 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>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css">
<meta name="theme-color" content="#fafafa">
</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')
</script>
<script src="https://www.google-analytics.com/analytics.js" async></script>
</body>
<!-- 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('send','pageview')
</script>
<script src="https://www.google-analytics.com/analytics.js" async defer></script>
</body>
</html>

View File

@@ -1,24 +1,24 @@
// Avoid `console` errors in browsers that lack a console.
(function() {
var method;
var noop = function () {};
var methods = [
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
'timeline', 'timelineEnd', 'timeStamp', 'trace', 'warn'
];
var length = methods.length;
var console = (window.console = window.console || {});
var method;
var noop = function () {};
var methods = [
'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
'timeline', 'timelineEnd', 'timeStamp', 'trace', 'warn'
];
var length = methods.length;
var console = (window.console = window.console || {});
while (length--) {
method = methods[length];
while (length--) {
method = methods[length];
// Only stub undefined methods.
if (!console[method]) {
console[method] = noop;
}
// Only stub undefined methods.
if (!console[method]) {
console[method] = noop;
}
}
}());
// Place any jQuery/helper plugins in here.

View File

@@ -1,8 +1,12 @@
{
"icons": [{
"src": "icon.png",
"sizes": "192x192",
"type": "image/png"
}],
"start_url": "/"
"short_name": "",
"name": "",
"icons": [{
"src": "icon.png",
"type": "image/png",
"sizes": "192x192"
}],
"start_url": "/?utm_source=homescreen",
"background_color": "#fafafa",
"theme_color": "#fafafa"
}

View File

@@ -1,5 +1,3 @@
/* jshint mocha: true */
import assert from 'assert';
import fs from 'fs';
import path from 'path';
@@ -12,36 +10,36 @@ const dirs = pkg['h5bp-configs'].directories;
function checkString(file, string, done) {
let character = '';
let matchFound = false;
let matchedPositions = 0;
const readStream = fs.createReadStream(file, { 'encoding': 'utf8' });
let character = '';
let matchFound = false;
let matchedPositions = 0;
const readStream = fs.createReadStream(file, {'encoding': 'utf8'});
readStream.on('close', done);
readStream.on('error', done);
readStream.on('readable', function () {
readStream.on('close', done);
readStream.on('error', done);
readStream.on('readable', function () {
// Read file until the string is found
// or the whole file has been read
while (matchFound !== true &&
// Read file until the string is found
// or the whole file has been read
while (matchFound !== true &&
(character = readStream.read(1)) !== null) {
if (character === string.charAt(matchedPositions)) {
matchedPositions += 1;
} else {
matchedPositions = 0;
}
if (character === string.charAt(matchedPositions)) {
matchedPositions += 1;
} else {
matchedPositions = 0;
}
if (matchedPositions === string.length) {
matchFound = true;
}
if (matchedPositions === string.length) {
matchFound = true;
}
}
}
assert.equal(true, matchFound);
this.close();
assert.equal(true, matchFound);
this.close();
});
});
}
@@ -49,37 +47,37 @@ function checkString(file, string, done) {
function runTests() {
const dir = dirs.dist;
const dir = dirs.dist;
describe(`Test if the files from the "${dir}" directory have the expected content`, () => {
it('".htaccess" should have the "ErrorDocument..." line uncommented', (done) => {
const string = '\n\nErrorDocument 404 /404.html\n\n';
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);
});
it('"main.css" should contain a custom banner', function (done) {
const string = `/*! HTML5 Boilerplate v${pkg.version} | ${pkg.license} License | ${pkg.homepage} */\n\n/*\n`;
checkString(path.resolve(dir, 'css/main.css'), string, done);
});
describe(`Test if the files from the "${dir}" directory have the expected content`, () => {
it('".htaccess" should have the "ErrorDocument..." line uncommented', (done) => {
const string = '\n\nErrorDocument 404 /404.html\n\n';
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);
});
it('"main.css" should contain a custom banner', function (done) {
const string = `/*! HTML5 Boilerplate v${pkg.version} | ${pkg.license} License | ${pkg.homepage} */\n`;
checkString(path.resolve(dir, 'css/main.css'), string, done);
});
});
}
runTests();

View File

@@ -1,5 +1,3 @@
/* jshint mocha: true */
import assert from 'assert';
import fs from 'fs';
import path from 'path';
@@ -10,55 +8,55 @@ import pkg from './../package.json';
const dirs = pkg['h5bp-configs'].directories;
const expectedFilesInArchiveDir = [
`${pkg.name}_v${pkg.version}.zip`
`${pkg.name}_v${pkg.version}.zip`
];
const expectedFilesInDistDir = [
'.editorconfig',
'.gitattributes',
'.gitignore',
'.htaccess',
'404.html',
'browserconfig.xml',
'.editorconfig',
'.gitattributes',
'.gitignore',
'.htaccess',
'404.html',
'browserconfig.xml',
'css/', // for directories, a `/` character
// should be included at the end
'css/main.css',
'css/normalize.css',
'css/', // for directories, a `/` character
// should be included at the end
'css/main.css',
'css/normalize.css',
'doc/',
'doc/TOC.md',
'doc/css.md',
'doc/extend.md',
'doc/faq.md',
'doc/html.md',
'doc/js.md',
'doc/misc.md',
'doc/usage.md',
'doc/',
'doc/TOC.md',
'doc/css.md',
'doc/extend.md',
'doc/faq.md',
'doc/html.md',
'doc/js.md',
'doc/misc.md',
'doc/usage.md',
'favicon.ico',
'humans.txt',
'favicon.ico',
'humans.txt',
'icon.png',
'icon.png',
'img/',
'img/.gitignore',
'img/',
'img/.gitignore',
'index.html',
'index.html',
'js/',
'js/main.js',
'js/plugins.js',
'js/vendor/',
`js/vendor/jquery-${pkg.devDependencies.jquery}.min.js`,
`js/vendor/modernizr-${pkg.devDependencies.modernizr}.min.js`,
'js/',
'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',
'robots.txt',
'site.webmanifest',
'tile-wide.png',
'tile.png'
'LICENSE.txt',
'robots.txt',
'site.webmanifest',
'tile-wide.png',
'tile.png'
];
@@ -66,51 +64,51 @@ const expectedFilesInDistDir = [
function checkFiles(directory, expectedFiles) {
// Get the list of files from the specified directory
const files = glob.sync('**/*', {
'cwd': directory,
'dot': true, // include hidden files
'mark': true // add a `/` character to directory matches
// Get the list of files from the specified directory
const files = glob.sync('**/*', {
'cwd': directory,
'dot': true, // include hidden files
'mark': true // add a `/` character to directory matches
});
// Check if all expected files are present in the
// specified directory, and are of the expected type
expectedFiles.forEach((file) => {
let ok = false;
const expectedFileType = (file.slice(-1) !== '/' ? 'regular file' : 'directory');
// If file exists
if (files.indexOf(file) !== -1) {
// Check if the file is of the correct type
if (file.slice(-1) !== '/') {
// Check if the file is really a regular file
ok = fs.statSync(path.resolve(directory, file)).isFile();
} else {
// Check if the file is a directory
// (Since glob adds the `/` character to directory matches,
// we can simply check if the `/` character is present)
ok = (files[files.indexOf(file)].slice(-1) === '/');
}
}
it(`"${file}" should be present and it should be a ${expectedFileType}`, () =>{
assert.equal(true, ok);
});
// Check if all expected files are present in the
// specified directory, and are of the expected type
expectedFiles.forEach( (file) => {
let ok = false;
const expectedFileType = (file.slice(-1) !== '/' ? 'regular file' : 'directory');
// If file exists
if (files.indexOf(file) !== -1) {
// Check if the file is of the correct type
if (file.slice(-1) !== '/') {
// Check if the file is really a regular file
ok = fs.statSync(path.resolve(directory, file)).isFile();
} else {
// Check if the file is a directory
// (Since glob adds the `/` character to directory matches,
// we can simply check if the `/` character is present)
ok = (files[files.indexOf(file)].slice(-1) === '/');
}
}
it(`"${file}" should be present and it should be a ${expectedFileType}`, () =>{
assert.equal(true, ok);
});
});
// List all files that should be NOT
// be present in the specified directory
(files.filter((file) => {
return expectedFiles.indexOf(file) === -1;
})).forEach((file) => {
it(`"${file}" should NOT be present`, () => {
assert(false);
});
// List all files that should be NOT
// be present in the specified directory
(files.filter( (file) => {
return expectedFiles.indexOf(file) === -1;
})).forEach( (file) => {
it(`"${file}" should NOT be present`, () => {
assert(false);
});
});
});
}
@@ -118,18 +116,18 @@ function checkFiles(directory, expectedFiles) {
function runTests() {
describe('Test if all the expected files, and only them, are present in the build directories', () => {
describe(dirs.archive, () => {
checkFiles(dirs.archive, expectedFilesInArchiveDir);
});
describe(dirs.dist, () => {
checkFiles(dirs.dist, expectedFilesInDistDir);
});
describe('Test if all the expected files, and only them, are present in the build directories', () => {
describe(dirs.archive, () => {
checkFiles(dirs.archive, expectedFilesInArchiveDir);
});
describe(dirs.dist, () => {
checkFiles(dirs.dist, expectedFilesInDistDir);
});
});
}
runTests();