Skip to content

Commit 154197f

Browse files
committed
better checking of head opts in template
related: #25
1 parent 1c158e0 commit 154197f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/templates.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
const createAmpHeader = ({
22
headOverride, style, canonicalUrl, title, extraHeadHTML
3-
}) => headOverride || (
3+
}) => typeof headOverride === 'string' ? headOverride : (
44
`<!doctype html>
55
<html amp>
66
<head>
77
<meta charset="utf-8">
88
<link rel="canonical" href="${canonicalUrl || ""}" >
99
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
1010
<style amp-custom>
11-
${style}
11+
${style || ""}
1212
</style>
1313
<style>body {opacity: 0}</style><noscript><style>body {opacity: 1}</style></noscript>
1414
<script async src="https://cdn.ampproject.org/v0.js"></script>

0 commit comments

Comments
 (0)