-
Notifications
You must be signed in to change notification settings - Fork 10.3k
/
basic.js
39 lines (36 loc) · 1.06 KB
/
basic.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
import * as React from "react"
import { Link } from "gatsby"
import { data } from "../../../shared-data/head-function-export"
export default function HeadFunctionExportBasic() {
return (
<>
<h1>I test basic usage for the head function export</h1>
<p>Some other words</p>
<Link data-testid="gatsby-link" to="/head-function-export/page-query">
Navigate to page-query via Gatsby Link
</Link>
</>
)
}
export function Head() {
const { base, title, meta, noscript, style, link, jsonLD } = data.static
return (
<>
<base data-testid="base" href={base} />
<title data-testid="title">{title}</title>
<meta data-testid="meta" name="author" content={meta} />
<noscript data-testid="noscript">{noscript}</noscript>
<style data-testid="style">
{`
h1 {
color: ${style};
}
`}
</style>
<link data-testid="link" href={link} rel="stylesheet" />
<script data-testid="jsonLD" type="application/ld+json">
{jsonLD}
</script>
</>
)
}