Skip to content
Permalink
Newer
Older
100755 173 lines (124 sloc) 6.71 KB
Jan 28, 2020
1
[HTML5 Boilerplate homepage](https://html5boilerplate.com/) | [Documentation
2
table of contents](TOC.md)
3
4
# Miscellaneous
5
6
* [.gitignore](#gitignore)
7
* [.editorconfig](#editorconfig)
8
* [Server Configuration](#server-configuration)
9
* [robots.txt](#robotstxt)
10
* [humans.txt](#humanstxt)
11
* [browserconfig.xml](#browserconfigxml)
12
13
--
14
15
## .gitignore
16
17
HTML5 Boilerplate includes a basic project-level `.gitignore`. This should
18
primarily be used to avoid certain project-level files and directories from
19
being kept under source control. Different development-environments will
20
benefit from different collections of ignores.
21
22
OS-specific and editor-specific files should be ignored using a "global
23
ignore" that applies to all repositories on your system.
24
25
For example, add the following to your `~/.gitconfig`, where the `.gitignore`
26
in your HOME directory contains the files and directories you'd like to
27
globally ignore:
28
29
```gitignore
30
[core]
31
excludesfile = ~/.gitignore
32
```
33
34
* More on global ignores: https://help.github.com/articles/ignoring-files/
35
* Comprehensive set of ignores on GitHub: https://github.com/github/gitignore
36
37
38
## .editorconfig
39
40
The `.editorconfig` file is provided in order to encourage and help you and
41
your team define and maintain consistent coding styles between different
42
editors and IDEs.
43
44
By default, `.editorconfig` includes some basic
45
[properties](https://editorconfig.org/#supported-properties) that reflect the
46
coding styles from the files provided by default, but you can easily change
47
them to better suit your needs.
48
49
In order for your editor/IDE to apply the
50
[properties](https://editorconfig.org/#supported-properties) from the
51
`.editorconfig` file, you may need to [install a
52
plugin]( https://editorconfig.org/#download).
53
54
__N.B.__ If you aren't using the server configurations provided by HTML5
55
Boilerplate, we highly encourage you to configure your server to block
56
access to `.editorconfig` files, as they can disclose sensitive information!
57
58
For more details, please refer to the [EditorConfig
59
project](https://editorconfig.org/).
60
61
62
## Server Configuration
63
64
H5BP includes a [`.htaccess`](#htaccess) file for the [Apache HTTP
65
server](https://httpd.apache.org/docs/). If you are not using Apache
66
as your web server, then you are encouraged to download a
67
[server configuration](https://github.com/h5bp/server-configs) that
68
corresponds to your web server and environment.
69
70
A `.htaccess` (hypertext access) file is an [Apache HTTP server
71
configuration file](https://github.com/h5bp/server-configs-apache).
72
The `.htaccess` file is mostly used for:
73
74
* Rewriting URLs
75
* Controlling cache
76
* Authentication
77
* Server-side includes
78
* Redirects
79
* Gzipping
80
81
If you have access to the main server configuration file (usually called
82
`httpd.conf`), you should add the logic from the `.htaccess` file in, for
83
example, a <Directory> section in the main configuration file. This is usually
84
the recommended way, as using .htaccess files slows down Apache!
85
86
To enable Apache modules locally, please see:
87
https://github.com/h5bp/server-configs-apache#enable-apache-httpd-modules.
88
89
In the repo the `.htaccess` is used for:
90
91
* Allowing cross-origin access to web fonts
92
* CORS header for images when browsers request it
93
* Enable `404.html` as 404 error document
94
* Making the website experience better for IE users better
95
* Media UTF-8 as character encoding for `text/html` and `text/plain`
96
* Enabling the rewrite URLs engine
97
* Forcing or removing the `www.` at the begin of a URL
98
* It blocks access to directories without a default document
99
* It blocks access to files that can expose sensitive information.
100
* It reduces MIME type security risks
101
* It forces compressing (gzipping)
102
* It tells the browser whether they should request a specific file from the
103
server or whether they should grab it from the browser's cache
104
105
When using `.htaccess` we recommend reading all inline comments (the rules after
106
a `#`) in the file once. There is a bunch of optional stuff in it.
107
108
If you want to know more about the `.htaccess` file check out the
109
[Apache HTTP server docs](https://httpd.apache.org/docs/) or more
110
specifically the [htaccess
111
section](https://httpd.apache.org/docs/current/howto/htaccess.html).
112
113
Notice that the original repo for the `.htaccess` file is [this
114
one](https://github.com/h5bp/server-configs-apache).
115
116
117
## robots.txt
118
119
The `robots.txt` file is used to give instructions to web robots on what can
120
be crawled from the website.
121
122
By default, the file provided by this project includes the next two lines:
123
124
* `User-agent: *` - the following rules apply to all web robots
125
* `Disallow:` - everything on the website is allowed to be crawled
126
127
If you want to disallow certain pages you will need to specify the path in a
128
`Disallow` directive (e.g.: `Disallow: /path`) or, if you want to disallow
129
crawling of all content, use `Disallow: /`.
130
131
The `/robots.txt` file is not intended for access control, so don't try to
132
use it as such. Think of it as a "No Entry" sign, rather than a locked door.
133
URLs disallowed by the `robots.txt` file might still be indexed without being
134
crawled, and the content from within the `robots.txt` file can be viewed by
135
anyone, potentially disclosing the location of your private content! So, if
136
you want to block access to private content, use proper authentication instead.
137
138
For more information about `robots.txt`, please see:
139
140
* [robotstxt.org](https://www.robotstxt.org/)
141
* [How Google handles the `robots.txt` file](https://developers.google.com/webmasters/control-crawl-index/docs/robots_txt)
142
143
## humans.txt
144
145
The `humans.txt` file is used to provide information about people involved with
146
the website.
147
148
The provided file contains three sections:
149
150
* `TEAM` - this is intended to list the group of people responsible for the website
151
* `THANKS` - this is intended to list the group of people that have contributed
152
to the website
153
* `TECHNOLOGY COLOPHON` - the section lists technologies used to make the website
154
155
For more information about `humans.txt`, please see: http://humanstxt.org/
156
157
158
## browserconfig.xml
159
160
The `browserconfig.xml` file is used to customize the tile displayed when users
161
pin your site to the Windows 8.1 start screen. In there you can define custom
162
tile colors, custom images or even [live tiles](https://msdn.microsoft.com/library/dn455106.aspx#CreatingLiveTiles).
163
164
By default, the file points to 2 placeholder tile images:
165
166
* `tile.png` (558x558px): used for `Small`, `Medium` and `Large` tiles.
167
This image resizes automatically when necessary.
168
* `tile-wide.png` (558x270px): user for `Wide` tiles.
169
170
Notice that IE11 uses the same images when adding a site to the `favorites`.
171
172
For more in-depth information about the `browserconfig.xml` file, please
173
see [MSDN](https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/dn320426(v=vs.85)).
You can’t perform that action at this time.