Repository navigation
Expand file tree
/
Copy pathMinimalLayout.astro
More file actions
74 lines (65 loc) · 1.75 KB
/
Copy pathMinimalLayout.astro
File metadata and controls
74 lines (65 loc) · 1.75 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
import TailwindIndicator from "~ui/dev/TailwindIndicator.astro"
import { classMerge } from "~ui/utils/classMerge"
import { classArr } from "../utils/classArr"
export interface Props {
lang?: string
title: string
description?: string
meta?: Record<string, string>
class?: string
bodyClass?: string
showTailwindIndicator?: boolean
}
const p = Astro.props
const showTailwindIndicator = p.showTailwindIndicator ?? true
---
<!doctype html>
<html lang={p.lang ?? "en"}>
<head>
<!-- Base -->
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="generator" content={Astro.generator} />
<!-- Site -->
<title>{p.title}</title>
{p.description && <meta name="description" content={p.description} />}
<!-- Icons -->
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
<link rel="icon" sizes="32x32" href="/favicon.ico" />
<link rel="manifest" href="/site.webmanifest" />
<!-- Crawlers -->
<meta name="robots" content="index, follow" />
<meta name="googlebot" content="index, follow" />
{
p.meta && (
<Fragment>
{Object.entries(p.meta).map(([k, v]) => (
<meta property={k} content={v} />
))}
</Fragment>
)
}
<slot name="head" />
</head>
<body
class={classMerge(
"min-h-dvh w-full", // full screen
"font-sans antialiased text-foreground", // text
p.bodyClass,
)}
>
<slot name="navbar" />
<main
id="main"
class={classArr(
"relative min-h-dvh w-full", // full screen
p.class,
)}
>
<slot />
</main>
<slot name="footer" />
{showTailwindIndicator && <TailwindIndicator />}
</body>
</html>