-
Notifications
You must be signed in to change notification settings - Fork 1
/
compile-all-posts-page.jsx
45 lines (40 loc) · 1.99 KB
/
compile-all-posts-page.jsx
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
import { Page } from '@nakedjsx/core/page';
import posts from './generated-post-imports.mjs'
import { Link } from "../components/Link.jsx"
import { Future } from "../components/Future.jsx"
import { LogoSVG, LogoSVGSymbol } from "../components/LogoSVGSymbol.jsx"
for (const [{ inputFileName, outputFileName }, Post] of posts) {
Page.Create('en');
Page.AppendHead(<title>Reed's Website</title>)
Page.AppendHead(<meta name="viewport" content="width=device-width, initial-scale=1" />)
Page.AppendHead(<link rel="preconnect" href="https://fonts.googleapis.com" />)
Page.AppendHead(<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />)
Page.AppendHead(<link href="https://fonts.googleapis.com/css2?family=Jost&family=Karla&display=swap" rel="stylesheet" />)
Page.AppendHead(<link rel="stylesheet" href="./build.css" />)
Page.AppendBody(
<>
<LogoSVGSymbol />
{/*
Wrap the header and the header AND main content in a growing
container so that A) the sticky header never scrolls off the
page (See https://stackoverflow.com/a/47352847) and B) the footer
always remains squarely on the bottom of the page whether the
content is shorter than the screen size or way longer. Depends on
html and body having `height: 100%;` and body being flex-column.
*/}
<div class="flex-grow">
<header class="sticky">
<div class=" flex flex-row gap-4 items-center font-flashy">
<LogoSVG />
<Link slug="home">Reed's Website</Link>
</div>
</header>
<main class="cpnt-blog-article">
<Post originFilename={inputFileName} components={{ Link, Future }} />
</main>
</div>
<footer><Link slug="home">Home</Link></footer>
</>
);
Page.Render(outputFileName);
}