forked from denoland/fresh
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_app.tsx
More file actions
53 lines (52 loc) · 1.8 KB
/
_app.tsx
File metadata and controls
53 lines (52 loc) · 1.8 KB
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
import { asset } from "fresh/runtime";
import { define } from "../utils/state.ts";
export default define.page(function App({ Component, state, url }) {
return (
<html lang="en" class="dark" data-theme="dark">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
{state.title ? <title>{state.title}</title> : null}
{state.description
? <meta name="description" content={state.description} />
: null}
{state.title
? <meta property="og:title" content={state.title} />
: null}
{state.description
? <meta property="og:description" content={state.description} />
: null}
<meta property="og:type" content="website" />
<meta property="og:url" content={url.href} />
{state.ogImage
? <meta property="og:image" content={state.ogImage} />
: null}
{state.noIndex ? <meta name="robots" content="noindex" /> : null}
<link
rel="preload"
href={asset("/fonts/FixelVariable.woff2")}
as="font"
type="font/woff2"
crossorigin="anonymous"
/>
<link rel="stylesheet" href={asset("/styles.css")} />
{url.pathname === "/"
? <link rel="stylesheet" href={asset("/prism.css")} />
: null}
{url.pathname.startsWith("/docs/")
? (
<>
<link rel="stylesheet" href={asset("/docsearch.css")} />
<link rel="stylesheet" href={asset("/markdown.css")} />
</>
)
: null}
<script src="/theme.client.js"></script>
<script type="module" src="/theme-toggle.client.js"></script>
</head>
<body>
<Component />
</body>
</html>
);
});