/
default.tsx
51 lines (45 loc) · 2.16 KB
/
default.tsx
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
import type { Reflection } from "../../../../models";
import { JSX, Raw } from "../../../../utils";
import type { PageEvent } from "../../../events";
import type { DefaultThemeRenderContext } from "../DefaultThemeRenderContext";
export const defaultLayout = (context: DefaultThemeRenderContext, props: PageEvent<Reflection>) => (
<html class="default">
<head>
{context.hook("head.begin")}
<meta charSet="utf-8" />
<meta http-equiv="x-ua-compatible" content="IE=edge" />
<title>
{props.model.name === props.project.name
? props.project.name
: `${props.model.name} | ${props.project.name}`}
</title>
<meta name="description" content={"Documentation for " + props.project.name} />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href={context.relativeURL("assets/style.css")} />
<link rel="stylesheet" href={context.relativeURL("assets/highlight.css")} />
{context.options.getValue("customCss") && (
<link rel="stylesheet" href={context.relativeURL("assets/custom.css")} />
)}
<script async src={context.relativeURL("assets/search.js")} id="search-script"></script>
{context.hook("head.end")}
</head>
<body>
{context.hook("body.begin")}
<script>
<Raw html='document.body.classList.add(localStorage.getItem("tsd-theme") || "os")' />
</script>
{context.header(props)}
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">{props.template(props)}</div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">{context.navigation(props)}</div>
</div>
</div>
{context.footer(props)}
<div class="overlay"></div>
<script src={context.relativeURL("assets/main.js")}></script>
{context.analytics()}
{context.hook("body.end")}
</body>
</html>
);