Compare commits

..

209 Commits

Author SHA1 Message Date
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
Rob Larsen
dbc3ed9735 Restores stable visuallyhidden (#1991)
see the saga unfold #1985
2017-09-11 09:48:56 -04:00
Rob Larsen
bfdc2c5ccd Updates package.json for npm (#1988)
* added repository field

* Small update to package.json
2017-08-17 12:56:37 -04:00
Rob Larsen
40080b5689 updates changelog and dist css (#1987) 2017-08-17 12:55:43 -04:00
Joe Watkins
9f13695d21 1985 - fix VoiceOver reading order bug with visually hidden text - remove clip and absolute positioning - add inline-block (#1989) 2017-08-17 12:07:12 -04:00
Scott O'Hara
7bff68fa57 Fix Bug: .visuallyhidden on macOS VO (#1986)
This PR solves [issue 1985: macOS - VoiceOver / Chrome announcing visually hidden text out of order](https://github.com/h5bp/html5-boilerplate/issues/1985)

By removing the negative margin, and setting it to `margin: 0;`, the issue is resolved.
2017-08-11 20:45:53 -04:00
Rob Larsen
d22220590b Docs updated (#1983) 2017-08-01 14:27:31 -04:00
Rob Larsen
f91a9253d3 Updates js.md (#1982) 2017-08-01 13:31:10 -04:00
Rob Larsen
a0aa8370a6 Updating faq.md (#1981)
#1554
2017-07-31 16:38:04 -04:00
Rob Larsen
826f5f05d8 Updating usage.md (#1979)
* Rewriting the basic usage blurb

* Expanding the Usage intro

* interesting - > interested
2017-07-25 11:04:17 -04:00
Christian Oliff
14d3756b42 Update .gitattributes (#1980)
Latest updates from: https://github.com/alexkaratarakis/gitattributes/blob/master/Web.gitattributes
2017-07-25 11:01:10 -04:00
Rob Larsen
0be93d5ffc Missing an "n" 2017-07-24 10:30:21 -04:00
Christian Oliff
1dcd1e524e Create SUPPORT.md (#1978)
Add a SUPPORT file to the .github/ folder directing folks to Stack Overflow if they have a general question about using H5BP. A link to this file will now display when someone opens a new issue which could cut down on new issues being opened unnecessarily. I realise the content in this file could have overlap in the existing ISSUE_TEMPLATE.md file but I think it'd be worth adding.
2017-07-22 08:10:40 -04:00
Christian Oliff
6f0eaec0ba Remove link to the retired initializr site (#1976) 2017-07-21 21:30:57 -04:00
Christian Oliff
bad87b9f54 Remove 'Chrome Web Store app section' (#1975)
Chrome Web Store are no longer accepting submissions for web apps (Windows, Mac or Linux) so this section is no longer needed. Users can use W3C Manifest file instead to allow for users to install their webapps.

> As of 21 November 2016, all newly published packaged or hosted apps are restricted to Chrome OS, and are not available to users on Windows, Mac or Linux. Existing apps will continue to be available on all major platforms and will continue to receive updates
REF: https://blog.chromium.org/2016/08/from-chrome-apps-to-web.html
2017-07-20 12:37:22 -04:00
Christian Oliff
83ee10314c Fix typos and markdown errors (#1974)
Fix typos and markdown errors
2017-07-20 12:12:22 -04:00
Rob Larsen
4d593d15cb clarification on favico.ico
see #1783
2017-07-20 11:02:28 -04:00
Rob Larsen
a9a271c999 Updated with accessibility note. 2017-07-20 10:58:37 -04:00
Rob Larsen
026c50c1f3 Update html.md
Adds some docs about the web app manifest and modernizr 3.
Also, housekeeping!
2017-07-18 13:58:32 -04:00
Christian Oliff
0ab739989e Update html.md (#1973)
- Update IE versions compatibility for Browser Upgrade Prompt section
2017-07-18 12:37:18 -04:00
Christian Oliff
67b8cd63f2 Update extend.md (#1972)
- HTTPS links to example.com (I know it's only an example but good to encourage always using HTTPS for everything)
- Fix Markdown issue with iOS web apps code not displaying.
- Remove section incorrectly stating that 'Screen readers currently have less-than-stellar support for HTML5'. The JavaScript polyfill is largely unnecessary and hasn't been updated for 4 years.
- Rename filename reference for apple-touch-icon to be icon.png to match what is used by H5BP
- Remove the no-longer-exists Firefox OS from list of browsers which support `theme-color`  (Firefox browser does not support theme-color at this time)
2017-07-18 12:36:40 -04:00
Rob Larsen
a0fd4b4b6b Added direct links to various server config repos 2017-07-18 10:57:40 -04:00
Christian Oliff
0cb11dc50a Updates to usage.md (#1970)
- Updated file tree with relevant additions, filename changes and
alphabetized
- Mention that browserconfig.xml is relevant for Edge (as well as IE11)
- Remove very old link with favicon.psd. It is deprecated and doesn't
have any of the recent iPhones app sizes.
2017-07-17 13:39:46 -04:00
Pete Cooper
ac39d02090 Typo in CHANGELOG.md (#1971)
Changed `housekeeing` to a real word.
2017-07-17 08:46:10 -04:00
Rob Larsen
a05250d121 CHANGELOG updated
Lots of changes!
2017-07-14 10:58:16 -04:00
Christian Oliff
89b15a6506 Editorconfig change 'will need a plugin' to 'may need' (#1968)
Visual Studio, BBEdit, WebStorm and others have built-in support for
Editorconfig files so we should change ‘will need to install a plugin’
to ‘may need to install a plugin’.
2017-07-13 10:56:59 -04:00
Christian Oliff
57b3983500 Update autoprefixer to IE 9 and above (#1969)
was previously IE 8 and above
2017-07-13 10:49:14 -04:00
Christian Oliff
9bd483882f Remove package-lock.json (#1966)
There's a known issue with NPM where the package-lock.json file is not updated after package.json file is changed. This has been confirmed as a bug by NPM and a fix will be rolling out soon. For the time being I propose we remove this file (particularly as the dependency versions are now out of sync). 
REF: https://github.com/npm/npm/issues/16866
2017-07-12 10:48:31 -04:00
Christian Oliff
14d990e270 Update dev dependencies (#1965)
Updated archiver, babel-core, del, glob, gulp-load-plugins, gulp-replace, jshint, run-sequence, and travis-after-all to the latest versions. All tests completed without issues and the 'dist' folders output is the same as before so we're all good there.
2017-07-12 10:34:53 -04:00
Christian Oliff
0dd2a66702 Losslessly optimized icon.png (#1964)
Losslessly optimized with ImageOptim (MacOS). Saved 0.5%. :-)
2017-07-12 08:30:13 -04:00
Rob Larsen
bc2710e047 Adds web app manifest file (#1963)
closes #1629
2017-07-11 14:54:22 -04:00
Christian Oliff
efa3db1cd0 ::first-letter in print style can cause incorrect rendering in Chrome (#1962)
Chrome currently has a bug (when printing) that results in
::first-letter being vertically misaligned under certain (seemingly
unrelated) conditions. This PR fixes issue by removing the CSS that
causes the issue.
2017-07-11 12:40:35 -04:00
Rob Larsen
fb6cb8d198 Upgrades Normalize (#1960)
closes #1959
2017-07-06 12:11:44 -04:00
Christian Oliff
487c64fa78 Update polyfill JS example (#1958)
- Update Polyfill CDN to v2 which is the default version (Ref: https://cdn.polyfill.io )
- Switch the JQuery from Google's CDN to Jquery's CDN to match the main index.html
- Update to jQuery 3.2.1.
- Add SRI hash to jQuery link
2017-07-06 12:06:22 -04:00
Christian Oliff
e7fe855a44 Update to jQuery 3.2.1 (#1942)
* Update to jQuery 3.2.1

Update to jQuery 3.2.1

* Update package.json
2017-07-06 10:30:36 -04:00
Christian Oliff
957f9f3f66 Remove link to ySlow (#1957)
Yahoo's YSlow is (sadly) no longer actively maintained. The browser extensions don't work anymore and the main repo hasn't been updated for nearly four years. I suggest to remove the http://developer.yahoo.com/yslow/ link.
2017-07-06 10:18:36 -04:00
Christian Oliff
76bafcf5c5 HTTPS some third-party links (#1956)
HTTPS some third-party links
2017-07-06 10:18:00 -04:00
Markus Oberlehner
8b35e707b7 Improve ::selection documentation which became confusing after c7057be (#1955)
After Autoprefixer was added a comment explaining that the vendor prefixed
`::-moz-selection` and the default `::selection` can't be combined became
obsolete. I (with the help of @roblarsen) rephrased the comment to be more
general and so that it still makes sense in the dist css file. A stackoverflow
link explains why vendor prefixed selectors can't be combined with other selectors.

Fixes #1953
2017-07-05 13:19:47 -04:00
Maik Ellerbrock
591b2f6194 refactor(html): update browsehappy to https instead of http (#1952) 2017-06-30 16:12:28 -04:00
Jacob Dreesen
5505ef0133 Fix links to CONTRIBUTING.md (#1951) 2017-06-11 12:03:51 -04:00
Rob Larsen
907918637c Adds .github folder and contents Fixes #1943 (#1948)
Adds Issue Template

 Adds PR Template

 Rewrites Contributing.md and moves it to ./github
2017-06-07 14:14:59 -04:00
Rob Larsen
2ad7077517 Adds Modernizr 3 (#1940)
Fixes #1740 and #1605

- removes the static custom build of modernizr
- moves Modernizr to the bottom
- builds a custom modernizr in gulp
- adds tests for the generated modernizr
2017-05-28 08:54:44 -04:00
Rob Larsen
9888a8f5b4 Updates HEAD changelog 2017-05-23 15:01:43 -04:00
saharjs
e0114f377e Update README.md (#1937) 2017-04-20 22:34:51 -04:00
Alexander Salas Bastidas
220937b1ac Update .gitattributes for Web Projects (#1935)
Based from a collection of useful .gitattributes templates of @alexkaratarakis

https://github.com/alexkaratarakis/gitattributes
2017-04-08 21:56:07 -04:00
Alexander Salas Bastidas
f86189a254 Add the link for useful .gitignore templates (#1936) 2017-04-07 10:40:30 -04:00
Amila Welihinda
024b8a05ee Restricted engines to node 4, npm 3 (#1931) 2017-03-27 10:38:07 -04:00
Amila Welihinda
6f21d78a21 Removed duplicate babel config in package.json (#1928) 2017-03-27 10:37:37 -04:00
Amila Welihinda
29fd4124f4 Test against modern node versions (#1925) 2017-03-19 13:15:30 -04:00
Rob Larsen
9d6176a26c Updates jQuery to 3.2.0 (#1924)
* Updates jquery to 3.2.0
2017-03-17 21:31:38 -04:00
Gaël Poupard
abc64efcb7 clip is deprecated: add clip-path as PE (#1920)
`clip` [is deprecated since 2014](https://www.w3.org/TR/css-masking-1/#clip-property). It works great but already has a more future proof version: `clip-path`.

@ryuran [suggested](https://twitter.com/ryuran78/status/778943389819604992) the `clip:path: inset(50%);` notation as it's the shorter possible to mimic our old clip.

Here's [a codepen](http://codepen.io/ffoodd/pen/gwKZyq?editors=1100#) and [a post translated by Hugo Giraudel](http://hugogiraudel.com/2016/10/13/css-hide-and-seek/).

Hope it'll help :)
2017-03-11 21:42:11 -05:00
Mr. Hyde
f888d9611b Reference sitemap.xml from robots.txt file (#1918)
Replaced urban legend about referencing robots.txt file for with an actually working and suggested by all major search engines method.

See:
[Google](https://support.google.com/webmasters/answer/183668?hl=en#addsitemap)
[Bing](https://www.bing.com/webmaster/help/how-to-submit-sitemaps-82a15bd4)
[Yandex](https://yandex.com/support/webmaster/indexing-options/sitemap.xml#notify-about)

ref: [h5bp#1895](https://github.com/h5bp/html5-boilerplate/issues/1895), [kotsu#88](https://github.com/LotusTM/Kotsu/issues/88)
2017-02-24 20:01:28 -05:00
Marco Biedermann
4ded8b5ce0 update devDependencies (#1910) 2016-12-25 12:23:17 -05:00
Marco Biedermann
2ea87deb35 use es2015 syntax in mocha tests (#1788)
use import instead of require
use fat arrow => function instead of function() {} callback
use and let and const instead of var
use template stings instead of string concatenation
2016-12-25 12:07:10 -05:00
H5BP
41b63975e5 Update content from the dist directory [skip ci] 2016-12-09 23:43:23 +00:00
Rob Larsen
f14024b9b3 Bumps jquery to 3.1.1 (#1909) 2016-12-09 18:40:15 -05:00
Waqas Ibrahim
6d22bdb02b updated to normalize.css v5.0.0 (#1908)
* updated normalize.css to v5.0.0
2016-12-09 18:07:35 -05:00
H5BP
5425efa538 Update content from the dist directory [skip ci] 2016-11-30 15:09:14 +00:00
Zearin
3937c41d91 Minor formatting edits (#1907) 2016-11-30 10:04:52 -05:00
H5BP
754268a347 Update content from the dist directory [skip ci] 2016-11-17 13:44:27 +00:00
Sergio Lavanga
fea7f22aef Scope :first-letter selector for print styles (#1905)
See: https://github.com/twbs/bootstrap/pull/21095
2016-11-17 08:34:46 -05:00
Kamil Breguła
76baba6a16 Add SRI Hash for jQuery (#1904)
Adds SRI Hash for jQuery

More info:
https://www.srihash.org/
https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity
jquery/codeorigin.jquery.com#20
http://caniuse.com/#feat=subresource-integrity
2016-11-16 18:06:52 -05:00
XhmikosR
f1ed892389 Update .jshintrc (#1903) 2016-10-29 23:29:01 -04:00
H5BP
dff0e5ea33 Update content from the dist directory [skip ci] 2016-10-21 15:06:36 +00:00
Becky
2f9d2a41fc Improve accessibility with visuallyhidden content (#1900)
Add white-space: nowrap to visuallyhidden class so screenreaders can interpret line feeds correctly.
Add white-space: inherit to the focusable modifier so when focused the content appears as normal.
2016-10-21 10:21:47 -04:00
QWp6t
a2356c1cbf Display .browserupgrade message to IE 8 and 9 users. (#1748) 2016-09-12 22:36:03 -04:00
Rob Larsen
5b894fbc5e Updates Changelog to match recent history 2016-09-12 21:07:28 -04:00
Rob Larsen
4ebe939594 Updates README to reflect new IE support 2016-09-12 12:47:05 -04:00
Rob Larsen
b0ce6c4b77 Removes IE8 Support - Fixes #1524 (#1892)
- upgrades normalize
- upgrades jQuery

commit
2016-09-12 12:07:24 -04:00
Kenneth Williams
98c8f99b38 Re-add sudo: false to Travis config (#1890)
`sudo: false` is only default in repositories added in 2015 and later.

Ref: https://docs.travis-ci.com/user/ci-environment/
2016-08-17 21:38:20 -04:00
Damian Wajer
9c98cfaffb Fix print styles for Internet Explorer 11 (#1799)
*:first-line pseudo-selector freezes window with print preview in IE 11
(tested on Windows 7 with IE 11.0.9600.17420 and 11.0.9600.18204,
Windows 8.1 with IE 11.0.9600.16663, Windows 10 with IE 11.63.10586.0)

To reproduce just open: http://demo.html5boilerplate.com/
or /dist/index.html and select Print > Print preview...
2016-08-17 15:53:43 -04:00
H5BP
b0aad4fd9c Update content from the dist directory [skip ci] 2016-08-17 13:22:43 +00:00
Rob Larsen
7eb61d80bd DOCS: remove double slash
In updating the links we inadvertently added a double slash to one of the links.
2016-08-17 09:18:23 -04:00
H5BP
5400e04fb2 Update content from the dist directory [skip ci] 2016-08-15 21:06:23 +00:00
Carlos Araya
88b3eefff6 Resolving greenkeeper issues. (#1887)
Resolve #1870, #1869, #1868. Upgrades jQuery to 1.12.4 until discussion on removing support for IE8 is complete
2016-08-15 17:01:55 -04:00
H5BP
71b062d38a Update content from the dist directory [skip ci] 2016-08-15 20:58:51 +00:00
XhmikosR
274cd56646 Update links. (#1889)
* switch to `https`
* remove redirects
* add/remove trailing slash
2016-08-15 16:54:31 -04:00
H5BP
a4200355e9 Update content from the dist directory [skip ci] 2016-08-15 20:10:46 +00:00
t1st3
58a2ba81d2 Delete crossdomain.xml (#1881)
from #1779

* removes crossdomain.xml
* remove occurences to crossdomain.xml in doc and test
2016-08-15 16:06:54 -04:00
Ryan Dlugosz
a90685e01d Remove print img max-width: 100%. Fixes #1741 (#1882)
Following the lead of Twitter Bootstrap (see: https://github.com/twbs/bootstrap/pull/19000), remove the print media query that sets a max-width of 100% to images. This code was meant to prevent images from being cut off in print, but has a side effect of causing map tiles to disappear when printing medium-to-large maps (e.g., with Google Maps).

For reference, this style was added to H5BP in b2faa1fc3c
2016-08-15 10:19:25 -04:00
Chris Laughlin
59d0ce0e87 Adds pre-wrap to PRE fixes #1742 (#1886) 2016-08-15 09:42:58 -04:00
XhmikosR
b840bebeaf Fix license banner in main.css after #1814. (#1888) 2016-08-13 20:18:35 -04:00
H5BP
a7fd7c0e96 Update content from the dist directory [skip ci] 2016-08-08 20:25:43 +00:00
Paul Irish
908c6b6344 Merge pull request #1814 from wolfie/patch-1
Change license format to SPDX format
2016-08-08 13:21:12 -07:00
Paul Irish
a1f549f9f6 Merge pull request #1845 from kaelig/patch-1
Remove sudo: false in Travis configuration
2016-08-08 13:18:47 -07:00
H5BP
c7081f3700 Update content from the dist directory [skip ci] 2016-08-08 20:16:23 +00:00
Paul Irish
3bc2193384 Merge pull request #1859 from johnbacon/patch-1
Update the link to theme-color documentation
2016-08-08 13:10:28 -07:00
John Bacon
47004043d4 Update the link to theme-color documentation
Previous link was obsolete and pointing to WHATWG link.
2016-05-31 12:54:16 -04:00
Kaelig
76aa339a23 Remove sudo: false in Travis configuration
Travis builds now run on their container build by default and sudo: false is now the default value.
2016-05-18 20:10:11 -07:00
Henrik Paul
e5e11481d2 Change license format to SPDX format
The old license style (license.type and license.url) is deprecated by NPM
2016-03-29 19:23:37 +03:00
H5BP
b5d6e7b161 Update content from the dist directory [skip ci] 2016-03-28 00:29:12 +00:00
greenkeeperio-bot
4c52f6e669 Update jQuery to v1.12.2
Close h5bp/html5-boilerplate#1810
Close h5bp/html5-boilerplate#1811
2016-03-28 03:00:55 +03:00
Cătălin Mariș
a2bf312950 Remove SSH set up related code
Remove the code added in order to set up the SSH connection,
and instead, use travis-scripts' helper function `set-up-ssh`.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Ref: https://github.com/alrra/travis-scripts/issues/19
2016-03-28 03:00:49 +03:00
H5BP
55d0985e6f Update content from the dist directory [skip ci] 2016-03-28 03:00:42 +03:00
Cătălin Mariș
296d301e27 Docs: Remove Mobile Boilerplate recommendation
The `Mobile Boilerplate` project is no longer actively maintained
and has been deprecated for a while.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Thanks @joekalange!

Close: h5bp/html5-boilerplate#1807
2016-03-11 15:21:37 +02:00
greenkeeperio-bot
0ffd0cb79c Update babel-preset-es2015 to v6.6.0
Close h5bp/html5-boilerplate#1797
2016-03-11 15:08:57 +02:00
greenkeeperio-bot
67ffc91d03 Update glob to v7.0.3
Close h5bp/html5-boilerplate#1803
Close h5bp/html5-boilerplate#1804
2016-03-11 15:05:22 +02:00
greenkeeperio-bot
5f4d2d8e08 Update babel-core to v6.7.2
Close h5bp/html5-boilerplate#1796
Close h5bp/html5-boilerplate#1800
Close h5bp/html5-boilerplate#1802
Close h5bp/html5-boilerplate#1805
Close h5bp/html5-boilerplate#1808
2016-03-11 15:05:08 +02:00
H5BP
00419696c2 Update content from the dist directory [skip ci] 2016-02-26 09:06:31 +00:00
greenkeeperio-bot
b22de5dcb2 Update jQuery to v1.12.1
Close h5bp/html5-boilerplate#1791
2016-02-26 11:02:20 +02:00
Mathias Bynens
2dfb90309f Simplify analytics snippet using async & defer
With this snippet, modern browsers use `async`, older browsers (i.e.
IE8 & IE9) use `defer`.

IE8 and IE9 lack `async` support but they have a broken implementation
of `defer`. However, the brokenness doesn’t apply in this scenario
since no scripts depend on GA in the way jQuery UI depends on jQuery.
`async` is also not supported by the Android 2.3 browser, but that
browser does have a preload scanner to make up for it.

Once we drop support for IE8 and IE9, the `defer` attribute can be
omitted.

The only downside is that the snippet is not a pure JavaScript
solution anymore, meaning it cannot be moved or concatenated into a
`.js` file. On the other hand, no one seemed to be doing that anyway;
everyone just inlines the snippet into the HTML.

Ref. https://github.com/h5bp/html5-boilerplate/pull/1660#issuecomment-89285678

Closes #1696.
2016-02-12 00:01:44 +01:00
Jimo
1dc011fe7e Doc: Make minor improvements
Close h5bp/html5-boilerplate#1720
2016-02-12 00:39:19 +02:00
Cătălin Mariș
72823a97b6 Use https:// where possible 2016-02-12 00:24:13 +02:00
H5BP
31047ecc30 Update content from the dist directory [skip ci] 2016-02-11 22:03:50 +00:00
t1st3
7f456c96f2 Docs: Improve social networks & SEO metadata info
Fix h5bp/html5-boilerplate#1674
Close h5bp/html5-boilerplate#1780
2016-02-12 00:00:47 +02:00
Cătălin Mariș
10fb130e76 Update tests to include Node v5 2016-02-11 23:51:47 +02:00
H5BP
d3be5f3730 Update content from the dist directory [skip ci] 2016-02-11 21:51:00 +00:00
Cătălin Mariș
7bad82c97b Further losslessly optimize apple-touch-icon.png
Before:         3959 B
  After:          3958 B
  ──────────────────────
  Reduction:         1 B [0.025%]
2016-02-11 23:47:04 +02:00
Cătălin Mariș
03ddc0d696 Update travis-scripts to v2.0.0
* Move to using GitHub deploy keys² as they are more secure
  than GitHub tokens.

* Add `travis-after-all` as a dev dependency as it's no longer
  installed and executed by `travis-scripts`.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

¹ https://github.com/alrra/travis-scripts#readme
² https://developer.github.com/guides/managing-deploy-keys/#deploy-keys
³ https://github.com/alrra/travis-after-all#readme
2016-02-11 23:47:00 +02:00
greenkeeperio-bot
959ee8229d Update gulp to v3.9.1
Close h5bp/html5-boilerplate#1785
2016-02-11 23:16:15 +02:00
greenkeeperio-bot
daece9bdc0 Update glob to v7.0.0
Close h5bp/html5-boilerplate#1786
2016-02-11 23:16:15 +02:00
Marco Biedermann
800a806f2b ES2015ify the gulpfile
Close h5bp/html5-boilerplate#1787
2016-02-11 23:16:12 +02:00
H5BP
952f0352c3 Update content from the dist directory [skip ci] 2016-02-03 11:55:17 +00:00
Prayag Verma
8c91bb4a28 Docs: Fix typo in misc.md
Close h5bp/html5-boilerplate#1782
2016-02-03 13:53:13 +02:00
Cătălin Mariș
77c09009f6 v5.3.0 2016-01-12 14:59:19 +02:00
Cătălin Mariș
4b089a3a76 Update jQuery to v1.12.0
Ref: https://blog.jquery.com/2016/01/08/jquery-2-2-and-1-12-released/
2016-01-09 02:12:06 +02:00
Rob Larsen
340b012a1f Fetch jQuery from jQuery's CDN instead of Google's
In countries where `googleapis.com` is blocked (e.g.: China),
HTML5 Boilerplate is broken out of the box as jQuery will not load
until the request times out.

This commit changes the default jQuery source to use the jQuery CDN
as it is as fast or faster (by some reckoning) than the Google Hosted
Libraries version and is available worldwide.

While the chance of hitting the cache lottery is smaller with the
jQuery CDN (it's not as ubiquitous as Google), that chance is not enough
to override the need to ship working code for everyone in the world.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Fix h5bp/html5-boilerplate#1737
Close h5bp/html5-boilerplate#1739
2016-01-09 02:05:18 +02:00
Lowell Mower
438b8a7eef Docs: Add links to the Apache docs in misc.md
Fix h5bp/html5-boilerplate#1772
Close h5bp/html5-boilerplate#1774
2016-01-02 13:49:28 +02:00
greenkeeperio-bot
181c98ca75 Update archiver to v0.21.0
Close h5bp/html5-boilerplate#1763
2016-01-02 13:27:19 +02:00
Cătălin Mariș
97b04f4f4e Make build set permissions in archive correctly
Fix h5bp/html5-boilerplate#1730
2015-11-30 22:02:46 +02:00
greenkeeperio-bot
7ac0465aa1 Update archiver to v0.19.0
Close h5bp/html5-boilerplate#1757
Close h5bp/html5-boilerplate#1758
Close h5bp/html5-boilerplate#1759
Close h5bp/html5-boilerplate#1760
2015-11-30 22:02:02 +02:00
Cătălin Mariș
e8b9a8be39 Update gulp-jshint to v2.0.0
Close h5bp/html5-boilerplate#1756
2015-11-23 19:20:33 +02:00
greenkeeperio-bot
3b215df3ec Update glob to v6.0.1
Close h5bp/html5-boilerplate#1753
2015-11-11 23:04:26 +02:00
greenkeeperio-bot
7df016247c Update gulp-load-plugins to version 1.1.0
Close h5bp/html5-boilerplate#1751
2015-11-08 10:43:01 +02:00
greenkeeperio-bot
fa840f07ef Update devDependencies
Close h5bp/html5-boilerplate#1746
2015-10-19 22:13:54 +03:00
H5BP
0c8b71eb88 Update content from the dist directory [skip ci] 2015-10-13 18:11:26 +00:00
Michael Thorne
1cf48987f5 Remove leftover colon from comment from main.css
Ref: https://github.com/h5bp/html5-boilerplate/pull/1734#issuecomment-139189541
2015-10-13 21:02:08 +03:00
Matt Smith
a6a9094eba README.md: Add Edge to Browser support section
Close h5bp/html5-boilerplate#1745
2015-10-13 20:40:14 +03:00
Phillip Alexander
9fb12e846a Update tests to include latest Node v4.x.x release
Ref https://nodejs.org/en/blog/announcements/foundation-v4-announce/
Close h5bp/html5-boilerplate#1733
2015-10-13 20:39:45 +03:00
Cătălin Mariș
50e4ffa3cf Update devDependencies 2015-10-13 20:32:12 +03:00
Cătălin Mariș
8dd98e8fc1 Fetch automation script via npm 2015-10-13 20:07:44 +03:00
Sid Roberts
fc05bc82ab Change print color for ::first-letter and ::first-line pseudo-elements
Pseudo-elements `::first-letter` and `::first-line` now get printed
black by default as `::before` and `::after` are.

All pseudo-elements:
https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-elements

Closes #1715.
2015-07-19 17:09:41 +02:00
65 changed files with 2485 additions and 2306 deletions

View File

@@ -1,13 +1,13 @@
# 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

26
.eslintrc.js Normal file
View File

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

9
.gitattributes vendored
View File

@@ -1,11 +1,15 @@
# Automatically normalize line endings for all text-based files
# http://git-scm.com/docs/gitattributes#_end_of_line_conversion
# https://git-scm.com/docs/gitattributes#_end_of_line_conversion
* text=auto
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# For the following file types, normalize line endings to LF on
# checkin and prevent conversion to CRLF when they are checked out
# (this is required in order to prevent newline related issues like,
# for example, after the build script is run)
.* text eol=lf
*.css text eol=lf
*.html text eol=lf
@@ -16,6 +20,9 @@
*.txt text eol=lf
*.xml text eol=lf
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Exclude the `.htaccess` file from GitHub's language statistics
# https://github.com/github/linguist#using-gitattributes
dist/.htaccess linguist-vendored

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

@@ -1,7 +1,8 @@
# Contributing to HTML5 Boilerplate
♥ [HTML5 Boilerplate](https://html5boilerplate.com) and want to get involved?
Thanks! There are plenty of ways you can help!
♥ [HTML5 Boilerplate](https://html5boilerplate.com/) and want to get involved?
Thanks! We're actively looking for folks interested in helping out and there
are plenty of ways you can help!
Please take a moment to review this document in order to make the contribution
process easy and effective for everyone involved.
@@ -129,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.

74
.github/ISSUE_TEMPLATE.md vendored Normal file
View File

@@ -0,0 +1,74 @@
**I'm submitting a ...**
<!-- (check one with "x") -->
- [ ] bug report
- [ ] feature request
- [ ] other (Please do not submit support requests here (below))
## Notes:
* Please **do not** use the issue tracker for personal support requests (use
[Stack Overflow](https://stackoverflow.com/questions/tagged/html5boilerplate)).
* Please **do not** derail or troll issues. Keep the discussion on topic and
respect the opinions of others.
* Please **do not** open issues or pull requests regarding the code in
[`.htaccess`](https://github.com/h5bp/server-configs-apache),
[`jQuery`](https://github.com/jquery/jquery/),
[`Modernizr`](https://github.com/Modernizr/Modernizr) or
[`Normalize.css`](https://github.com/necolas/normalize.css) (open them in
their respective repositories).
## Bug reports
A bug is a _demonstrable problem_ that is caused by the code in the repository.
Good bug reports are extremely helpful - thank you!
Guidelines for bug reports:
1. **Use the GitHub issue search** &mdash; check if the issue has already been
reported.
We have a long history of sometimes _very_ detailed discussion of every line of code
in the project. We want discussion, so it might still warrant an issue. It
just helps to get the (sometimes extensive) context.
2. **Check if the issue has been fixed** &mdash; try to reproduce it using the
latest `master` or development branch in the repository.
3. **Isolate the problem** &mdash; ideally create a [reduced test
case](https://css-tricks.com/reduced-test-cases/) and a live example.
A good bug report shouldn't leave others needing to chase you up for more
information. Please try to be as detailed as possible in your report. What is
your environment? What steps will reproduce the issue? What browser(s) and OS
experience the problem? What would you expect to be the outcome? All these
details will help people to fix any potential bugs.
Example:
> Short and descriptive example bug report title
>
> A summary of the issue and the browser/OS environment in which it occurs. If
> suitable, include the steps required to reproduce the bug.
>
> 1. This is the first step
> 2. This is the second step
> 3. Further steps, etc.
>
> `<url>` - a link to the reduced test case
>
> Any other information you want to share that is relevant to the issue being
> reported. This might include the lines of code that you have identified as
> causing the bug, and potential solutions (and your opinions on their
> merits).
## Feature requests
Feature requests are welcome. But take a moment to find out whether your idea
fits with the scope and aims of the project. It's up to *you* to make a strong
case to convince the project's developers of the merits of this feature. Please
provide as much detail and context as possible.

19
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

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

10
.github/SUPPORT.md vendored Normal file
View File

@@ -0,0 +1,10 @@
# Support
For personal support requests with HTML5 Boilerplate please use Stack Overflow
([`html5boilerplate`](https://stackoverflow.com/questions/tagged/html5boilerplate) tag).
Please check the respective repository/website for support regarding the code in
[`.htaccess`](https://github.com/h5bp/server-configs-apache),
[`jQuery`](https://jquery.org/support/),
[`Modernizr`](https://modernizr.com/) or
[`Normalize.css`](https://github.com/necolas/normalize.css).

1
.gitignore vendored
View File

@@ -1,2 +1,3 @@
archive
node_modules
package-lock.json

View File

@@ -1,32 +0,0 @@
{
// Enforcing options
// http://www.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://www.jshint.com/docs/options/#relaxing-options
"esnext": true,
// - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Environments
// http://www.jshint.com/docs/options/#environments
"browser": true,
"jquery": true,
"node": true
}

View File

@@ -1,71 +1,6 @@
# For more information about the configurations used
# in this file, please see the Travis CI documentation:
# http://docs.travis-ci.com
after_success:
# Temporary workaround for:
# https://github.com/travis-ci/travis-ci/issues/929
- python travis_after_all.py
- export $(cat .to_export_back) &> /dev/null
- |
# If all the tests pass in all the runtimes, make Travis
# automatically download and execute the following script
if [ "$BUILD_LEADER" == "YES" ]; then
if [ "$BUILD_AGGREGATE_STATUS" == "others_succeeded" ]; then \
# Clean up helper files
rm -rf travis_after_all.py .to_export_back && \
# The `commit_build_changes.sh` script will run the build,
# and if that generates changes, it will commit them to the
# `master` branch:
#
# * ensuring that the content from the `dist/` directory
# is always in sync with the rest of the content
#
# * removing the need to execute the build step locally
# everytime a change is made (especially in the case
# of trivial changes such as typos)
#
# Note: The `commit_build_changes.sh` script will only run
# if the commit was made to the `master` branch.
curl -sSL "https://raw.githubusercontent.com/h5bp-bot/scripts/0.6.1/commit_build_changes.sh" |
bash -s -- --branch "master" \
--commands "npm install && npm run build" \
--commit-message "Update content from the \`dist\` directory [skip ci]";
fi
fi
env:
global:
# The `secure` key contains three encrypted environment variables
# (GH_TOKEN, GH_USER_EMAIL and GH_USER_NAME), the values of which
# are used by the scripts that are automatically executed by Travis.
#
# Note: The `secure` key will only work for this repository, so if
# you create your own fork, you will need to generate your own key:
#
# travis encrypt -r "<username>/<repository>" \
# GH_TOKEN="<your_github_access_token>" \
# GH_USER_EMAIL="<your_email>" \
# GH_USER_NAME="<your_name>"
#
# To learn more about how to generate the:
#
# * `secure` key, see:
# http://docs.travis-ci.com/user/encryption-keys/
#
# * GitHub access token, see:
# https://help.github.com/articles/creating-an-access-token-for-command-line-use/
- secure: "OQnRHkXKdvSujTPm0DSXJFrso0zKltkso0e8zF/2GLI7ouv60ELHhYCrWFuoeefSJFbiPeH/9GXnTAv7y+gC08Ba/DSlXGaHl4db5xU/7AazzQR4YaTks6z0CfvlftdlimGOY27tuDU8hMfqHJKybJGcEvFKCVJms/7udYYh+CA="
# https://docs.travis-ci.com
git:
depth: 10
@@ -73,10 +8,9 @@ git:
language: node_js
node_js:
- "iojs"
- "0.12"
script:
- curl -sSLo travis_after_all.py https://raw.github.com/dmakhno/travis_after_all/master/travis_after_all.py
- 6
- 8
- 9
dist: trusty
sudo: false

Binary file not shown.

View File

@@ -1,3 +1,81 @@
### 7.0.0 (February 8, 2018)
* 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))
* Adds web app manifest file ([#1963](https://github.com/h5bp/html5-boilerplate/pull/1963))
* Update to jQuery 3.2.1 ([#1942](https://github.com/h5bp/html5-boilerplate/pull/1942))
* Improve ::selection documentation which became confusing after c7057be ([#1955](https://github.com/h5bp/html5-boilerplate/pull/1955))
* refactor(html): update browsehappy to https instead of http ([#1952](https://github.com/h5bp/html5-boilerplate/pull/1952))
* Fix links to CONTRIBUTING.md ([#1951](https://github.com/h5bp/html5-boilerplate/pull/1951))
* Adds .github folder and contents Fixes ([#1948](https://github.com/h5bp/html5-boilerplate/pull/1948))
* 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))
* 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))
* 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
([#1747](https://github.com/h5bp/html5-boilerplate/issues/1747)).
* Removed IE8 Support (upgrades jQuery and normalize.css to latest)
([#1524](https://github.com/h5bp/html5-boilerplate/issues/1524)).
* Fix print styles for Internet Explorer 11
([#1799](https://github.com/h5bp/html5-boilerplate/issues/1799)).
* Update doc links to https
([#1889](https://github.com/h5bp/html5-boilerplate/issues/1889)).
* Delete crossdomain.xml
([#1881](https://github.com/h5bp/html5-boilerplate/issues/1881)).
* Adds pre-wrap to PRE
([#1742](https://github.com/h5bp/html5-boilerplate/issues/1742)).
* Change license format to SPDX format
([#1814](https://github.com/h5bp/html5-boilerplate/pull/1814)).
* Simplify the Google Analytics snippet using `async` & `defer` ([#1660](https://github.com/h5bp/html5-boilerplate/pull/1660#issuecomment-89285678)).
### 5.3.0 (January 12, 2016)
* 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)).
* Change print color for `:first-letter` and `:first-line`
pseudo-elements
([#1715](https://github.com/h5bp/html5-boilerplate/pull/1715)).
### 5.2.0 (May 1, 2015)
* Update jQuery to `v1.11.3`
@@ -169,7 +247,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).
@@ -230,7 +308,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,4 +1,4 @@
# [HTML5 Boilerplate](https://html5boilerplate.com)
# [HTML5 Boilerplate](https://html5boilerplate.com/)
[![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)
@@ -6,12 +6,12 @@
HTML5 Boilerplate is a professional front-end template for building
fast, robust, and adaptable web apps or sites.
This project is the product of many years of iterative development and
combined community knowledge. It does not impose a specific development
This project is the product of years of iterative development and
community knowledge. It does not impose a specific development
philosophy or framework, so you're free to architect your code in the
way that you want.
* Homepage: [https://html5boilerplate.com](https://html5boilerplate.com)
* Homepage: [https://html5boilerplate.com/](https://html5boilerplate.com/)
* Source: [https://github.com/h5bp/html5-boilerplate](https://github.com/h5bp/html5-boilerplate)
* Twitter: [@h5bp](https://twitter.com/h5bp)
@@ -20,13 +20,14 @@ way that you want.
Choose one of the following options:
1. Download the latest stable release from
[html5boilerplate.com](https://html5boilerplate.com/) or create a
custom build using [Initializr](http://www.initializr.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/).
- Clone the git repo — `git clone
https://github.com/h5bp/html5-boilerplate.git` - and checkout the
[tagged release](https://github.com/h5bp/html5-boilerplate/releases)
you'd like to use.
- Install with [npm](https://www.npmjs.com/): `npm install html5-boilerplate` and pull in what you need from the resulting `node_modules/html5-boilerplate/dist`
- Install with [yarn](https://yarnpkg.com/): `yarn add html5-boilerplate`
## Features
@@ -36,8 +37,8 @@ Choose one of the following options:
* Includes:
* [`Normalize.css`](https://necolas.github.com/normalize.css/)
for CSS normalizations and common bug fixes
* [`jQuery`](https://jquery.com/) via CDN, with a local fallback
* A custom build of [`Modernizr`](http://modernizr.com/) for feature
* [`jQuery`](https://jquery.com/) via CDN with [SRI Hash](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) and a local fallback
* A custom build of [`Modernizr`](https://modernizr.com/) for feature
detection
* [`Apache Server Configs`](https://github.com/h5bp/server-configs-apache)
that, among other, improve the web site's performance and security
@@ -54,37 +55,36 @@ Choose one of the following options:
## Browser support
* Chrome *(latest 2)*
* Edge *(latest 2)*
* Firefox *(latest 2)*
* Internet Explorer 8+
* 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 (IE 6+, Firefox 3.6+, Safari 4+) you
can use [HTML5 Boilerplate v4](https://github.com/h5bp/html5-boilerplate/tree/v4),
but is 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
Take a look at the [documentation table of contents](dist/doc/TOC.md).
This documentation is bundled with the project, which makes it readily
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 make the HTML5 Boilerplate what it is
today. Anyone and everyone is welcome to [contribute](CONTRIBUTING.md),
Hundreds of developers have helped to make the HTML5 Boilerplate. Anyone is welcome to [contribute](.github/CONTRIBUTING.md),
however, if you decide to get involved, please take a moment to review
the [guidelines](CONTRIBUTING.md):
the [guidelines](.github/CONTRIBUTING.md):
* [Bug reports](CONTRIBUTING.md#bugs)
* [Feature requests](CONTRIBUTING.md#features)
* [Pull requests](CONTRIBUTING.md#pull-requests)
* [Bug reports](.github/CONTRIBUTING.md#bugs)
* [Feature requests](.github/CONTRIBUTING.md#features)
* [Pull requests](.github/CONTRIBUTING.md#pull-requests)
## License

2
dist/.editorconfig vendored
View File

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

193
dist/.gitattributes vendored
View File

@@ -1 +1,194 @@
## GITATTRIBUTES FOR WEB PROJECTS
#
# These settings are for any web project.
#
# Details per file setting:
# text These files should be normalized (i.e. convert CRLF to LF).
# binary These files are binary and should be left untouched.
#
# Note that binary is a macro for -text -diff.
######################################################################
## AUTO-DETECT
## Handle line endings automatically for files detected as
## text and leave all files detected as binary untouched.
## This will handle all files NOT defined below.
* text=auto
## SOURCE CODE
*.bat text eol=crlf
*.coffee text
*.css text
*.htm text
*.html text
*.inc text
*.ini text
*.js text
*.json text
*.jsx text
*.less text
*.od text
*.onlydata text
*.php text
*.pl text
*.py text
*.rb text
*.sass text
*.scm text
*.scss text
*.sh text eol=lf
*.sql text
*.styl text
*.tag text
*.ts text
*.tsx text
*.xml text
*.xhtml text
## DOCKER
*.dockerignore text
Dockerfile text
## DOCUMENTATION
*.markdown text
*.md text
*.mdwn text
*.mdown text
*.mkd text
*.mkdn text
*.mdtxt text
*.mdtext text
*.txt text
AUTHORS text
CHANGELOG text
CHANGES text
CONTRIBUTING text
COPYING text
copyright text
*COPYRIGHT* text
INSTALL text
license text
LICENSE text
NEWS text
readme text
*README* text
TODO text
## TEMPLATES
*.dot text
*.ejs text
*.haml text
*.handlebars text
*.hbs text
*.hbt text
*.jade text
*.latte text
*.mustache text
*.njk text
*.phtml text
*.tmpl text
*.tpl 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
## HEROKU
Procfile text
.slugignore text
## GRAPHICS
*.ai binary
*.bmp binary
*.eps binary
*.gif binary
*.ico binary
*.jng binary
*.jp2 binary
*.jpg binary
*.jpeg binary
*.jpx binary
*.jxr binary
*.pdf binary
*.png binary
*.psb binary
*.psd binary
*.svg text
*.svgz binary
*.tif binary
*.tiff binary
*.wbmp binary
*.webp binary
## AUDIO
*.kar binary
*.m4a binary
*.mid binary
*.midi binary
*.mp3 binary
*.ogg binary
*.ra binary
## VIDEO
*.3gpp binary
*.3gp binary
*.as binary
*.asf binary
*.asx binary
*.fla binary
*.flv binary
*.m4v binary
*.mng binary
*.mov binary
*.mp4 binary
*.mpeg binary
*.mpg binary
*.ogv binary
*.swc binary
*.swf binary
*.webm binary
## ARCHIVES
*.7z binary
*.gz binary
*.jar binary
*.rar binary
*.tar binary
*.zip binary
## FONTS
*.ttf binary
*.eot binary
*.otf binary
*.woff binary
*.woff2 binary
## EXECUTABLES
*.exe binary
*.pyc binary

1
dist/.gitignore vendored
View File

@@ -1,2 +1,3 @@
# Include your project-specific ignores in this file
# Read about how to use .gitignore: https://help.github.com/articles/ignoring-files
# Useful .gitignore templates: https://github.com/github/gitignore

457
dist/.htaccess vendored
View File

@@ -1,11 +1,11 @@
# Apache Server Configs v2.14.0 | MIT License
# Apache Server Configs v3.1.0 | 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,23 @@ 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
# the `X-UA-Compatible` response header should be sent 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)$">
<FilesMatch "\.(appcache|atom|bbaw|bmp|br|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|gz|htc|ic[os]|jpe?g|m?js|json(ld)?|m4[av]|manifest|map|markdown|md|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|wasm|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
Header unset X-UA-Compatible
</FilesMatch>
</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 #
# ######################################################################
@@ -177,10 +166,10 @@ Options -MultiViews
# 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 +192,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 +220,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
@@ -264,10 +252,14 @@ AddDefaultCharset utf-8
.bbaw \
.css \
.geojson \
.ics \
.js \
.json \
.jsonld \
.manifest \
.markdown \
.md \
.mjs \
.rdf \
.rss \
.topojson \
@@ -278,7 +270,6 @@ AddDefaultCharset utf-8
.xml
</IfModule>
# ######################################################################
# # REWRITES #
# ######################################################################
@@ -347,60 +338,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,8 +456,9 @@ 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>
@@ -444,10 +466,10 @@ AddDefaultCharset utf-8
# 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
# # the `X-Frame-Options` response header should be sent 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)$">
# <FilesMatch "\.(appcache|atom|bbaw|bmp|br|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|gz|htc|ic[os]|jpe?g|m?js|json(ld)?|m4[av]|manifest|map|markdown|md|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|wasm|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
# Header unset X-Frame-Options
# </FilesMatch>
@@ -468,21 +490,22 @@ AddDefaultCharset utf-8
# That almost certainly won't work as-is for your website!
#
# To make things easier, you can use an online CSP header generator
# such as: http://cspisawesome.com/.
# such as: https://www.cspisawesome.com/.
#
# http://content-security-policy.com/
# http://www.html5rocks.com/en/tutorials/security/content-security-policy/
# http://www.w3.org/TR/CSP11/).
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
# https://www.w3.org/TR/CSP3/
# https://content-security-policy.com/
# https://www.html5rocks.com/en/tutorials/security/content-security-policy/
# <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
# # the `Content-Security-Policy` response header should be sent
# # 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)$">
# <FilesMatch "\.(appcache|atom|bbaw|bmp|br|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|gz|htc|ic[os]|jpe?g|m?js|json(ld)?|m4[av]|manifest|map|markdown|md|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|wasm|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
# Header unset Content-Security-Policy
# </FilesMatch>
@@ -535,7 +558,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 +566,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 +587,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 +633,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,8 +673,9 @@ 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>
@@ -647,15 +684,75 @@ AddDefaultCharset utf-8
# 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
# # the `X-XSS-Protection` response header should be sent 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)$">
# <FilesMatch "\.(appcache|atom|bbaw|bmp|br|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|gz|htc|ic[os]|jpe?g|m?js|json(ld)?|m4[av]|manifest|map|markdown|md|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|wasm|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
# Header unset X-XSS-Protection
# </FilesMatch>
# </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"
# # `mod_headers` cannot match based on the content-type, however,
# # the `Referrer-Policy` response header should be sent
# # only for HTML documents and not for the other resources.
# <FilesMatch "\.(appcache|atom|bbaw|bmp|br|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|gz|htc|ic[os]|jpe?g|m?js|json(ld)?|m4[av]|manifest|map|markdown|md|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|wasm|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
# Header unset Referrer-Policy
# </FilesMatch>
# </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 +763,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
@@ -703,8 +800,7 @@ ServerSignature Off
#
# https://httpd.apache.org/docs/current/mod/core.html#servertokens
#ServerTokens Prod
# ServerTokens Prod
# ######################################################################
# # WEB PERFORMANCE #
@@ -717,7 +813,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 +828,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>
@@ -748,22 +841,28 @@ ServerSignature Off
"application/schema+json" \
"application/vnd.geo+json" \
"application/vnd.ms-fontobject" \
"application/wasm" \
"application/x-font-ttf" \
"application/x-javascript" \
"application/x-web-app-manifest+json" \
"application/xhtml+xml" \
"application/xml" \
"font/collection" \
"font/eot" \
"font/opentype" \
"font/otf" \
"font/ttf" \
"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 +885,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 +894,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 +1017,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 +1038,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 +1050,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>
@@ -865,6 +1084,7 @@ FileETag None
ExpiresByType application/schema+json "access plus 0 seconds"
ExpiresByType application/vnd.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 +1112,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 +1131,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 +1160,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 +1187,7 @@ FileETag None
# specified files.
# <IfModule mod_include.c>
# <FilesMatch "\.combined\.js$">
# Options +Includes
# AddOutputFilterByType INCLUDES application/javascript \
@@ -958,11 +1195,13 @@ FileETag None
# text/javascript
# SetOutputFilter INCLUDES
# </FilesMatch>
# <FilesMatch "\.combined\.css$">
# Options +Includes
# AddOutputFilterByType INCLUDES text/css
# SetOutputFilter INCLUDES
# </FilesMatch>
# </IfModule>
# ----------------------------------------------------------------------
@@ -975,10 +1214,10 @@ 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>

2
dist/404.html vendored
View File

@@ -57,4 +57,4 @@
<p>Sorry, but the page you were trying to view does not exist.</p>
</body>
</html>
<!-- IE needs 512+ bytes: http://blogs.msdn.com/b/ieinternals/archive/2010/08/19/http-error-pages-in-internet-explorer.aspx -->
<!-- IE needs 512+ bytes: https://blogs.msdn.microsoft.com/ieinternals/2010/08/18/friendly-http-error-pages/ -->

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

15
dist/crossdomain.xml vendored
View File

@@ -1,15 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<!-- Read this: https://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html -->
<!-- Most restrictive policy: -->
<site-control permitted-cross-domain-policies="none"/>
<!-- Least restrictive policy: -->
<!--
<site-control permitted-cross-domain-policies="all"/>
<allow-access-from domain="*" to-ports="*" secure="false"/>
<allow-http-request-headers-from domain="*" headers="*" secure="false"/>
-->
</cross-domain-policy>

125
dist/css/main.css vendored
View File

@@ -1,16 +1,18 @@
/*! HTML5 Boilerplate v5.2.0 | MIT License | https://html5boilerplate.com/ */
/*! HTML5 Boilerplate v6.1.0 | MIT License | https://html5boilerplate.com/ */
/* main.css 1.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,
* Kroc Camen, and the H5BP dev community and team.
*/
/* ==========================================================================
Base styles: opinionated defaults
========================================================================== */
html {
html {
color: #222;
font-size: 1em;
line-height: 1.4;
@@ -20,7 +22,9 @@ html {
* Remove text-shadow in selection highlight:
* https://twitter.com/miketaylr/status/12228805301
*
* These selection rule sets have to be separate.
* Vendor-prefixed and regular ::selection selectors cannot be combined:
* https://stackoverflow.com/a/16982510/7133471
*
* Customize the background color to match your design.
*/
@@ -91,7 +95,10 @@ textarea {
padding: 0.2em 0;
}
/* ==========================================================================
/* ==========================================================================
Author's custom styles
========================================================================== */
@@ -110,88 +117,94 @@ textarea {
/* ==========================================================================
/* ==========================================================================
Helper classes
========================================================================== */
/*
* Hide visually and from screen readers:
* Hide visually and from screen readers
*/
.hidden {
display: none !important;
.hidden {
display: none !important;
}
/*
* Hide only visually, but have it available for screen readers:
* http://snook.ca/archives/html_and_css/hiding-content-for-accessibility
*/
* 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);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
border: 0;
clip: rect(0 0 0 0);
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
*/
* 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;
height: auto;
margin: 0;
overflow: visible;
position: static;
width: auto;
clip: auto;
height: auto;
margin: 0;
overflow: visible;
position: static;
width: auto;
white-space: inherit;
}
/*
* 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;
}
/* ==========================================================================
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) {
@media only screen and (min-width: 35em) {
/* Style adjustments for viewports that meet the condition */
}
@@ -202,19 +215,20 @@ textarea {
/* 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 {
@media print {
*,
*:before,
*:after {
background: transparent !important;
color: #000 !important; /* Black prints faster:
http://www.sanbeiji.com/archives/953 */
color: #000 !important; /* Black prints faster */
-webkit-box-shadow: none !important;
box-shadow: none !important;
text-shadow: none !important;
}
@@ -242,6 +256,9 @@ textarea {
content: "";
}
pre {
white-space: pre-wrap !important;
}
pre,
blockquote {
border: 1px solid #999;
@@ -262,10 +279,6 @@ textarea {
page-break-inside: avoid;
}
img {
max-width: 100% !important;
}
p,
h2,
h3 {
@@ -278,3 +291,5 @@ textarea {
page-break-after: avoid;
}
}

491
dist/css/normalize.css vendored
View File

@@ -1,136 +1,40 @@
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
/* Document
========================================================================== */
/**
* 1. Set default font family to sans-serif.
* 2. Prevent iOS and IE text size adjust after device orientation change,
* without disabling user zoom.
* 1. Correct the line height in all browsers.
* 2. Prevent adjustments of font size after orientation changes in iOS.
*/
html {
font-family: sans-serif; /* 1 */
-ms-text-size-adjust: 100%; /* 2 */
line-height: 1.15; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */
}
/* Sections
========================================================================== */
/**
* Remove default margin.
* Remove the margin in all browsers.
*/
body {
margin: 0;
}
/* HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined for any HTML5 element in IE 8/9.
* Correct `block` display not defined for `details` or `summary` in IE 10/11
* and Firefox.
* Correct `block` display not defined for `main` in IE 11.
* Render the `main` element consistently in IE.
*/
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section,
summary {
main {
display: block;
}
/**
* 1. Correct `inline-block` display not defined in IE 8/9.
* 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.
*/
audio,
canvas,
progress,
video {
display: inline-block; /* 1 */
vertical-align: baseline; /* 2 */
}
/**
* Prevent modern browsers from displaying `audio` without controls.
* Remove excess height in iOS 5 devices.
*/
audio:not([controls]) {
display: none;
height: 0;
}
/**
* Address `[hidden]` styling not present in IE 8/9/10.
* Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22.
*/
[hidden],
template {
display: none;
}
/* Links
========================================================================== */
/**
* Remove the gray background color from active links in IE 10.
*/
a {
background-color: transparent;
}
/**
* Improve readability of focused elements when they are also in an
* active/hover state.
*/
a:active,
a:hover {
outline: 0;
}
/* Text-level semantics
========================================================================== */
/**
* Address styling not present in IE 8/9/10/11, Safari, and Chrome.
*/
abbr[title] {
border-bottom: 1px dotted;
}
/**
* Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
*/
b,
strong {
font-weight: bold;
}
/**
* Address styling not present in Safari and Chrome.
*/
dfn {
font-style: italic;
}
/**
* Address variable `h1` font-size and margin within `section` and `article`
* contexts in Firefox 4+, Safari, and Chrome.
* Correct the font size and margin on `h1` elements within `section` and
* `article` contexts in Chrome, Firefox, and Safari.
*/
h1 {
@@ -138,17 +42,75 @@ h1 {
margin: 0.67em 0;
}
/* Grouping content
========================================================================== */
/**
* Address styling not present in IE 8/9.
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
*/
mark {
background: #ff0;
color: #000;
hr {
box-sizing: content-box; /* 1 */
height: 0; /* 1 */
overflow: visible; /* 2 */
}
/**
* Address inconsistent and variable font size in all browsers.
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
pre {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/* Text-level semantics
========================================================================== */
/**
* Remove the gray background on active links in IE 10.
*/
a {
background-color: transparent;
}
/**
* 1. Remove the bottom border in Chrome 57-
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
*/
abbr[title] {
border-bottom: none; /* 1 */
text-decoration: underline; /* 2 */
text-decoration: underline dotted; /* 2 */
}
/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/
b,
strong {
font-weight: bolder;
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
samp {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/**
* Add the correct font size in all browsers.
*/
small {
@@ -156,7 +118,8 @@ small {
}
/**
* Prevent `sub` and `sup` affecting `line-height` in all browsers.
* Prevent `sub` and `sup` elements from affecting the line height in
* all browsers.
*/
sub,
@@ -167,86 +130,31 @@ sup {
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/* Embedded content
========================================================================== */
/**
* Remove border when inside `a` element in IE 8/9/10.
* Remove the border on images inside links in IE 10.
*/
img {
border: 0;
}
/**
* Correct overflow not hidden in IE 9/10/11.
*/
svg:not(:root) {
overflow: hidden;
}
/* Grouping content
========================================================================== */
/**
* Address margin not present in IE 8/9 and Safari.
*/
figure {
margin: 1em 40px;
}
/**
* Address differences between Firefox and other browsers.
*/
hr {
box-sizing: content-box;
height: 0;
}
/**
* Contain overflow in all browsers.
*/
pre {
overflow: auto;
}
/**
* Address odd `em`-unit font size rendering in all browsers.
*/
code,
kbd,
pre,
samp {
font-family: monospace, monospace;
font-size: 1em;
border-style: none;
}
/* Forms
========================================================================== */
/**
* Known limitation: by default, Chrome and Safari on OS X allow very limited
* styling of `select`, unless a `border` property is set.
*/
/**
* 1. Correct color not being inherited.
* Known issue: affects color of disabled elements.
* 2. Correct font properties not being inherited.
* 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
* 1. Change the font styles in all browsers.
* 2. Remove the margin in Firefox and Safari.
*/
button,
@@ -254,143 +162,100 @@ input,
optgroup,
select,
textarea {
color: inherit; /* 1 */
font: inherit; /* 2 */
margin: 0; /* 3 */
font-family: inherit; /* 1 */
font-size: 100%; /* 1 */
line-height: 1.15; /* 1 */
margin: 0; /* 2 */
}
/**
* Address `overflow` set to `hidden` in IE 8/9/10/11.
* Show the overflow in IE.
* 1. Show the overflow in Edge.
*/
button {
button,
input { /* 1 */
overflow: visible;
}
/**
* Address inconsistent `text-transform` inheritance for `button` and `select`.
* All other form control elements do not inherit `text-transform` values.
* Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
* Correct `select` style inheritance in Firefox.
* Remove the inheritance of text transform in Edge, Firefox, and IE.
* 1. Remove the inheritance of text transform in Firefox.
*/
button,
select {
select { /* 1 */
text-transform: none;
}
/**
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
* and `video` controls.
* 2. Correct inability to style clickable `input` types in iOS.
* 3. Improve usability and consistency of cursor style between image-type
* `input` and others.
* Correct the inability to style clickable types in iOS and Safari.
*/
button,
html input[type="button"], /* 1 */
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button; /* 2 */
cursor: pointer; /* 3 */
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}
/**
* Re-set default cursor for disabled elements.
*/
button[disabled],
html input[disabled] {
cursor: default;
}
/**
* Remove inner padding and border in Firefox 4+.
* Remove the inner border and padding in Firefox.
*/
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
border-style: none;
padding: 0;
}
/**
* Address Firefox 4+ setting `line-height` on `input` using `!important` in
* the UA stylesheet.
* Restore the focus styles unset by the previous rule.
*/
input {
line-height: normal;
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
outline: 1px dotted ButtonText;
}
/**
* It's recommended that you don't attempt to style these elements.
* Firefox's implementation doesn't respect box-sizing, padding, or width.
*
* 1. Address box sizing set to `content-box` in IE 8/9/10.
* 2. Remove excess padding in IE 8/9/10.
*/
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* Fix the cursor style for Chrome's increment/decrement buttons. For certain
* `font-size` values of the `input`, it causes the cursor style of the
* decrement button to change from `default` to `text`.
*/
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Address `appearance` set to `searchfield` in Safari and Chrome.
* 2. Address `box-sizing` set to `border-box` in Safari and Chrome.
*/
input[type="search"] {
-webkit-appearance: textfield; /* 1 */
box-sizing: content-box; /* 2 */
}
/**
* Remove inner padding and search cancel button in Safari and Chrome on OS X.
* Safari (but not Chrome) clips the cancel button when the search input has
* padding (and `textfield` appearance).
*/
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* Define consistent border, margin, and padding.
* Correct the padding in Firefox.
*/
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
padding: 0.35em 0.75em 0.625em;
}
/**
* 1. Correct `color` not being inherited in IE 8/9/10/11.
* 2. Remove padding so people aren't caught out if they zero out fieldsets.
* 1. Correct the text wrapping in Edge and IE.
* 2. Correct the color inheritance from `fieldset` elements in IE.
* 3. Remove the padding so developers are not caught out when they zero out
* `fieldset` elements in all browsers.
*/
legend {
border: 0; /* 1 */
padding: 0; /* 2 */
box-sizing: border-box; /* 1 */
color: inherit; /* 2 */
display: table; /* 1 */
max-width: 100%; /* 1 */
padding: 0; /* 3 */
white-space: normal; /* 1 */
}
/**
* Remove default vertical scrollbar in IE 8/9/10/11.
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
*/
progress {
vertical-align: baseline;
}
/**
* Remove the default vertical scrollbar in IE 10+.
*/
textarea {
@@ -398,27 +263,87 @@ textarea {
}
/**
* Don't inherit the `font-weight` (applied by a rule above).
* NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
* 1. Add the correct box sizing in IE 10.
* 2. Remove the padding in IE 10.
*/
optgroup {
font-weight: bold;
[type="checkbox"],
[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/* Tables
/**
* Correct the cursor style of increment and decrement buttons in Chrome.
*/
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Correct the odd appearance in Chrome and Safari.
* 2. Correct the outline style in Safari.
*/
[type="search"] {
-webkit-appearance: textfield; /* 1 */
outline-offset: -2px; /* 2 */
}
/**
* Remove the inner padding in Chrome and Safari on macOS.
*/
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* 1. Correct the inability to style clickable types in iOS and Safari.
* 2. Change font properties to `inherit` in Safari.
*/
::-webkit-file-upload-button {
-webkit-appearance: button; /* 1 */
font: inherit; /* 2 */
}
/* Interactive
========================================================================== */
/*
* Add the correct display in Edge, IE 10+, and Firefox.
*/
details {
display: block;
}
/*
* Add the correct display in all browsers.
*/
summary {
display: list-item;
}
/* Misc
========================================================================== */
/**
* Remove most spacing between table cells.
* Add the correct display in IE 10+.
*/
table {
border-collapse: collapse;
border-spacing: 0;
template {
display: none;
}
td,
th {
padding: 0;
/**
* Add the correct display in IE 10.
*/
[hidden] {
display: none;
}

11
dist/doc/TOC.md vendored
View File

@@ -1,4 +1,4 @@
[HTML5 Boilerplate homepage](https://html5boilerplate.com)
[HTML5 Boilerplate homepage](https://html5boilerplate.com/)
## Getting started
@@ -25,5 +25,10 @@ aspects of your website/web app (e.g.: the performance, security, etc.).
* [Server Configs](https://github.com/h5bp/server-configs) — Fast and
smart configurations for web servers such as Apache and Nginx.
* [Ant Build Script](https://github.com/h5bp/ant-build-script) — Apache
Ant based build script.
* [Apache](https://github.com/h5bp/server-configs-apache)
* [Google App Engine (GAE)](https://github.com/h5bp/server-configs-gae)
* [Internet Information Services (IIS)](https://github.com/h5bp/server-configs-iis)
* [lighttpd](https://github.com/h5bp/server-configs-lighttpd)
* [Nginx](https://github.com/h5bp/server-configs-nginx)
* [Node.js](https://github.com/h5bp/server-configs-node)
* [Front-end Developer Interview Questions](https://github.com/h5bp/Front-end-Developer-Interview-Questions)

118
dist/doc/css.md vendored
View File

@@ -1,4 +1,4 @@
[HTML5 Boilerplate homepage](https://html5boilerplate.com) | [Documentation
[HTML5 Boilerplate homepage](https://html5boilerplate.com/) | [Documentation
table of contents](TOC.md)
# The CSS
@@ -14,7 +14,7 @@ HTML5 Boilerplate's CSS includes:
This starting CSS does not rely on the presence of
[conditional class names](https://www.paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/),
[conditional style sheets](https://css-tricks.com/how-to-create-an-ie-only-stylesheet/),
or [Modernizr](http://modernizr.com/), and it is ready to use no matter what
or [Modernizr](https://modernizr.com/), and it is ready to use no matter what
your development preferences happen to be.
@@ -39,7 +39,7 @@ page](https://necolas.github.com/normalize.css/), as well as this
[blog post](http://nicolasgallagher.com/about-normalize-css/).
## Useful defaults
## main.css
Several base styles are included that build upon `Normalize.css`. These
styles:
@@ -49,114 +49,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://www.webaim.org/techniques/css/invisiblecontent/)
* [Hiding content for
accessibility](http://snook.ca/archives/html_and_css/hiding-content-for-accessibility)
* [HTML5 Boilerplate - Issue #194](https://github.com/h5bp/html5-boilerplate/issues/194/).
#### `.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://www.alistapart.com/articles/responsive-web-design/) approach to
development. But it's worth remembering that there are [no silver
bullets](http://blog.cloudfour.com/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)`).
For more features that can help you in your mobile web development, take a look
into our [Mobile Boilerplate](https://github.com/h5bp/mobile-boilerplate).
## 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.

249
dist/doc/extend.md vendored
View File

@@ -18,27 +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
### Install a Chrome Web Store app
Users can install a Chrome app directly from your website, as long as
the app and site have been associated via Google's Webmaster Tools.
Read more on [Chrome Web Store's Inline Installation
docs](https://developer.chrome.com/webstore/inline_installation).
```html
<link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/APP_ID">
```
### 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">
@@ -119,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
* http://blogs.msdn.com/b/ie/archive/2011/03/17/internet-explorer-9-network-performance-improvements.aspx
* http://dayofjs.com/videos/22158462/web-browsers_alex-russel
* https://blogs.msdn.microsoft.com/ie/2011/03/17/internet-explorer-9-network-performance-improvements/
## Google Universal Analytics
@@ -138,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.
@@ -161,14 +147,14 @@ ga('send', 'pageview');
### Track jQuery AJAX requests in Google Analytics
An article by @JangoSteve explains how to [track jQuery AJAX requests in Google
Analytics](http://www.alfajango.com/blog/track-jquery-ajax-requests-in-google-analytics/).
Analytics](https://www.alfajango.com/blog/track-jquery-ajax-requests-in-google-analytics/).
Add this to `plugins.js`:
```js
/*
* Log all jQuery AJAX requests to Google Analytics
* See: http://www.alfajango.com/blog/track-jquery-ajax-requests-in-google-analytics/
* See: https://www.alfajango.com/blog/track-jquery-ajax-requests-in-google-analytics/
*/
if (typeof ga !== "undefined" && ga !== null) {
$(document).ajaxSend(function(event, xhr, settings){
@@ -228,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](http://blogs.msdn.com/b/ie/archive/2012/01/31/web-sites-and-a-plug-in-free-web.aspx).
### 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
@@ -280,15 +244,15 @@ mouse over your Pinned Site's icon.
If the site should go to a specific URL when it is pinned (such as the
homepage), enter it here. One idea is to send it to a special URL so you can
track the number of pinned users, like so:
`http://www.example.com/index.html?pinned=true`
`https://www.example.com/index.html?pinned=true`
```html
<meta name="msapplication-starturl" content="http://www.example.com/index.html?pinned=true">
<meta name="msapplication-starturl" content="https://www.example.com/index.html?pinned=true">
```
### 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,7 +286,7 @@ need.
Windows 8 adds the ability for you to provide a PNG tile image and specify the
tile's background color. [Full details on the IE
blog](http://blogs.msdn.com/b/ie/archive/2012/06/08/high-quality-visuals-for-pinned-sites-in-windows-8.aspx).
blog](https://blogs.msdn.microsoft.com/ie/2012/06/08/high-quality-visuals-for-pinned-sites-in-windows-8/).
* Create a 144x144 image of your site icon, filling all of the canvas, and
using a transparent background.
@@ -333,21 +297,21 @@ blog](http://blogs.msdn.com/b/ie/archive/2012/06/08/high-quality-visuals-for-pin
### (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](http://blogs.msdn.com/b/ie/archive/2012/04/03/pinned-sites-in-windows-8.aspx)
* [Available badge values](https://msdn.microsoft.com/en-us/library/ie/br212849.aspx)
* [Tutorial on IEBlog with link to badge XML schema](https://blogs.msdn.microsoft.com/ie/2012/04/03/pinned-sites-in-windows-8/)
* [Available badge values](https://docs.microsoft.com/en-us/uwp/schemas/tiles/badgeschema/element-badge)
```html
<meta name="msapplication-badge" value="frequency=NUMBER_IN_MINUTES;polling-uri=http://www.example.com/path/to/file.xml">
<meta name="msapplication-badge" value="frequency=NUMBER_IN_MINUTES;polling-uri=https://www.example.com/path/to/file.xml">
```
### Disable link highlighting upon tap in IE10
Similar to [-webkit-tap-highlight-color](http://davidwalsh.name/mobile-highlight-color)
Similar to [-webkit-tap-highlight-color](https://davidwalsh.name/mobile-highlight-color)
in iOS Safari. Unlike that CSS property, this is an HTML meta element, and its
value is boolean rather than a color. It's all or nothing.
@@ -362,10 +326,17 @@ You can read about this useful element and more techniques in
### Direct search spiders to your sitemap
[Learn how to make a sitemap](http://www.sitemaps.org/protocol.html)
After creating a [sitemap](https://www.sitemaps.org/protocol.html)
```html
<link rel="sitemap" type="application/xml" title="Sitemap" href="/sitemap.xml">
Submit it to search engine tool:
* [Google](https://www.google.com/webmasters/tools/sitemap-list)
* [Bing](https://www.bing.com/toolbox/webmaster)
* [Yandex](https://webmaster.yandex.com/)
* [Baidu](https://zhanzhang.baidu.com/)
OR
Insert the following line anywhere in your robots.txt file, specifying the path to your sitemap:
```
Sitemap: https://example.com/sitemap_location.xml
```
### Hide pages from search engines
@@ -399,30 +370,26 @@ plugin](https://www.google.com/search?ie=UTF-8&q=how+to+make+browser+search+plug
* Use [Microformats](http://microformats.org/wiki/Main_Page) (via
[microdata](http://microformats.org/wiki/microdata)) for optimum search
results
[visibility](http://googlewebmastercentral.blogspot.com/2009/05/introducing-rich-snippets.html).
[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
headers](https://github.com/h5bp/html5-boilerplate/issues/804).
* Screen readers currently have less-than-stellar support for HTML5 but the JS
script [accessifyhtml5.js](https://github.com/yatil/accessifyhtml5.js) can
help increase accessibility by adding ARIA roles to HTML5 elements.
## News Feeds
@@ -439,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">
@@ -455,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/
@@ -468,36 +435,73 @@ 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,
you can validate your markup with the [Facebook Object
Debugger](https://developers.facebook.com/tools/debug/) (needs
registration to Facebook).
```html
<meta property="fb:app_id" content="123456789">
<meta property="og:url" content="https://www.example.com/path/to/page.html">
<meta property="og:type" content="website">
<meta property="og:title" content="">
<meta property="og:image" content="https://www.example.com/path/to/image.jpg">
<meta property="og:description" content="">
<meta property="og:image" content="">
<meta property="og:site_name" content="">
<meta property="article:author" content="">
```
### 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).
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
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@site_account">
<meta name="twitter:creator" content="@individual_account">
<meta name="twitter:url" content="http://www.example.com/path/to/page.html">
<meta name="twitter:url" content="https://www.example.com/path/to/page.html">
<meta name="twitter:title" content="">
<meta name="twitter:description" content="">
<meta name="twitter:image" content="http://www.example.com/path/to/image.jpg">
<meta name="twitter:image" content="https://www.example.com/path/to/image.jpg">
```
### Google+ / Schema.org
Google also provides a snippet specification that serves a similar
purpose to Facebook's Open Graph or Twitter Cards. While it helps you
to control information displayed on Google+, this metadata is a subset
of [schema.org's microdata vocabulary](https://schema.org/), which
covers many other schemas that can describe the content of your pages
to search engines. For this reason, this metadata is more generic for
SEO, notably for Google's search-engine, although this vocabulary is
also used by Microsoft, Pinterest and Yandex.
You can validate your markup with the [Structured Data Testing
Tool](https://developers.google.com/structured-data/testing-tool/).
Also, please note that this markup requires to add attributes to your
top `html` tag.
```html
<html class="no-js" lang="" itemscope itemtype="http://schema.org/Article">
<head>
<link rel="author" href="">
<link rel="publisher" href="">
<meta itemprop="name" content="">
<meta itemprop="description" content="">
<meta itemprop="image" content="">
```
## URLs
@@ -505,23 +509,13 @@ documentation](https://dev.twitter.com/docs/cards).
Signal to search engines and others "Use this URL for this page!" Useful when
parameters after a `#` or `?` is used to control the display state of a page.
`http://www.example.com/cart.html?shopping-cart-open=true` can be indexed as
the cleaner, more accurate `http://www.example.com/cart.html`.
`https://www.example.com/cart.html?shopping-cart-open=true` can be indexed as
the cleaner, more accurate `https://www.example.com/cart.html`.
```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
@@ -533,17 +527,16 @@ This can be done by adding the following annotations in your HTML pages:
* on the desktop page, add the `link rel="alternate"` tag pointing to the
corresponding mobile URL, e.g.:
`<link rel="alternate" media="only screen and (max-width: 640px)" href="http://m.example.com/page.html" >`
`<link rel="alternate" media="only screen and (max-width: 640px)" href="https://m.example.com/page.html" >`
* on the mobile page, add the `link rel="canonical"` tag pointing to the
corresponding desktop URL, e.g.:
`<link rel="canonical" href="http://www.example.com/page.html">`
`<link rel="canonical" href="https://www.example.com/page.html">`
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
@@ -555,7 +548,7 @@ added to the Home Screen on iOS:
provide the default iOS app view. You can control the color scheme of the
default view by adding `apple-mobile-web-app-status-bar-style`.
```html
```html
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
```
@@ -563,7 +556,7 @@ default view by adding `apple-mobile-web-app-status-bar-style`.
* You can use `apple-mobile-web-app-title` to add a specific sites name for the
Home Screen icon. This works since iOS 6.
```html
```html
<meta name="apple-mobile-web-app-title" content="">
```
@@ -574,39 +567,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 `apple-touch-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="apple-touch-icon.png">
<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).
@@ -615,19 +586,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
@@ -647,7 +613,7 @@ Same applies to the touch icons:
### Theme Color
You can add the [`theme-color` meta extension](https://github.com/whatwg/meta-theme-color)
You can add the [`theme-color` meta extension](https://html.spec.whatwg.org/multipage/semantics.html#meta-theme-color)
in the `<head>` of your pages to suggest the color that browsers and
OSes should use if they customize the display of individual pages in
their UIs with varying colors.
@@ -659,5 +625,16 @@ their UIs with varying colors.
The `content` attribute extension can take any valid CSS color.
Currently, the `theme-color` meta extension is supported by [Chrome 39+
for Android Lollipop](http://updates.html5rocks.com/2014/11/Support-for-theme-color-in-Chrome-39-for-Android)
and [Firefox OS 2.1+](https://twitter.com/ahmednefzaoui/status/492344698493997057).
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.

46
dist/doc/faq.md vendored
View File

@@ -1,10 +1,8 @@
[HTML5 Boilerplate homepage](https://html5boilerplate.com) | [Documentation
[HTML5 Boilerplate homepage](https://html5boilerplate.com/) | [Documentation
table of contents](TOC.md)
# Frequently asked questions
* [Why don't you automatically load the latest version of jQuery from the Google
CDN?](#why-dont-you-automatically-load-the-latest-version-of-jquery-from-the-google-cdn)
* [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
@@ -14,48 +12,30 @@ table of contents](TOC.md)
* [Where can I get help with support
questions?](#where-can-i-get-help-with-support-questions)
--
### Why don't you automatically load the latest version of jQuery from the Google CDN?
The [file](https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js) to which
the Google [CDN](https://en.wikipedia.org/wiki/Content_delivery_network) points
to is [no longer updated and will stay locked at version `1.11.1` in order to
prevent inadvertent web
breakage](http://blog.jquery.com/2014/07/03/dont-use-jquery-latest-js/).
In general, version updating should be an intentional decision! You shouldn't
include a URL that will always point to the latest version, as that version:
* may not be compatible with the existing plugins/code on the site
* will have a very short cache time compare to the specific version,
which means that users won't get the benefits of long-term caching
---
### Why is the Google Analytics code at the bottom? Google recommends it be placed in the `<head>`.
The main advantage of placing it in the `<head>` is that you will track the
user's `pageview` even if they leave the page before it has been fully loaded.
However, having the code at the bottom of the page [helps improve
performance](https://stevesouders.com/efws/inline-scripts-bottom.php).
### How can I integrate [Bootstrap](http://getbootstrap.com/) with HTML5 Boilerplate?
One simple way is to use [Initializr](http://www.initializr.com/) and create a
custom build that includes both HTML5 Boilerplate and
[Bootstrap](http://getbootstrap.com/).
Read more 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).
Here's a handy quote from [Mathias Bynens](https://mathiasbynens.be/notes/async-analytics-snippet#comment-50) about our placement choice.
>I should point out that its Google — not me — recommending to place this
script before all other scripts in the document. The only real advantage is to
catch a pageView call if your page fails to load completely (for example, if
the user aborts loading, or quickly closes the page, etc.). Personally, I
wouldnt count that as a page view, so I actually prefer to place this script
at the bottom, after all other scripts. This keeps all the scripts together and
reinforces that scripts at the bottom are the right move. (Usually I
concatenate and minify all my scripts into one .js file — the GA snippet being
the suffix.)
### Do I need to upgrade my site each time a new version of HTML5 Boilerplate is released?
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.
### Where can I get help with support questions?
Please ask for help on

235
dist/doc/html.md vendored
View File

@@ -1,4 +1,4 @@
[HTML5 Boilerplate homepage](https://html5boilerplate.com) | [Documentation
[HTML5 Boilerplate homepage](https://html5boilerplate.com/) | [Documentation
table of contents](TOC.md)
# The HTML
@@ -7,13 +7,13 @@ 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`
### The `no-js` class
### The `no-js` Class
The `no-js` class is provided in order to allow you to more easily and
explicitly add custom styles based on whether JavaScript is disabled
@@ -21,10 +21,10 @@ explicitly add custom styles based on whether JavaScript is disabled
FOUC](https://www.paulirish.com/2009/avoiding-the-fouc-v3/).
## Language attribute
## Language Attribute
Please consider specifying the language of your content by adding the `lang`
attribute to `<html>` as in this example:
Please consider specifying the language of your content by adding a [value](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry) to the `lang`
attribute in the `<html>` as in this example:
```html
<html class="no-js" lang="en">
@@ -32,139 +32,70 @@ attribute to `<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:
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
1) the charset declaration (`<meta charset="utf-8">`):
## Meta Description
* 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:
The `description` meta tag provides a short description of the page.
In some situations this description is used as a part of the snippet
shown in the search results.
```html
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="description" content="This is a description">
```
or sending the page with the following HTTP response header
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.
```
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/en-us/library/ie/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](http://blogs.msdn.com/b/ie/archive/2014/04/02/stay-up-to-date-with-enterprise-mode-for-internet-explorer-11.aspx) throughout your company.
## Mobile viewport
## Mobile Viewport
There are a few different options that you can use with the [`viewport` meta
tag](https://docs.google.com/present/view?id=dkx3qtm_22dxsrgcf4 "Viewport and
Media Queries - The Complete Idiot's Guide"). You can find out more in [the
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">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
```
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
app appears on a device's home screen, what it looks like when it launches
in that context and what happens when it is launched. This allows for much greater
control over the UI of a saved site or web app on a mobile device.
It's linked to from the HTML as follows:
```html
<link rel="manifest" href="site.webmanifest">
```
Our [site.webmanifest](https://github.com/h5bp/html5-boilerplate/blob/master/src/site.webmanifest) contains a very skeletal "app" definition, just to show the basic usage.
You should fill this file out with [more information about your site or application](https://developer.mozilla.org/en-US/docs/Web/Manifest)
## Favicons and Touch Icon
The shortcut icons should be put in the root directory of your site. HTML5
The shortcut icons should be put in the root directory of your site. `favicon.ico`
is automatically picked up by browsers if it's placed in the root. HTML5
Boilerplate comes with a default set of icons (include favicon and one Apple
Touch Icon) that you can use as a baseline to create your own.
Please refer to the more detailed description in the [Extend section](extend.md)
of these docs.
## Modernizr
HTML5 Boilerplate uses a custom build of Modernizr.
[Modernizr](http://modernizr.com) is a JavaScript library which adds classes to
the `html` element based on the results of feature test and which ensures that
all browsers can make use of HTML5 elements (as it includes the HTML5 Shiv).
This allows you to target parts of your CSS and JavaScript based on the
features supported by a browser.
In general, in order to keep page load times to a minimum, it's best to call
any JavaScript at the end of the page because if a script is slow to load
from an external server it may cause the whole page to hang. That said, the
Modernizr script *needs* to run *before* the browser begins rendering the page,
so that browsers lacking support for some of the new HTML5 elements are able to
handle them properly. Therefore the Modernizr script is the only JavaScript
file synchronously loaded at the top of the document.
## What about polyfills?
If you need to include [polyfills](https://remysharp.com/2010/10/08/what-is-a-polyfill)
in your project, you must make sure those load before any other JavaScript. If you're
using some 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="https://cdn.polyfill.io/v1/polyfill.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.2.min.js"><\/script>')</script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
</body>
```
If you like to just include the polyfills yourself, you could include them in
`js/plugins.js`. When you have a bunch of polyfills to load in, you could
also create a `polyfills.js` file in the `js/vendor` directory. Also using
this technique, make sure the polyfills are all loaded before any other
Javascript.
There are some misconceptions about Modernizr and polyfills. It's important
to understand that Modernizr just handles feature checking, not polyfilling
itself. The only thing Modernizr does regarding polyfills is that the team
maintains [a huge list of cross Browser polyfills](https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills).
## The content area
## The Content Area
The central part of the boilerplate template is pretty much empty. This is
intentional, in order to make the boilerplate suitable for both web page and
@@ -173,32 +104,76 @@ 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 6/7. If you intended to support IE 6/7, 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.
### Google CDN for jQuery
## Modernizr
The Google CDN version of the jQuery JavaScript library is referenced towards
the bottom of the page using a protocol-independent path (read more about this
in the [FAQ](faq.md)). A local fallback of jQuery is included for rare instances
HTML5 Boilerplate uses a custom build of Modernizr.
[Modernizr](https://modernizr.com/) is a JavaScript library which adds classes to
the `html` element based on the results of feature test and which ensures that
all browsers can make use of HTML5 elements (as it includes the HTML5 Shiv).
This allows you to target parts of your CSS and JavaScript based on the
features supported by a browser.
Starting with version 3 Modernizr can be customized using the [modernizr-config.json](https://github.com/h5bp/html5-boilerplate/blob/master/modernizr-config.json) and the
[Modernizr command line utility](https://www.npmjs.com/package/modernizr-cli).
## What About Polyfills?
If you need to include [polyfills](https://remysharp.com/2010/10/08/what-is-a-polyfill)
in your project, you must make sure those load before any other JavaScript. If you're
using a polyfill CDN service, like [cdn.polyfill.io](https://cdn.polyfill.io/),
just put it before the other scripts in the bottom of the page:
```html
<script src="js/vendor/modernizr-3.6.0.min.js"></script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-3.3.1.min.js"><\/script>')</script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
</body>
```
If you like to just include the polyfills yourself, you could include them in
`js/plugins.js`. When you have a bunch of polyfills to load in, you could
also create a `polyfills.js` file in the `js/vendor` directory or include the files
individually and combine them using a build tool. Always ensure that the polyfills
are all loaded before any other JavaScript.
There are some misconceptions about Modernizr and polyfills. It's important
to understand that Modernizr just handles feature checking, not polyfilling
itself. The only thing Modernizr does regarding polyfills is that the team
maintains [a huge list of cross Browser polyfills](https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills).
### jQuery CDN for jQuery
The jQuery CDN version of the jQuery JavaScript library is referenced towards
the bottom of the page. A local fallback of jQuery is included for rare instances
when the CDN version might not be available, and to facilitate offline
development.
The Google CDN version is chosen over other [potential candidates (like the
jQuery CDN](https://jquery.com/download/#using-jquery-with-a-cdn)) because
it's fast in absolute terms and it has the best overall
[penetration](http://httparchive.org/trends.php#perGlibs) which increases the
odds of having a copy of the library in your user's browser cache.
The jQuery CDN version was chosen over other potential candidates
([like Google's Hosted Libraries](https://developers.google.com/speed/libraries/))
because it's fast ([comparable or faster than Google by some
measures](https://www.cdnperf.com/#jsdelivr,cdnjs,google,yandex,microsoft,jquery,bootstrapcdn/https/90))
and, (unlike Google's CDN) is available to China's hundreds of millions of internet users.
For many years we [chose](https://github.com/h5bp/html5-boilerplate/issues/1191)
the Google Hosted version over the jQuery CDN because it was available
over HTTPS (the jQuery CDN was not,) and it offered a better chance of
hitting the cache lottery owing to the popularity of the Google CDN.
The first issue is no longer valid and the second is far outweighed by
being able to serve jQuery to Chinese users.
While the Google CDN is a strong default solution your site or application may
While the jQuery CDN is a strong default solution your site or application may
require a different configuration. Testing your site with services like
[WebPageTest](https://www.webpagetest.org/) and browser tools like
[PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights/) or
[YSlow](https://developer.yahoo.com/yslow/) will help you examine the real
[PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights/) will help you examine the real
world performance of your site and can show where you can optimize your specific
site or application.
### Google Universal Analytics Tracking Code
Finally, an optimized version of the Google Universal Analytics tracking code is

13
dist/doc/js.md vendored
View File

@@ -1,4 +1,4 @@
[HTML5 Boilerplate homepage](https://html5boilerplate.com) | [Documentation
[HTML5 Boilerplate homepage](https://html5boilerplate.com/) | [Documentation
table of contents](TOC.md)
# The JavaScript
@@ -8,14 +8,13 @@ Information about the default JavaScript included in the project.
## main.js
This file can be used to contain or reference your site/app JavaScript code.
For larger projects, you can make use of a JavaScript module loader, like
[Require.js](http://requirejs.org/), to load any other scripts you need to
run.
If you're working on something more advanced you might replace this file
entirely. That's cool.
## plugins.js
This file can be used to contain all your plugins, such as jQuery plugins and
other 3rd party scripts.
other 3rd party scripts for a simple site.
One approach is to put jQuery plugins inside of a `(function($){ ...
})(jQuery);` closure to make sure they're in the jQuery namespace safety
@@ -27,11 +26,11 @@ errors in browsers that lack a `console`. The script will make sure that, if
a console method isn't available, that method will have the value of empty
function, thus, preventing the browser from throwing an error.
## vendor
This directory can be used to contain all 3rd party library code.
Minified versions of the latest jQuery and Modernizr libraries are included by
default. You may wish to create your own [custom Modernizr
build](http://www.modernizr.com/download/).
build with the online builder](https://www.modernizr.com/download/) or [command
line tool](https://modernizr.com/docs#command-line-config).

72
dist/doc/misc.md vendored
View File

@@ -1,4 +1,4 @@
[HTML5 Boilerplate homepage](https://html5boilerplate.com) | [Documentation
[HTML5 Boilerplate homepage](https://html5boilerplate.com/) | [Documentation
table of contents](TOC.md)
# Miscellaneous
@@ -6,8 +6,8 @@ table of contents](TOC.md)
* [.gitignore](#gitignore)
* [.editorconfig](#editorconfig)
* [Server Configuration](#server-configuration)
* [crossdomain.xml](#crossdomainxml)
* [robots.txt](#robotstxt)
* [humans.txt](#humanstxt)
* [browserconfig.xml](#browserconfigxml)
--
@@ -31,7 +31,7 @@ globally ignore:
excludesfile = ~/.gitignore
```
* More on global ignores: https://help.github.com/articles/ignoring-files
* More on global ignores: https://help.github.com/articles/ignoring-files/
* Comprehensive set of ignores on GitHub: https://github.com/github/gitignore
@@ -42,32 +42,33 @@ 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
`.editorconfig` file, you will need to [install a
plugin]( http://editorconfig.org/#download).
[properties](https://editorconfig.org/#supported-properties) from the
`.editorconfig` file, you may need to [install a
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
H5BP includes a [`.htaccess`](#htaccess) file for the Apache HTTP server. If you are not using
Apache as your web server, then you are encouraged to download a
[server configuration](https://github.com/h5bp/server-configs) that corresponds
to your web server and environment.
H5BP includes a [`.htaccess`](#htaccess) file for the [Apache HTTP
server](https://httpd.apache.org/docs/). If you are not using Apache
as your web server, then you are encouraged to download a
[server configuration](https://github.com/h5bp/server-configs) that
corresponds to your web server and environment.
A `.htaccess` (hypertext access) file is a
[Apache HTTP server configuration file](https://github.com/h5bp/server-configs-apache).
A `.htaccess` (hypertext access) file is an [Apache HTTP server
configuration file](https://github.com/h5bp/server-configs-apache).
The `.htaccess` file is mostly used for:
* Rewriting URLs
@@ -104,32 +105,15 @@ In the repo the `.htaccess` is used for:
When using `.htaccess` we recommend reading all inline comments (the rules after
a `#`) in the file once. There is a bunch of optional stuff in it.
If you want to know more about the `.htaccess` file check out
https://httpd.apache.org/docs/current/howto/htaccess.html.
If you want to know more about the `.htaccess` file check out the
[Apache HTTP server docs](https://httpd.apache.org/docs/) or more
specifically the [htaccess
section](https://httpd.apache.org/docs/current/howto/htaccess.html).
Notice that the original repo for the `.htaccess` file is [this
one](https://github.com/h5bp/server-configs-apache).
## crossdomain.xml
The _cross-domain policy file_ is an XML document that gives a web client —
such as Adobe Flash Player, Adobe Reader, etc. — permission to handle data
across multiple domains, by:
* granting read access to data
* permitting the client to include custom headers in cross-domain requests
* granting permissions for socket-based connections
__e.g.__ If a client hosts content from a particular source domain and that
content makes requests directed towards a domain other than its own, the remote
domain would need to host a cross-domain policy file in order to grant access
to the source domain and allow the client to continue with the transaction.
For more in-depth information, please see Adobe's [cross-domain policy file
specification](https://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html).
## robots.txt
The `robots.txt` file is used to give instructions to web robots on what can
@@ -156,12 +140,26 @@ For more information about `robots.txt`, please see:
* [robotstxt.org](http://www.robotstxt.org/)
* [How Google handles the `robots.txt` file](https://developers.google.com/webmasters/control-crawl-index/docs/robots_txt)
## 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
The `browserconfig.xml` file is used to customize the tile displayed when users
pin your site to the Windows 8.1 start screen. In there you can define custom
tile colors, custom images or even [live tiles](https://msdn.microsoft.com/en-us/library/ie/dn455106.aspx#CreatingLiveTiles).
tile colors, custom images or even [live tiles](https://msdn.microsoft.com/library/dn455106.aspx#CreatingLiveTiles).
By default, the file points to 2 placeholder tile images:
@@ -172,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/en-us/library/ie/dn320426.aspx).
see [MSDN](https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/dn320426(v=vs.85)).

48
dist/doc/usage.md vendored
View File

@@ -1,18 +1,27 @@
[HTML5 Boilerplate homepage](https://html5boilerplate.com) | [Documentation
[HTML5 Boilerplate homepage](https://html5boilerplate.com/) | [Documentation
table of contents](TOC.md)
# Usage
Once you have cloned or downloaded HTML5 Boilerplate, creating a site or app
usually involves the following:
The most basic usage of HTML5 Boilerplate is to create a static site or simple
app. Once you've downloaded or cloned the project, that process looks something
like this:
1. Set up the basic structure of the site.
2. Add some content, style, and functionality.
3. Run your site locally to see how it looks.
4. (Optionally run a build script to automate the optimization of your site -
e.g. [ant build script](https://github.com/h5bp/ant-build-script))
5. Deploy your site.
4. Deploy your site.
Cool, right? _It is_. That said, the smart defaults, baseline elements, default
attribute values and various other utilities that HTML5 Boilerplate offers can
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 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.
## Basic structure
@@ -34,15 +43,15 @@ A basic HTML5 Boilerplate site initially looks something like this:
├── .editorconfig
├── .htaccess
├── 404.html
├── apple-touch-icon.png
├── browserconfig.xml
├── index.html
├── humans.txt
├── robots.txt
├── crossdomain.xml
├── favicon.ico
├── tile-wide.png
── tile.png
├── humans.txt
── icon.png
├── index.html
├── robots.txt
├── site.webmanifest
├── tile.png
└── tile-wide.png
```
What follows is a general overview of each major part and how to use them.
@@ -80,10 +89,10 @@ A helpful custom 404 to get you started.
### browserconfig.xml
This file contains all settings regarding custom tiles for IE11.
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/en-us/library/ie/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
@@ -112,11 +121,6 @@ technology powering it.
Edit this file to include any pages you need hidden from search engines.
### crossdomain.xml
A template for working with cross-domain requests. [About
crossdomain.xml](misc.md#crossdomainxml).
### Icons
Replace the default `favicon.ico`, `tile.png`, `tile-wide.png` and Apple
@@ -124,7 +128,3 @@ Touch Icon with your own.
If you want to use different Apple Touch Icons for different resolutions please
refer to the [according documentation](extend.md#apple-touch-icons).
You might want to check out Hans' handy [HTML5 Boilerplate Favicon and Apple
Touch Icon
PSD-Template](https://drublic.de/blog/html5-boilerplate-favicons-psd-template/).

BIN
dist/icon.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

65
dist/index.html vendored
View File

@@ -1,40 +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="apple-touch-icon" href="apple-touch-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">
<script src="js/vendor/modernizr-2.8.3.min.js"></script>
</head>
<body>
<!--[if lt IE 8]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</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>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.3.min.js"><\/script>')</script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
<meta name="theme-color" content="#fafafa">
</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]-->
<!-- Add your site or application content here -->
<p>Hello world! This is HTML5 Boilerplate.</p>
<script src="js/vendor/modernizr-3.6.0.min.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-3.3.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('send', 'pageview')
</script>
<script src="https://www.google-analytics.com/analytics.js" async defer></script>
</body>
<!-- Google Analytics: change UA-XXXXX-X to be your site's ID. -->
<script>
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
e.src='https://www.google-analytics.com/analytics.js';
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
ga('create','UA-XXXXX-X','auto');ga('send','pageview');
</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.3.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.6.0.min.js vendored Normal file

File diff suppressed because one or more lines are too long

12
dist/site.webmanifest vendored Normal file
View File

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

194
gulpfile.babel.js Normal file
View File

@@ -0,0 +1,194 @@
import fs from 'fs';
import path from 'path';
import gulp from 'gulp';
// Load all gulp plugins automatically
// and attach them to the `plugins` object
import plugins from 'gulp-load-plugins';
// Temporary solution until gulp 4
// https://github.com/gulpjs/gulp/issues/355
import runSequence from 'run-sequence';
import archiver from 'archiver';
import glob from 'glob';
import del from 'del';
import ssri from 'ssri';
import modernizr from 'modernizr';
import pkg from './package.json';
import modernizrConfig from './modernizr-config.json';
const dirs = pkg['h5bp-configs'].directories;
// ---------------------------------------------------------------------
// | Helper tasks |
// ---------------------------------------------------------------------
gulp.task('archive:create_archive_dir', () => {
fs.mkdirSync(path.resolve(dirs.archive), '0755');
});
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);
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();
});
gulp.task('clean', (done) => {
del([
dirs.archive,
dirs.dist
]).then(() => {
done();
});
});
gulp.task('copy', [
'copy:.htaccess',
'copy:index.html',
'copy:jquery',
'copy:license',
'copy:main.css',
'copy:misc',
'copy:normalize'
]);
gulp.task('copy:.htaccess', () =>
gulp.src('node_modules/apache-server-configs/dist/.htaccess')
.pipe(plugins().replace(/# ErrorDocument/g, 'ErrorDocument'))
.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;
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`;
gulp.src(`node_modules/main.css/dist/main.css`)
.pipe(plugins().header(banner))
.pipe(plugins().autoprefixer({
browsers: ['last 2 versions', 'ie >= 9', '> 1%'],
cascade: false
}))
.pipe(gulp.dest(`${dirs.dist}/css`));
});
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().eslint())
.pipe(plugins().eslint.failOnError())
);
// ---------------------------------------------------------------------
// | 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']);

View File

@@ -1,170 +0,0 @@
var fs = require('fs');
var path = require('path');
var gulp = require('gulp');
// Load all gulp plugins automatically
// and attach them to the `plugins` object
var plugins = require('gulp-load-plugins')();
// Temporary solution until gulp 4
// https://github.com/gulpjs/gulp/issues/355
var runSequence = require('run-sequence');
var pkg = require('./package.json');
var dirs = pkg['h5bp-configs'].directories;
// ---------------------------------------------------------------------
// | Helper tasks |
// ---------------------------------------------------------------------
gulp.task('archive:create_archive_dir', function () {
fs.mkdirSync(path.resolve(dirs.archive), '0755');
});
gulp.task('archive:zip', function (done) {
var archiveName = path.resolve(dirs.archive, pkg.name + '_v' + pkg.version + '.zip');
var archiver = require('archiver')('zip');
var files = require('glob').sync('**/*.*', {
'cwd': dirs.dist,
'dot': true // include hidden files
});
var output = fs.createWriteStream(archiveName);
archiver.on('error', function (error) {
done();
throw error;
});
output.on('close', done);
files.forEach(function (file) {
var filePath = path.resolve(dirs.dist, file);
// `archiver.bulk` does not maintain the file
// permissions, so we need to add files individually
archiver.append(fs.createReadStream(filePath), {
'name': file,
'mode': fs.statSync(filePath)
});
});
archiver.pipe(output);
archiver.finalize();
});
gulp.task('clean', function (done) {
require('del')([
dirs.archive,
dirs.dist
], done);
});
gulp.task('copy', [
'copy:.htaccess',
'copy:index.html',
'copy:jquery',
'copy:license',
'copy:main.css',
'copy:misc',
'copy:normalize'
]);
gulp.task('copy:.htaccess', function () {
return 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', function () {
return gulp.src(dirs.src + '/index.html')
.pipe(plugins.replace(/{{JQUERY_VERSION}}/g, pkg.devDependencies.jquery))
.pipe(gulp.dest(dirs.dist));
});
gulp.task('copy:jquery', function () {
return 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', function () {
return gulp.src('LICENSE.txt')
.pipe(gulp.dest(dirs.dist));
});
gulp.task('copy:main.css', function () {
var banner = '/*! HTML5 Boilerplate v' + pkg.version +
' | ' + pkg.license.type + ' License' +
' | ' + pkg.homepage + ' */\n\n';
return gulp.src(dirs.src + '/css/main.css')
.pipe(plugins.header(banner))
.pipe(plugins.autoprefixer({
browsers: ['last 2 versions', 'ie >= 8', '> 1%'],
cascade: false
}))
.pipe(gulp.dest(dirs.dist + '/css'));
});
gulp.task('copy:misc', function () {
return 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', function () {
return gulp.src('node_modules/normalize.css/normalize.css')
.pipe(gulp.dest(dirs.dist + '/css'));
});
gulp.task('lint:js', function () {
return 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', function (done) {
runSequence(
'build',
'archive:create_archive_dir',
'archive:zip',
done);
});
gulp.task('build', function (done) {
runSequence(
['clean', 'lint:js'],
'copy',
done);
});
gulp.task('default', ['build']);

30
modernizr-config.json Normal file
View File

@@ -0,0 +1,30 @@
{
"minify": true,
"options": [
"domPrefixes",
"prefixes",
"addTest",
"hasEvent",
"mq",
"prefixedCSSValue",
"testAllProps",
"testProp",
"testStyles",
"setClasses"
],
"feature-detects": [
"test/custom-elements",
"test/history",
"test/pointerevents",
"test/postmessage",
"test/webgl",
"test/websockets",
"test/css/animations",
"test/css/columns",
"test/css/flexbox",
"test/elem/picture",
"test/img/sizes",
"test/img/srcset",
"test/workers/webworkers"
]
}

View File

@@ -1,25 +1,40 @@
{
"devDependencies": {
"apache-server-configs": "2.14.0",
"archiver": "^0.14.3",
"del": "^1.1.1",
"glob": "^5.0.5",
"gulp": "^3.8.11",
"gulp-autoprefixer": "^2.1.0",
"gulp-header": "^1.2.2",
"gulp-jscs": "^1.5.1",
"gulp-jshint": "^1.9.2",
"gulp-load-plugins": "^0.10.0",
"gulp-rename": "^1.2.0",
"gulp-replace": "^0.5.3",
"jquery": "1.11.3",
"jshint-stylish": "^1.0.1",
"mocha": "^2.2.4",
"normalize.css": "3.0.3",
"run-sequence": "^1.0.2"
"apache-server-configs": "^3.1.0",
"archiver": "^3.0.0",
"babel-core": "^6.26.3",
"babel-preset-env": "^1.7.0",
"babel-register": "^6.26.0",
"del": "^3.0.0",
"eslint": "^5.13.0",
"eslint-config-recommended": "^4.0.0",
"eslint-plugin-mocha": "^5.2.1",
"glob": "^7.1.3",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^6.0.0",
"gulp-eslint": "^5.0.0",
"gulp-header": "^2.0.7",
"gulp-jscs": "^4.1.0",
"gulp-load-plugins": "^1.5.0",
"gulp-rename": "^1.4.0",
"gulp-replace": "^1.0.0",
"jquery": "3.3.1",
"main.css": "1.0.0",
"mocha": "^5.2.0",
"modernizr": "3.6.0",
"normalize.css": "8.0.1",
"run-sequence": "^2.2.1",
"ssri": "^6.0.1",
"strip-json-comments": "^2.0.1"
},
"engines": {
"node": ">=0.10.0"
"node": ">=6",
"npm": ">=3"
},
"babel": {
"presets": [
"env"
]
},
"h5bp-configs": {
"directories": {
@@ -30,15 +45,24 @@
}
},
"homepage": "https://html5boilerplate.com/",
"license": {
"type": "MIT",
"url": "https://github.com/h5bp/html5-boilerplate/blob/master/LICENSE.txt"
},
"license": "MIT",
"name": "html5-boilerplate",
"private": true,
"scripts": {
"build": "gulp build",
"test": "gulp archive && mocha --reporter spec --timeout 5000"
"test": "gulp archive && mocha --require babel-core/register --reporter spec --timeout 5000"
},
"version": "5.2.0"
"version": "6.1.0",
"description": "A professional front-end template for building fast, robust, and adaptable web apps or sites.",
"files": [
"CHANGELOG.md",
"LICENSE.txt",
"package.json",
"dist/",
"modernizr-config.json",
"README.md"
],
"repository": {
"type": "git",
"url": "https://github.com/h5bp/html5-boilerplate.git"
}
}

View File

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

193
src/.gitattributes vendored
View File

@@ -1 +1,194 @@
## GITATTRIBUTES FOR WEB PROJECTS
#
# These settings are for any web project.
#
# Details per file setting:
# text These files should be normalized (i.e. convert CRLF to LF).
# binary These files are binary and should be left untouched.
#
# Note that binary is a macro for -text -diff.
######################################################################
## AUTO-DETECT
## Handle line endings automatically for files detected as
## text and leave all files detected as binary untouched.
## This will handle all files NOT defined below.
* text=auto
## SOURCE CODE
*.bat text eol=crlf
*.coffee text
*.css text
*.htm text
*.html text
*.inc text
*.ini text
*.js text
*.json text
*.jsx text
*.less text
*.od text
*.onlydata text
*.php text
*.pl text
*.py text
*.rb text
*.sass text
*.scm text
*.scss text
*.sh text eol=lf
*.sql text
*.styl text
*.tag text
*.ts text
*.tsx text
*.xml text
*.xhtml text
## DOCKER
*.dockerignore text
Dockerfile text
## DOCUMENTATION
*.markdown text
*.md text
*.mdwn text
*.mdown text
*.mkd text
*.mkdn text
*.mdtxt text
*.mdtext text
*.txt text
AUTHORS text
CHANGELOG text
CHANGES text
CONTRIBUTING text
COPYING text
copyright text
*COPYRIGHT* text
INSTALL text
license text
LICENSE text
NEWS text
readme text
*README* text
TODO text
## TEMPLATES
*.dot text
*.ejs text
*.haml text
*.handlebars text
*.hbs text
*.hbt text
*.jade text
*.latte text
*.mustache text
*.njk text
*.phtml text
*.tmpl text
*.tpl 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
## HEROKU
Procfile text
.slugignore text
## GRAPHICS
*.ai binary
*.bmp binary
*.eps binary
*.gif binary
*.ico binary
*.jng binary
*.jp2 binary
*.jpg binary
*.jpeg binary
*.jpx binary
*.jxr binary
*.pdf binary
*.png binary
*.psb binary
*.psd binary
*.svg text
*.svgz binary
*.tif binary
*.tiff binary
*.wbmp binary
*.webp binary
## AUDIO
*.kar binary
*.m4a binary
*.mid binary
*.midi binary
*.mp3 binary
*.ogg binary
*.ra binary
## VIDEO
*.3gpp binary
*.3gp binary
*.as binary
*.asf binary
*.asx binary
*.fla binary
*.flv binary
*.m4v binary
*.mng binary
*.mov binary
*.mp4 binary
*.mpeg binary
*.mpg binary
*.ogv binary
*.swc binary
*.swf binary
*.webm binary
## ARCHIVES
*.7z binary
*.gz binary
*.jar binary
*.rar binary
*.tar binary
*.zip binary
## FONTS
*.ttf binary
*.eot binary
*.otf binary
*.woff binary
*.woff2 binary
## EXECUTABLES
*.exe binary
*.pyc binary

1
src/.gitignore vendored
View File

@@ -1,2 +1,3 @@
# Include your project-specific ignores in this file
# Read about how to use .gitignore: https://help.github.com/articles/ignoring-files
# Useful .gitignore templates: https://github.com/github/gitignore

View File

@@ -57,4 +57,4 @@
<p>Sorry, but the page you were trying to view does not exist.</p>
</body>
</html>
<!-- IE needs 512+ bytes: http://blogs.msdn.com/b/ieinternals/archive/2010/08/19/http-error-pages-in-internet-explorer.aspx -->
<!-- IE needs 512+ bytes: https://blogs.msdn.microsoft.com/ieinternals/2010/08/18/friendly-http-error-pages/ -->

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -1,15 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<!-- Read this: https://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html -->
<!-- Most restrictive policy: -->
<site-control permitted-cross-domain-policies="none"/>
<!-- Least restrictive policy: -->
<!--
<site-control permitted-cross-domain-policies="all"/>
<allow-access-from domain="*" to-ports="*" secure="false"/>
<allow-http-request-headers-from domain="*" headers="*" secure="false"/>
-->
</cross-domain-policy>

View File

@@ -1,272 +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
*
* These selection rule sets have to be separate.
* 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:
* http://snook.ca/archives/html_and_css/hiding-content-for-accessibility
*/
.visuallyhidden {
border: 0;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
/*
* 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;
height: auto;
margin: 0;
overflow: visible;
position: static;
width: auto;
}
/*
* 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,
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;
}
img {
max-width: 100% !important;
}
p,
h2,
h3 {
orphans: 3;
widows: 3;
}
h2,
h3 {
page-break-after: avoid;
}
}

View File

@@ -1,4 +1,4 @@
[HTML5 Boilerplate homepage](https://html5boilerplate.com)
[HTML5 Boilerplate homepage](https://html5boilerplate.com/)
## Getting started
@@ -25,5 +25,10 @@ aspects of your website/web app (e.g.: the performance, security, etc.).
* [Server Configs](https://github.com/h5bp/server-configs) — Fast and
smart configurations for web servers such as Apache and Nginx.
* [Ant Build Script](https://github.com/h5bp/ant-build-script) — Apache
Ant based build script.
* [Apache](https://github.com/h5bp/server-configs-apache)
* [Google App Engine (GAE)](https://github.com/h5bp/server-configs-gae)
* [Internet Information Services (IIS)](https://github.com/h5bp/server-configs-iis)
* [lighttpd](https://github.com/h5bp/server-configs-lighttpd)
* [Nginx](https://github.com/h5bp/server-configs-nginx)
* [Node.js](https://github.com/h5bp/server-configs-node)
* [Front-end Developer Interview Questions](https://github.com/h5bp/Front-end-Developer-Interview-Questions)

View File

@@ -1,4 +1,4 @@
[HTML5 Boilerplate homepage](https://html5boilerplate.com) | [Documentation
[HTML5 Boilerplate homepage](https://html5boilerplate.com/) | [Documentation
table of contents](TOC.md)
# The CSS
@@ -14,7 +14,7 @@ HTML5 Boilerplate's CSS includes:
This starting CSS does not rely on the presence of
[conditional class names](https://www.paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/),
[conditional style sheets](https://css-tricks.com/how-to-create-an-ie-only-stylesheet/),
or [Modernizr](http://modernizr.com/), and it is ready to use no matter what
or [Modernizr](https://modernizr.com/), and it is ready to use no matter what
your development preferences happen to be.
@@ -39,7 +39,7 @@ page](https://necolas.github.com/normalize.css/), as well as this
[blog post](http://nicolasgallagher.com/about-normalize-css/).
## Useful defaults
## main.css
Several base styles are included that build upon `Normalize.css`. These
styles:
@@ -49,114 +49,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://www.webaim.org/techniques/css/invisiblecontent/)
* [Hiding content for
accessibility](http://snook.ca/archives/html_and_css/hiding-content-for-accessibility)
* [HTML5 Boilerplate - Issue #194](https://github.com/h5bp/html5-boilerplate/issues/194/).
#### `.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://www.alistapart.com/articles/responsive-web-design/) approach to
development. But it's worth remembering that there are [no silver
bullets](http://blog.cloudfour.com/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)`).
For more features that can help you in your mobile web development, take a look
into our [Mobile Boilerplate](https://github.com/h5bp/mobile-boilerplate).
## 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,27 +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
### Install a Chrome Web Store app
Users can install a Chrome app directly from your website, as long as
the app and site have been associated via Google's Webmaster Tools.
Read more on [Chrome Web Store's Inline Installation
docs](https://developer.chrome.com/webstore/inline_installation).
```html
<link rel="chrome-webstore-item" href="https://chrome.google.com/webstore/detail/APP_ID">
```
### 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">
@@ -119,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
* http://blogs.msdn.com/b/ie/archive/2011/03/17/internet-explorer-9-network-performance-improvements.aspx
* http://dayofjs.com/videos/22158462/web-browsers_alex-russel
* https://blogs.msdn.microsoft.com/ie/2011/03/17/internet-explorer-9-network-performance-improvements/
## Google Universal Analytics
@@ -138,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.
@@ -161,14 +147,14 @@ ga('send', 'pageview');
### Track jQuery AJAX requests in Google Analytics
An article by @JangoSteve explains how to [track jQuery AJAX requests in Google
Analytics](http://www.alfajango.com/blog/track-jquery-ajax-requests-in-google-analytics/).
Analytics](https://www.alfajango.com/blog/track-jquery-ajax-requests-in-google-analytics/).
Add this to `plugins.js`:
```js
/*
* Log all jQuery AJAX requests to Google Analytics
* See: http://www.alfajango.com/blog/track-jquery-ajax-requests-in-google-analytics/
* See: https://www.alfajango.com/blog/track-jquery-ajax-requests-in-google-analytics/
*/
if (typeof ga !== "undefined" && ga !== null) {
$(document).ajaxSend(function(event, xhr, settings){
@@ -228,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](http://blogs.msdn.com/b/ie/archive/2012/01/31/web-sites-and-a-plug-in-free-web.aspx).
### 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
@@ -280,15 +244,15 @@ mouse over your Pinned Site's icon.
If the site should go to a specific URL when it is pinned (such as the
homepage), enter it here. One idea is to send it to a special URL so you can
track the number of pinned users, like so:
`http://www.example.com/index.html?pinned=true`
`https://www.example.com/index.html?pinned=true`
```html
<meta name="msapplication-starturl" content="http://www.example.com/index.html?pinned=true">
<meta name="msapplication-starturl" content="https://www.example.com/index.html?pinned=true">
```
### 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,7 +286,7 @@ need.
Windows 8 adds the ability for you to provide a PNG tile image and specify the
tile's background color. [Full details on the IE
blog](http://blogs.msdn.com/b/ie/archive/2012/06/08/high-quality-visuals-for-pinned-sites-in-windows-8.aspx).
blog](https://blogs.msdn.microsoft.com/ie/2012/06/08/high-quality-visuals-for-pinned-sites-in-windows-8/).
* Create a 144x144 image of your site icon, filling all of the canvas, and
using a transparent background.
@@ -333,21 +297,21 @@ blog](http://blogs.msdn.com/b/ie/archive/2012/06/08/high-quality-visuals-for-pin
### (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](http://blogs.msdn.com/b/ie/archive/2012/04/03/pinned-sites-in-windows-8.aspx)
* [Available badge values](https://msdn.microsoft.com/en-us/library/ie/br212849.aspx)
* [Tutorial on IEBlog with link to badge XML schema](https://blogs.msdn.microsoft.com/ie/2012/04/03/pinned-sites-in-windows-8/)
* [Available badge values](https://docs.microsoft.com/en-us/uwp/schemas/tiles/badgeschema/element-badge)
```html
<meta name="msapplication-badge" value="frequency=NUMBER_IN_MINUTES;polling-uri=http://www.example.com/path/to/file.xml">
<meta name="msapplication-badge" value="frequency=NUMBER_IN_MINUTES;polling-uri=https://www.example.com/path/to/file.xml">
```
### Disable link highlighting upon tap in IE10
Similar to [-webkit-tap-highlight-color](http://davidwalsh.name/mobile-highlight-color)
Similar to [-webkit-tap-highlight-color](https://davidwalsh.name/mobile-highlight-color)
in iOS Safari. Unlike that CSS property, this is an HTML meta element, and its
value is boolean rather than a color. It's all or nothing.
@@ -362,10 +326,17 @@ You can read about this useful element and more techniques in
### Direct search spiders to your sitemap
[Learn how to make a sitemap](http://www.sitemaps.org/protocol.html)
After creating a [sitemap](https://www.sitemaps.org/protocol.html)
```html
<link rel="sitemap" type="application/xml" title="Sitemap" href="/sitemap.xml">
Submit it to search engine tool:
* [Google](https://www.google.com/webmasters/tools/sitemap-list)
* [Bing](https://www.bing.com/toolbox/webmaster)
* [Yandex](https://webmaster.yandex.com/)
* [Baidu](https://zhanzhang.baidu.com/)
OR
Insert the following line anywhere in your robots.txt file, specifying the path to your sitemap:
```
Sitemap: https://example.com/sitemap_location.xml
```
### Hide pages from search engines
@@ -399,30 +370,26 @@ plugin](https://www.google.com/search?ie=UTF-8&q=how+to+make+browser+search+plug
* Use [Microformats](http://microformats.org/wiki/Main_Page) (via
[microdata](http://microformats.org/wiki/microdata)) for optimum search
results
[visibility](http://googlewebmastercentral.blogspot.com/2009/05/introducing-rich-snippets.html).
[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
headers](https://github.com/h5bp/html5-boilerplate/issues/804).
* Screen readers currently have less-than-stellar support for HTML5 but the JS
script [accessifyhtml5.js](https://github.com/yatil/accessifyhtml5.js) can
help increase accessibility by adding ARIA roles to HTML5 elements.
## News Feeds
@@ -439,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">
@@ -455,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/
@@ -468,36 +435,73 @@ 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,
you can validate your markup with the [Facebook Object
Debugger](https://developers.facebook.com/tools/debug/) (needs
registration to Facebook).
```html
<meta property="fb:app_id" content="123456789">
<meta property="og:url" content="https://www.example.com/path/to/page.html">
<meta property="og:type" content="website">
<meta property="og:title" content="">
<meta property="og:image" content="https://www.example.com/path/to/image.jpg">
<meta property="og:description" content="">
<meta property="og:image" content="">
<meta property="og:site_name" content="">
<meta property="article:author" content="">
```
### 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).
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
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@site_account">
<meta name="twitter:creator" content="@individual_account">
<meta name="twitter:url" content="http://www.example.com/path/to/page.html">
<meta name="twitter:url" content="https://www.example.com/path/to/page.html">
<meta name="twitter:title" content="">
<meta name="twitter:description" content="">
<meta name="twitter:image" content="http://www.example.com/path/to/image.jpg">
<meta name="twitter:image" content="https://www.example.com/path/to/image.jpg">
```
### Google+ / Schema.org
Google also provides a snippet specification that serves a similar
purpose to Facebook's Open Graph or Twitter Cards. While it helps you
to control information displayed on Google+, this metadata is a subset
of [schema.org's microdata vocabulary](https://schema.org/), which
covers many other schemas that can describe the content of your pages
to search engines. For this reason, this metadata is more generic for
SEO, notably for Google's search-engine, although this vocabulary is
also used by Microsoft, Pinterest and Yandex.
You can validate your markup with the [Structured Data Testing
Tool](https://developers.google.com/structured-data/testing-tool/).
Also, please note that this markup requires to add attributes to your
top `html` tag.
```html
<html class="no-js" lang="" itemscope itemtype="http://schema.org/Article">
<head>
<link rel="author" href="">
<link rel="publisher" href="">
<meta itemprop="name" content="">
<meta itemprop="description" content="">
<meta itemprop="image" content="">
```
## URLs
@@ -505,23 +509,13 @@ documentation](https://dev.twitter.com/docs/cards).
Signal to search engines and others "Use this URL for this page!" Useful when
parameters after a `#` or `?` is used to control the display state of a page.
`http://www.example.com/cart.html?shopping-cart-open=true` can be indexed as
the cleaner, more accurate `http://www.example.com/cart.html`.
`https://www.example.com/cart.html?shopping-cart-open=true` can be indexed as
the cleaner, more accurate `https://www.example.com/cart.html`.
```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
@@ -533,17 +527,16 @@ This can be done by adding the following annotations in your HTML pages:
* on the desktop page, add the `link rel="alternate"` tag pointing to the
corresponding mobile URL, e.g.:
`<link rel="alternate" media="only screen and (max-width: 640px)" href="http://m.example.com/page.html" >`
`<link rel="alternate" media="only screen and (max-width: 640px)" href="https://m.example.com/page.html" >`
* on the mobile page, add the `link rel="canonical"` tag pointing to the
corresponding desktop URL, e.g.:
`<link rel="canonical" href="http://www.example.com/page.html">`
`<link rel="canonical" href="https://www.example.com/page.html">`
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
@@ -555,7 +548,7 @@ added to the Home Screen on iOS:
provide the default iOS app view. You can control the color scheme of the
default view by adding `apple-mobile-web-app-status-bar-style`.
```html
```html
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
```
@@ -563,7 +556,7 @@ default view by adding `apple-mobile-web-app-status-bar-style`.
* You can use `apple-mobile-web-app-title` to add a specific sites name for the
Home Screen icon. This works since iOS 6.
```html
```html
<meta name="apple-mobile-web-app-title" content="">
```
@@ -574,39 +567,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 `apple-touch-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="apple-touch-icon.png">
<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).
@@ -615,19 +586,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
@@ -647,7 +613,7 @@ Same applies to the touch icons:
### Theme Color
You can add the [`theme-color` meta extension](https://github.com/whatwg/meta-theme-color)
You can add the [`theme-color` meta extension](https://html.spec.whatwg.org/multipage/semantics.html#meta-theme-color)
in the `<head>` of your pages to suggest the color that browsers and
OSes should use if they customize the display of individual pages in
their UIs with varying colors.
@@ -659,5 +625,16 @@ their UIs with varying colors.
The `content` attribute extension can take any valid CSS color.
Currently, the `theme-color` meta extension is supported by [Chrome 39+
for Android Lollipop](http://updates.html5rocks.com/2014/11/Support-for-theme-color-in-Chrome-39-for-Android)
and [Firefox OS 2.1+](https://twitter.com/ahmednefzaoui/status/492344698493997057).
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

@@ -1,10 +1,8 @@
[HTML5 Boilerplate homepage](https://html5boilerplate.com) | [Documentation
[HTML5 Boilerplate homepage](https://html5boilerplate.com/) | [Documentation
table of contents](TOC.md)
# Frequently asked questions
* [Why don't you automatically load the latest version of jQuery from the Google
CDN?](#why-dont-you-automatically-load-the-latest-version-of-jquery-from-the-google-cdn)
* [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
@@ -14,48 +12,30 @@ table of contents](TOC.md)
* [Where can I get help with support
questions?](#where-can-i-get-help-with-support-questions)
--
### Why don't you automatically load the latest version of jQuery from the Google CDN?
The [file](https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js) to which
the Google [CDN](https://en.wikipedia.org/wiki/Content_delivery_network) points
to is [no longer updated and will stay locked at version `1.11.1` in order to
prevent inadvertent web
breakage](http://blog.jquery.com/2014/07/03/dont-use-jquery-latest-js/).
In general, version updating should be an intentional decision! You shouldn't
include a URL that will always point to the latest version, as that version:
* may not be compatible with the existing plugins/code on the site
* will have a very short cache time compare to the specific version,
which means that users won't get the benefits of long-term caching
---
### Why is the Google Analytics code at the bottom? Google recommends it be placed in the `<head>`.
The main advantage of placing it in the `<head>` is that you will track the
user's `pageview` even if they leave the page before it has been fully loaded.
However, having the code at the bottom of the page [helps improve
performance](https://stevesouders.com/efws/inline-scripts-bottom.php).
### How can I integrate [Bootstrap](http://getbootstrap.com/) with HTML5 Boilerplate?
One simple way is to use [Initializr](http://www.initializr.com/) and create a
custom build that includes both HTML5 Boilerplate and
[Bootstrap](http://getbootstrap.com/).
Read more 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).
Here's a handy quote from [Mathias Bynens](https://mathiasbynens.be/notes/async-analytics-snippet#comment-50) about our placement choice.
>I should point out that its Google — not me — recommending to place this
script before all other scripts in the document. The only real advantage is to
catch a pageView call if your page fails to load completely (for example, if
the user aborts loading, or quickly closes the page, etc.). Personally, I
wouldnt count that as a page view, so I actually prefer to place this script
at the bottom, after all other scripts. This keeps all the scripts together and
reinforces that scripts at the bottom are the right move. (Usually I
concatenate and minify all my scripts into one .js file — the GA snippet being
the suffix.)
### Do I need to upgrade my site each time a new version of HTML5 Boilerplate is released?
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.
### Where can I get help with support questions?
Please ask for help on

View File

@@ -1,4 +1,4 @@
[HTML5 Boilerplate homepage](https://html5boilerplate.com) | [Documentation
[HTML5 Boilerplate homepage](https://html5boilerplate.com/) | [Documentation
table of contents](TOC.md)
# The HTML
@@ -7,13 +7,13 @@ 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`
### The `no-js` class
### The `no-js` Class
The `no-js` class is provided in order to allow you to more easily and
explicitly add custom styles based on whether JavaScript is disabled
@@ -21,10 +21,10 @@ explicitly add custom styles based on whether JavaScript is disabled
FOUC](https://www.paulirish.com/2009/avoiding-the-fouc-v3/).
## Language attribute
## Language Attribute
Please consider specifying the language of your content by adding the `lang`
attribute to `<html>` as in this example:
Please consider specifying the language of your content by adding a [value](https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry) to the `lang`
attribute in the `<html>` as in this example:
```html
<html class="no-js" lang="en">
@@ -32,139 +32,70 @@ attribute to `<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:
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
1) the charset declaration (`<meta charset="utf-8">`):
## Meta Description
* 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:
The `description` meta tag provides a short description of the page.
In some situations this description is used as a part of the snippet
shown in the search results.
```html
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="description" content="This is a description">
```
or sending the page with the following HTTP response header
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.
```
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/en-us/library/ie/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](http://blogs.msdn.com/b/ie/archive/2014/04/02/stay-up-to-date-with-enterprise-mode-for-internet-explorer-11.aspx) throughout your company.
## Mobile viewport
## Mobile Viewport
There are a few different options that you can use with the [`viewport` meta
tag](https://docs.google.com/present/view?id=dkx3qtm_22dxsrgcf4 "Viewport and
Media Queries - The Complete Idiot's Guide"). You can find out more in [the
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">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
```
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
app appears on a device's home screen, what it looks like when it launches
in that context and what happens when it is launched. This allows for much greater
control over the UI of a saved site or web app on a mobile device.
It's linked to from the HTML as follows:
```html
<link rel="manifest" href="site.webmanifest">
```
Our [site.webmanifest](https://github.com/h5bp/html5-boilerplate/blob/master/src/site.webmanifest) contains a very skeletal "app" definition, just to show the basic usage.
You should fill this file out with [more information about your site or application](https://developer.mozilla.org/en-US/docs/Web/Manifest)
## Favicons and Touch Icon
The shortcut icons should be put in the root directory of your site. HTML5
The shortcut icons should be put in the root directory of your site. `favicon.ico`
is automatically picked up by browsers if it's placed in the root. HTML5
Boilerplate comes with a default set of icons (include favicon and one Apple
Touch Icon) that you can use as a baseline to create your own.
Please refer to the more detailed description in the [Extend section](extend.md)
of these docs.
## Modernizr
HTML5 Boilerplate uses a custom build of Modernizr.
[Modernizr](http://modernizr.com) is a JavaScript library which adds classes to
the `html` element based on the results of feature test and which ensures that
all browsers can make use of HTML5 elements (as it includes the HTML5 Shiv).
This allows you to target parts of your CSS and JavaScript based on the
features supported by a browser.
In general, in order to keep page load times to a minimum, it's best to call
any JavaScript at the end of the page because if a script is slow to load
from an external server it may cause the whole page to hang. That said, the
Modernizr script *needs* to run *before* the browser begins rendering the page,
so that browsers lacking support for some of the new HTML5 elements are able to
handle them properly. Therefore the Modernizr script is the only JavaScript
file synchronously loaded at the top of the document.
## What about polyfills?
If you need to include [polyfills](https://remysharp.com/2010/10/08/what-is-a-polyfill)
in your project, you must make sure those load before any other JavaScript. If you're
using some 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="https://cdn.polyfill.io/v1/polyfill.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.2.min.js"><\/script>')</script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
</body>
```
If you like to just include the polyfills yourself, you could include them in
`js/plugins.js`. When you have a bunch of polyfills to load in, you could
also create a `polyfills.js` file in the `js/vendor` directory. Also using
this technique, make sure the polyfills are all loaded before any other
Javascript.
There are some misconceptions about Modernizr and polyfills. It's important
to understand that Modernizr just handles feature checking, not polyfilling
itself. The only thing Modernizr does regarding polyfills is that the team
maintains [a huge list of cross Browser polyfills](https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills).
## The content area
## The Content Area
The central part of the boilerplate template is pretty much empty. This is
intentional, in order to make the boilerplate suitable for both web page and
@@ -173,32 +104,76 @@ 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 6/7. If you intended to support IE 6/7, 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.
### Google CDN for jQuery
## Modernizr
The Google CDN version of the jQuery JavaScript library is referenced towards
the bottom of the page using a protocol-independent path (read more about this
in the [FAQ](faq.md)). A local fallback of jQuery is included for rare instances
HTML5 Boilerplate uses a custom build of Modernizr.
[Modernizr](https://modernizr.com/) is a JavaScript library which adds classes to
the `html` element based on the results of feature test and which ensures that
all browsers can make use of HTML5 elements (as it includes the HTML5 Shiv).
This allows you to target parts of your CSS and JavaScript based on the
features supported by a browser.
Starting with version 3 Modernizr can be customized using the [modernizr-config.json](https://github.com/h5bp/html5-boilerplate/blob/master/modernizr-config.json) and the
[Modernizr command line utility](https://www.npmjs.com/package/modernizr-cli).
## What About Polyfills?
If you need to include [polyfills](https://remysharp.com/2010/10/08/what-is-a-polyfill)
in your project, you must make sure those load before any other JavaScript. If you're
using a polyfill CDN service, like [cdn.polyfill.io](https://cdn.polyfill.io/),
just put it before the other scripts in the bottom of the page:
```html
<script src="js/vendor/modernizr-3.6.0.min.js"></script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-3.3.1.min.js"><\/script>')</script>
<script src="js/plugins.js"></script>
<script src="js/main.js"></script>
</body>
```
If you like to just include the polyfills yourself, you could include them in
`js/plugins.js`. When you have a bunch of polyfills to load in, you could
also create a `polyfills.js` file in the `js/vendor` directory or include the files
individually and combine them using a build tool. Always ensure that the polyfills
are all loaded before any other JavaScript.
There are some misconceptions about Modernizr and polyfills. It's important
to understand that Modernizr just handles feature checking, not polyfilling
itself. The only thing Modernizr does regarding polyfills is that the team
maintains [a huge list of cross Browser polyfills](https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills).
### jQuery CDN for jQuery
The jQuery CDN version of the jQuery JavaScript library is referenced towards
the bottom of the page. A local fallback of jQuery is included for rare instances
when the CDN version might not be available, and to facilitate offline
development.
The Google CDN version is chosen over other [potential candidates (like the
jQuery CDN](https://jquery.com/download/#using-jquery-with-a-cdn)) because
it's fast in absolute terms and it has the best overall
[penetration](http://httparchive.org/trends.php#perGlibs) which increases the
odds of having a copy of the library in your user's browser cache.
The jQuery CDN version was chosen over other potential candidates
([like Google's Hosted Libraries](https://developers.google.com/speed/libraries/))
because it's fast ([comparable or faster than Google by some
measures](https://www.cdnperf.com/#jsdelivr,cdnjs,google,yandex,microsoft,jquery,bootstrapcdn/https/90))
and, (unlike Google's CDN) is available to China's hundreds of millions of internet users.
For many years we [chose](https://github.com/h5bp/html5-boilerplate/issues/1191)
the Google Hosted version over the jQuery CDN because it was available
over HTTPS (the jQuery CDN was not,) and it offered a better chance of
hitting the cache lottery owing to the popularity of the Google CDN.
The first issue is no longer valid and the second is far outweighed by
being able to serve jQuery to Chinese users.
While the Google CDN is a strong default solution your site or application may
While the jQuery CDN is a strong default solution your site or application may
require a different configuration. Testing your site with services like
[WebPageTest](https://www.webpagetest.org/) and browser tools like
[PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights/) or
[YSlow](https://developer.yahoo.com/yslow/) will help you examine the real
[PageSpeed Insights](https://developers.google.com/speed/pagespeed/insights/) will help you examine the real
world performance of your site and can show where you can optimize your specific
site or application.
### Google Universal Analytics Tracking Code
Finally, an optimized version of the Google Universal Analytics tracking code is

View File

@@ -1,4 +1,4 @@
[HTML5 Boilerplate homepage](https://html5boilerplate.com) | [Documentation
[HTML5 Boilerplate homepage](https://html5boilerplate.com/) | [Documentation
table of contents](TOC.md)
# The JavaScript
@@ -8,14 +8,13 @@ Information about the default JavaScript included in the project.
## main.js
This file can be used to contain or reference your site/app JavaScript code.
For larger projects, you can make use of a JavaScript module loader, like
[Require.js](http://requirejs.org/), to load any other scripts you need to
run.
If you're working on something more advanced you might replace this file
entirely. That's cool.
## plugins.js
This file can be used to contain all your plugins, such as jQuery plugins and
other 3rd party scripts.
other 3rd party scripts for a simple site.
One approach is to put jQuery plugins inside of a `(function($){ ...
})(jQuery);` closure to make sure they're in the jQuery namespace safety
@@ -27,11 +26,11 @@ errors in browsers that lack a `console`. The script will make sure that, if
a console method isn't available, that method will have the value of empty
function, thus, preventing the browser from throwing an error.
## vendor
This directory can be used to contain all 3rd party library code.
Minified versions of the latest jQuery and Modernizr libraries are included by
default. You may wish to create your own [custom Modernizr
build](http://www.modernizr.com/download/).
build with the online builder](https://www.modernizr.com/download/) or [command
line tool](https://modernizr.com/docs#command-line-config).

View File

@@ -1,4 +1,4 @@
[HTML5 Boilerplate homepage](https://html5boilerplate.com) | [Documentation
[HTML5 Boilerplate homepage](https://html5boilerplate.com/) | [Documentation
table of contents](TOC.md)
# Miscellaneous
@@ -6,8 +6,8 @@ table of contents](TOC.md)
* [.gitignore](#gitignore)
* [.editorconfig](#editorconfig)
* [Server Configuration](#server-configuration)
* [crossdomain.xml](#crossdomainxml)
* [robots.txt](#robotstxt)
* [humans.txt](#humanstxt)
* [browserconfig.xml](#browserconfigxml)
--
@@ -31,7 +31,7 @@ globally ignore:
excludesfile = ~/.gitignore
```
* More on global ignores: https://help.github.com/articles/ignoring-files
* More on global ignores: https://help.github.com/articles/ignoring-files/
* Comprehensive set of ignores on GitHub: https://github.com/github/gitignore
@@ -42,32 +42,33 @@ 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
`.editorconfig` file, you will need to [install a
plugin]( http://editorconfig.org/#download).
[properties](https://editorconfig.org/#supported-properties) from the
`.editorconfig` file, you may need to [install a
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
H5BP includes a [`.htaccess`](#htaccess) file for the Apache HTTP server. If you are not using
Apache as your web server, then you are encouraged to download a
[server configuration](https://github.com/h5bp/server-configs) that corresponds
to your web server and environment.
H5BP includes a [`.htaccess`](#htaccess) file for the [Apache HTTP
server](https://httpd.apache.org/docs/). If you are not using Apache
as your web server, then you are encouraged to download a
[server configuration](https://github.com/h5bp/server-configs) that
corresponds to your web server and environment.
A `.htaccess` (hypertext access) file is a
[Apache HTTP server configuration file](https://github.com/h5bp/server-configs-apache).
A `.htaccess` (hypertext access) file is an [Apache HTTP server
configuration file](https://github.com/h5bp/server-configs-apache).
The `.htaccess` file is mostly used for:
* Rewriting URLs
@@ -104,32 +105,15 @@ In the repo the `.htaccess` is used for:
When using `.htaccess` we recommend reading all inline comments (the rules after
a `#`) in the file once. There is a bunch of optional stuff in it.
If you want to know more about the `.htaccess` file check out
https://httpd.apache.org/docs/current/howto/htaccess.html.
If you want to know more about the `.htaccess` file check out the
[Apache HTTP server docs](https://httpd.apache.org/docs/) or more
specifically the [htaccess
section](https://httpd.apache.org/docs/current/howto/htaccess.html).
Notice that the original repo for the `.htaccess` file is [this
one](https://github.com/h5bp/server-configs-apache).
## crossdomain.xml
The _cross-domain policy file_ is an XML document that gives a web client —
such as Adobe Flash Player, Adobe Reader, etc. — permission to handle data
across multiple domains, by:
* granting read access to data
* permitting the client to include custom headers in cross-domain requests
* granting permissions for socket-based connections
__e.g.__ If a client hosts content from a particular source domain and that
content makes requests directed towards a domain other than its own, the remote
domain would need to host a cross-domain policy file in order to grant access
to the source domain and allow the client to continue with the transaction.
For more in-depth information, please see Adobe's [cross-domain policy file
specification](https://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html).
## robots.txt
The `robots.txt` file is used to give instructions to web robots on what can
@@ -156,12 +140,26 @@ For more information about `robots.txt`, please see:
* [robotstxt.org](http://www.robotstxt.org/)
* [How Google handles the `robots.txt` file](https://developers.google.com/webmasters/control-crawl-index/docs/robots_txt)
## 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
The `browserconfig.xml` file is used to customize the tile displayed when users
pin your site to the Windows 8.1 start screen. In there you can define custom
tile colors, custom images or even [live tiles](https://msdn.microsoft.com/en-us/library/ie/dn455106.aspx#CreatingLiveTiles).
tile colors, custom images or even [live tiles](https://msdn.microsoft.com/library/dn455106.aspx#CreatingLiveTiles).
By default, the file points to 2 placeholder tile images:
@@ -172,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/en-us/library/ie/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

@@ -1,18 +1,27 @@
[HTML5 Boilerplate homepage](https://html5boilerplate.com) | [Documentation
[HTML5 Boilerplate homepage](https://html5boilerplate.com/) | [Documentation
table of contents](TOC.md)
# Usage
Once you have cloned or downloaded HTML5 Boilerplate, creating a site or app
usually involves the following:
The most basic usage of HTML5 Boilerplate is to create a static site or simple
app. Once you've downloaded or cloned the project, that process looks something
like this:
1. Set up the basic structure of the site.
2. Add some content, style, and functionality.
3. Run your site locally to see how it looks.
4. (Optionally run a build script to automate the optimization of your site -
e.g. [ant build script](https://github.com/h5bp/ant-build-script))
5. Deploy your site.
4. Deploy your site.
Cool, right? _It is_. That said, the smart defaults, baseline elements, default
attribute values and various other utilities that HTML5 Boilerplate offers can
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 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.
## Basic structure
@@ -34,15 +43,15 @@ A basic HTML5 Boilerplate site initially looks something like this:
├── .editorconfig
├── .htaccess
├── 404.html
├── apple-touch-icon.png
├── browserconfig.xml
├── index.html
├── humans.txt
├── robots.txt
├── crossdomain.xml
├── favicon.ico
├── tile-wide.png
── tile.png
├── humans.txt
── icon.png
├── index.html
├── robots.txt
├── site.webmanifest
├── tile.png
└── tile-wide.png
```
What follows is a general overview of each major part and how to use them.
@@ -80,10 +89,10 @@ A helpful custom 404 to get you started.
### browserconfig.xml
This file contains all settings regarding custom tiles for IE11.
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/en-us/library/ie/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
@@ -112,11 +121,6 @@ technology powering it.
Edit this file to include any pages you need hidden from search engines.
### crossdomain.xml
A template for working with cross-domain requests. [About
crossdomain.xml](misc.md#crossdomainxml).
### Icons
Replace the default `favicon.ico`, `tile.png`, `tile-wide.png` and Apple
@@ -124,7 +128,3 @@ Touch Icon with your own.
If you want to use different Apple Touch Icons for different resolutions please
refer to the [according documentation](extend.md#apple-touch-icons).
You might want to check out Hans' handy [HTML5 Boilerplate Favicon and Apple
Touch Icon
PSD-Template](https://drublic.de/blog/html5-boilerplate-favicons-psd-template/).

BIN
src/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -1,40 +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="apple-touch-icon" href="apple-touch-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">
<script src="js/vendor/modernizr-2.8.3.min.js"></script>
</head>
<body>
<!--[if lt IE 8]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</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>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/{{JQUERY_VERSION}}/jquery.min.js"></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>
<meta name="theme-color" content="#fafafa">
</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]-->
<!-- 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('send', 'pageview')
</script>
<script src="https://www.google-analytics.com/analytics.js" async defer></script>
</body>
<!-- Google Analytics: change UA-XXXXX-X to be your site's ID. -->
<script>
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
e.src='https://www.google-analytics.com/analytics.js';
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
ga('create','UA-XXXXX-X','auto');ga('send','pageview');
</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.

File diff suppressed because one or more lines are too long

12
src/site.webmanifest Normal file
View File

@@ -0,0 +1,12 @@
{
"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,46 +1,45 @@
/* jshint mocha: true */
import assert from 'assert';
import fs from 'fs';
import path from 'path';
var assert = require('assert');
var fs = require('fs');
var path = require('path');
import pkg from './../package.json';
var pkg = require('./../package.json');
var dirs = pkg['h5bp-configs'].directories;
const dirs = pkg['h5bp-configs'].directories;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function checkString(file, string, done) {
var character = '';
var matchFound = false;
var matchedPositions = 0;
var 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();
});
});
}
@@ -48,34 +47,37 @@ function checkString(file, string, done) {
function runTests() {
var dir = dirs.dist;
const dir = dirs.dist;
describe('Test if the files from the "' + dir + '" directory have the expected content', function () {
it('".htaccess" should have the "ErrorDocument..." line uncommented', function (done) {
var 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', function (done) {
var string = 'ajax.googleapis.com/ajax/libs/jquery/' + pkg.devDependencies.jquery + '/jquery.min.js';
checkString(path.resolve(dir, 'index.html'), string, done);
});
it('"index.html" should contain the correct jQuery version in the local URL', function (done) {
var string = 'js/vendor/jquery-' + pkg.devDependencies.jquery + '.min.js';
checkString(path.resolve(dir, 'index.html'), string, done);
});
it('"main.css" should contain a custom banner', function (done) {
var string = '/*! HTML5 Boilerplate v' + pkg.version +
' | ' + pkg.license.type + ' 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,61 +1,62 @@
/* jshint mocha: true */
import assert from 'assert';
import fs from 'fs';
import path from 'path';
import glob from 'glob';
var assert = require('assert');
var fs = require('fs');
var path = require('path');
import pkg from './../package.json';
var pkg = require('./../package.json');
var dirs = pkg['h5bp-configs'].directories;
const dirs = pkg['h5bp-configs'].directories;
var expectedFilesInArchiveDir = [
pkg.name + '_v' + pkg.version + '.zip'
const expectedFilesInArchiveDir = [
`${pkg.name}_v${pkg.version}.zip`
];
var expectedFilesInDistDir = [
const expectedFilesInDistDir = [
'.editorconfig',
'.gitattributes',
'.gitignore',
'.htaccess',
'404.html',
'apple-touch-icon.png',
'browserconfig.xml',
'crossdomain.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',
'img/',
'img/.gitignore',
'icon.png',
'index.html',
'img/',
'img/.gitignore',
'js/',
'js/main.js',
'js/plugins.js',
'js/vendor/',
'js/vendor/jquery-' + pkg.devDependencies.jquery + '.min.js',
'js/vendor/modernizr-2.8.3.min.js',
'index.html',
'LICENSE.txt',
'robots.txt',
'tile-wide.png',
'tile.png'
'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'
];
@@ -63,51 +64,51 @@ var expectedFilesInDistDir = [
function checkFiles(directory, expectedFiles) {
// Get the list of files from the specified directory
var files = require('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(function (file) {
var ok = false;
var 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, function () {
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(function (file) {
return expectedFiles.indexOf(file) === -1;
})).forEach(function (file) {
it('"' + file + '" should NOT be present', function () {
assert(false);
});
});
});
}
@@ -115,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', function () {
describe(dirs.archive, function () {
checkFiles(dirs.archive, expectedFilesInArchiveDir);
});
describe(dirs.dist, function () {
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();