This repository has been archived by the owner on Jan 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlayout.js
63 lines (59 loc) · 2.04 KB
/
layout.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import React from 'react';
import { Helmet } from 'react-helmet';
import PropTypes from 'prop-types';
import { StaticQuery, graphql, withPrefix } from 'gatsby';
import 'availity-uikit';
import '../style.scss';
export default function Layout({ pathname, children }) {
return (
<StaticQuery
query={graphql`
{
site {
siteMetadata {
title
description
}
}
}
`}
render={data => {
const { title, description, siteUrl } = data.site.siteMetadata;
return (
<>
<Helmet defaultTitle={title} titleTemplate={`%s - ${title}`}>
<meta name="description" content={description} />
<link rel="icon" href={withPrefix('/favicon.ico')} />
<html lang="en" />
<link rel="canonical" href={`${siteUrl}${pathname}`} />
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css"
/>
<meta name="docsearch:version" content="2.0" />
<meta
name="viewport"
content="width=device-width,initial-scale=1,shrink-to-fit=no,viewport-fit=cover"
/>
<meta property="og:url" content={siteUrl} />
<meta property="og:type" content="website" />
<meta property="og:locale" content="en" />
<meta property="og:site_name" content={title} />
<meta property="og:image:width" content="512" />
<meta property="og:image:height" content="512" />
<meta name="twitter:card" content="summary" />
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css"
/>
</Helmet>
<div className="h-100 d-flex flex-column">{children}</div>
</>
);
}}
/>
);
}
Layout.propTypes = {
children: PropTypes.node.isRequired,
};