eratic / packages / core / src / layouts / Base.astro
179 words
 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
---
/**
 * The page shell every route uses.
 *
 * Deliberately thin: <head>, a skip link, header, the slot, footer. Anything
 * more opinionated belongs in Entry.astro or in the page itself.
 */
import BaseHead from '../components/BaseHead.astro';
import SiteHeader from '../components/SiteHeader.astro';
import SiteFooter from '../components/SiteFooter.astro';
import { IDENTITY, type SiteKey } from '../config.js';

interface Props {
	site: SiteKey;
	title?: string;
	description?: string;
	path?: string;
	image?: string;
	type?: 'website' | 'article';
	publishedTime?: Date;
	modifiedTime?: Date;
	/** `bare` drops the header and footer for full-canvas articles. */
	chrome?: boolean;
	/** Inline custom-property overrides applied to <html>. */
	themeStyle?: string;
}

const { site, chrome = true, themeStyle, ...head } = Astro.props;
---

<!doctype html>
<html lang={IDENTITY.locale} style={themeStyle}>
	<head>
		<BaseHead site={site} {...head} />
	</head>
	<body>
		<a class="skip-link" href="#main">Skip to content</a>

		{chrome && <SiteHeader current={site} />}

		<main id="main" class="canvas">
			<slot />
		</main>

		{chrome && <SiteFooter current={site} />}
	</body>
</html>

<style>
	main {
		/* The footer is pushed to the bottom on short pages without the layout
		   needing to know how tall anything is. */
		flex: 1 0 auto;
		align-content: start;
	}
</style>

static mirror of HEAD · about · clone: git clone https://git.makefuture.ro/eratic.git