Skip to content

Commit 8ef036a

Browse files
committed
Set "lang" property on html element
1 parent 3cfd919 commit 8ef036a

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

src/html.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import React from 'react';
2+
import PropTypes from 'prop-types';
3+
4+
export default function HTML(props) {
5+
return (
6+
<html {...props.htmlAttributes} lang="en">
7+
<head>
8+
<meta charSet="utf-8" />
9+
<meta httpEquiv="x-ua-compatible" content="ie=edge" />
10+
<meta
11+
name="viewport"
12+
content="width=device-width, initial-scale=1, shrink-to-fit=no"
13+
/>
14+
{props.headComponents}
15+
</head>
16+
<body {...props.bodyAttributes}>
17+
{props.preBodyComponents}
18+
<div
19+
key={`body`}
20+
id="___gatsby"
21+
dangerouslySetInnerHTML={{ __html: props.body }}
22+
/>
23+
{props.postBodyComponents}
24+
</body>
25+
</html>
26+
);
27+
}
28+
29+
HTML.propTypes = {
30+
htmlAttributes: PropTypes.object,
31+
headComponents: PropTypes.array,
32+
bodyAttributes: PropTypes.object,
33+
preBodyComponents: PropTypes.array,
34+
body: PropTypes.string,
35+
postBodyComponents: PropTypes.array,
36+
};

0 commit comments

Comments
 (0)