forked from reactjs/zh-hans.react.dev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhtml.js
42 lines (38 loc) · 1.23 KB
/
html.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import React from 'react';
const JS_NPM_URLS = [
'https://unpkg.com/[email protected]/dist/cdn/docsearch.min.js',
];
export default class HTML extends React.Component {
render() {
return (
<html lang="zh-hans" {...this.props.htmlAttributes}>
<head>
{JS_NPM_URLS.map(url => (
<link key={url} rel="preload" href={url} as="script" />
))}
<meta charSet="utf-8" />
<meta httpEquiv="X-UA-Compatible" content="IE=edge" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
<link rel="icon" href="/favicon.ico" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<link rel="apple-touch-icon" href="/logo-180x180.png" />
<meta name="apple-mobile-web-app-title" content="React" />
{this.props.headComponents}
</head>
<body {...this.props.bodyAttributes}>
<div
id="___gatsby"
dangerouslySetInnerHTML={{__html: this.props.body}}
/>
{this.props.postBodyComponents}
{JS_NPM_URLS.map(url => (
<script key={url} src={url} />
))}
</body>
</html>
);
}
}