You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.5 KiB
56 lines
1.5 KiB
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* @flow
|
|
*/
|
|
|
|
import React from 'react';
|
|
|
|
const JS_NPM_URLS = [
|
|
'https://unpkg.com/docsearch.js@2.4.1/dist/cdn/docsearch.min.js',
|
|
];
|
|
|
|
type Props = {|
|
|
htmlAttributes: any,
|
|
headComponents: React$Node,
|
|
bodyAttributes: any,
|
|
body: string,
|
|
postBodyComponents: React$Node,
|
|
|};
|
|
|
|
export default class HTML extends React.Component<Props> {
|
|
render() {
|
|
return (
|
|
<html lang="en" {...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>
|
|
);
|
|
}
|
|
}
|
|
|