create-riebeckite 0.0.24 → 0.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/index.js +2 -1
- package/dist/src/scaffold/index.js +2 -1
- package/dist/src/scaffold/version.d.ts +1 -1
- package/package.json +2 -2
- package/templates/scaffold/presets/empty/app/routes/_renderer.tsx +25 -14
- package/templates/scaffold/presets/minimal/app/components/article.tsx +2 -3
- package/templates/scaffold/presets/minimal/app/routes/[slug{.+}].tsx +7 -23
- package/templates/scaffold/presets/minimal/app/routes/_renderer.tsx +24 -15
- package/templates/scaffold/presets/minimal/app/routes/index.tsx +6 -15
- package/templates/scaffold/presets/showcase/app/components/article.tsx +22 -21
- package/templates/scaffold/presets/showcase/app/components/site-header.tsx +11 -34
- package/templates/scaffold/presets/showcase/app/routes/[slug{.+}].tsx +6 -43
- package/templates/scaffold/presets/showcase/app/routes/_renderer.tsx +25 -34
- package/templates/scaffold/presets/showcase/app/routes/index.tsx +5 -40
- package/templates/scaffold/presets/starter/app/components/article.tsx +18 -21
- package/templates/scaffold/presets/starter/app/components/site-header.tsx +11 -34
- package/templates/scaffold/presets/starter/app/routes/[slug{.+}].tsx +6 -42
- package/templates/scaffold/presets/starter/app/routes/_renderer.tsx +25 -34
- package/templates/scaffold/presets/starter/app/routes/index.tsx +5 -37
package/dist/src/index.js
CHANGED
|
@@ -2591,7 +2591,7 @@ function referenceThemesContent(preset) {
|
|
|
2591
2591
|
}
|
|
2592
2592
|
|
|
2593
2593
|
// src/scaffold/version.ts
|
|
2594
|
-
var RIEBECKITE_VERSION = "^0.0.
|
|
2594
|
+
var RIEBECKITE_VERSION = "^0.0.26";
|
|
2595
2595
|
|
|
2596
2596
|
// src/scaffold/templates.ts
|
|
2597
2597
|
function siteTemplateFiles(preset, variables, options = {}) {
|
|
@@ -2657,6 +2657,7 @@ function packageJson(preset, variables, options) {
|
|
|
2657
2657
|
const dependencies = {
|
|
2658
2658
|
"@riebeckite/core": RIEBECKITE_VERSION,
|
|
2659
2659
|
"@riebeckite/honox": RIEBECKITE_VERSION,
|
|
2660
|
+
"@riebeckite/ui": RIEBECKITE_VERSION,
|
|
2660
2661
|
hono: "^4.12.25",
|
|
2661
2662
|
honox: "0.1.56"
|
|
2662
2663
|
};
|
|
@@ -2261,7 +2261,7 @@ function utilityTemplateFiles(utilities) {
|
|
|
2261
2261
|
}
|
|
2262
2262
|
|
|
2263
2263
|
// src/scaffold/version.ts
|
|
2264
|
-
var RIEBECKITE_VERSION = "^0.0.
|
|
2264
|
+
var RIEBECKITE_VERSION = "^0.0.26";
|
|
2265
2265
|
|
|
2266
2266
|
// src/scaffold/templates.ts
|
|
2267
2267
|
function siteTemplateFiles(preset, variables, options = {}) {
|
|
@@ -2327,6 +2327,7 @@ function packageJson(preset, variables, options) {
|
|
|
2327
2327
|
const dependencies = {
|
|
2328
2328
|
"@riebeckite/core": RIEBECKITE_VERSION,
|
|
2329
2329
|
"@riebeckite/honox": RIEBECKITE_VERSION,
|
|
2330
|
+
"@riebeckite/ui": RIEBECKITE_VERSION,
|
|
2330
2331
|
hono: "^4.12.25",
|
|
2331
2332
|
honox: "0.1.56"
|
|
2332
2333
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const RIEBECKITE_VERSION = "^0.0.
|
|
1
|
+
export declare const RIEBECKITE_VERSION = "^0.0.26";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-riebeckite",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.26",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/src/index.js",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"esbuild": "^0.28.2",
|
|
42
|
-
"@riebeckite/test": "0.0.
|
|
42
|
+
"@riebeckite/test": "0.0.26"
|
|
43
43
|
},
|
|
44
44
|
"repository": {
|
|
45
45
|
"type": "git",
|
|
@@ -1,21 +1,32 @@
|
|
|
1
|
+
import { createPublicContentView } from "@riebeckite/core";
|
|
2
|
+
import { RiebeckiteHead, ThemeRoot } from "@riebeckite/honox/ui";
|
|
3
|
+
import { SiteProvider } from "@riebeckite/ui";
|
|
1
4
|
import { jsxRenderer } from "hono/jsx-renderer";
|
|
2
|
-
import {
|
|
5
|
+
import { content } from "virtual:riebeckite/content";
|
|
3
6
|
import { config } from "virtual:riebeckite/config";
|
|
4
7
|
|
|
5
8
|
// Riebeckite plugin client entries need the HonoX client bundle even without
|
|
6
9
|
// an island component.
|
|
7
10
|
export const __importing_islands = true;
|
|
8
11
|
|
|
9
|
-
export default jsxRenderer(({ children }, c) =>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
export default jsxRenderer(async ({ children }, c) => {
|
|
13
|
+
const manifest = await content.getManifest();
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<SiteProvider
|
|
17
|
+
config={config}
|
|
18
|
+
manifest={manifest}
|
|
19
|
+
view={createPublicContentView(manifest)}
|
|
20
|
+
path={c.req.path}
|
|
21
|
+
language={c.get("htmlLanguage")}
|
|
22
|
+
headTags={c.get("headTags")}
|
|
23
|
+
>
|
|
24
|
+
<ThemeRoot>
|
|
25
|
+
<head>
|
|
26
|
+
<RiebeckiteHead colorModeScript={false} />
|
|
27
|
+
</head>
|
|
28
|
+
<body class="riebeckite-page rb-site">{children}</body>
|
|
29
|
+
</ThemeRoot>
|
|
30
|
+
</SiteProvider>
|
|
31
|
+
);
|
|
32
|
+
});
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import type { PostContent } from "@riebeckite/core";
|
|
2
1
|
import { Article, ArticleBody, ArticleContent } from "@riebeckite/honox/ui";
|
|
3
2
|
|
|
4
|
-
export function SiteArticle(
|
|
3
|
+
export function SiteArticle() {
|
|
5
4
|
return (
|
|
6
5
|
<Article class="site-article">
|
|
7
6
|
<ArticleContent>
|
|
8
|
-
<ArticleBody
|
|
7
|
+
<ArticleBody />
|
|
9
8
|
</ArticleContent>
|
|
10
9
|
</Article>
|
|
11
10
|
);
|
|
@@ -1,26 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
contentRouteSsgParams,
|
|
3
|
-
resolveRiebeckiteContentRequest,
|
|
4
|
-
riebeckiteSsgParams,
|
|
5
|
-
} from "@riebeckite/honox/server";
|
|
6
|
-
import { PageBody } from "@riebeckite/honox/ui";
|
|
7
|
-
import { createRoute } from "honox/factory";
|
|
1
|
+
import { createContentRoute } from "@riebeckite/honox/server";
|
|
8
2
|
import { SiteArticle } from "../components/article";
|
|
3
|
+
import { config } from "virtual:riebeckite/config";
|
|
9
4
|
import { content } from "virtual:riebeckite/content";
|
|
10
5
|
|
|
11
|
-
export default
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if (resolved.kind === "response") return resolved.response;
|
|
17
|
-
|
|
18
|
-
if (resolved.kind === "page") {
|
|
19
|
-
return c.render(<PageBody html={resolved.page.body} />);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
return c.render(
|
|
23
|
-
<SiteArticle post={resolved.post} />,
|
|
24
|
-
);
|
|
25
|
-
},
|
|
26
|
-
);
|
|
6
|
+
export default createContentRoute({
|
|
7
|
+
content,
|
|
8
|
+
config,
|
|
9
|
+
render: () => <SiteArticle />,
|
|
10
|
+
});
|
|
@@ -1,23 +1,32 @@
|
|
|
1
1
|
import { RiebeckiteHead, ThemeRoot } from "@riebeckite/honox/ui";
|
|
2
|
+
import { createPublicContentView } from "@riebeckite/core";
|
|
3
|
+
import { SiteProvider } from "@riebeckite/ui";
|
|
2
4
|
import { jsxRenderer } from "hono/jsx-renderer";
|
|
5
|
+
import { content } from "virtual:riebeckite/content";
|
|
3
6
|
import { config } from "virtual:riebeckite/config";
|
|
4
7
|
|
|
5
8
|
// Riebeckite plugin client entries need the HonoX client bundle even without
|
|
6
9
|
// an island component.
|
|
7
10
|
export const __importing_islands = true;
|
|
8
11
|
|
|
9
|
-
export default jsxRenderer(({ children }, c) =>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
12
|
+
export default jsxRenderer(async ({ children }, c) => {
|
|
13
|
+
const manifest = await content.getManifest();
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<SiteProvider
|
|
17
|
+
config={config}
|
|
18
|
+
manifest={manifest}
|
|
19
|
+
view={createPublicContentView(manifest)}
|
|
20
|
+
path={c.req.path}
|
|
21
|
+
language={c.get("htmlLanguage")}
|
|
22
|
+
headTags={c.get("headTags")}
|
|
23
|
+
>
|
|
24
|
+
<ThemeRoot>
|
|
25
|
+
<head>
|
|
26
|
+
<RiebeckiteHead colorModeScript={false} />
|
|
27
|
+
</head>
|
|
28
|
+
<body class="riebeckite-page rb-site">{children}</body>
|
|
29
|
+
</ThemeRoot>
|
|
30
|
+
</SiteProvider>
|
|
31
|
+
);
|
|
32
|
+
});
|
|
@@ -1,19 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PageBody } from "@riebeckite/honox/ui";
|
|
3
|
-
import { createRoute } from "honox/factory";
|
|
1
|
+
import { createHomeRoute } from "@riebeckite/honox/server";
|
|
4
2
|
import { SiteArticle } from "../components/article";
|
|
3
|
+
import { config } from "virtual:riebeckite/config";
|
|
5
4
|
import { content } from "virtual:riebeckite/content";
|
|
6
5
|
|
|
7
|
-
export default
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (home.kind === "page") {
|
|
13
|
-
return c.render(<PageBody html={home.page.body} />);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return c.render(
|
|
17
|
-
<SiteArticle post={home.post} />,
|
|
18
|
-
);
|
|
6
|
+
export default createHomeRoute({
|
|
7
|
+
content,
|
|
8
|
+
config,
|
|
9
|
+
render: () => <SiteArticle />,
|
|
19
10
|
});
|
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
import type { PostContent } from "@riebeckite/core";
|
|
2
1
|
import { Article, ArticleBody, ArticleContent, ArticleFooter } from "@riebeckite/honox/ui";
|
|
2
|
+
import { Backlinks } from "@riebeckite/plugin-backlinks";
|
|
3
|
+
import { Breadcrumbs } from "@riebeckite/plugin-breadcrumbs";
|
|
4
|
+
import { DailyNotes } from "@riebeckite/plugin-daily-notes";
|
|
5
|
+
import { Properties } from "@riebeckite/plugin-properties";
|
|
6
|
+
import { RecentPosts } from "@riebeckite/plugin-recent-posts";
|
|
7
|
+
import { RelatedPosts } from "@riebeckite/plugin-related-posts";
|
|
8
|
+
import { ShareControls } from "@riebeckite/plugin-share";
|
|
9
|
+
import { TableOfContents } from "@riebeckite/plugin-toc";
|
|
3
10
|
|
|
4
|
-
|
|
5
|
-
post: PostContent;
|
|
6
|
-
header?: unknown;
|
|
7
|
-
metadata?: unknown;
|
|
8
|
-
aside?: unknown;
|
|
9
|
-
afterContent?: unknown;
|
|
10
|
-
footer?: unknown;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export function SiteArticle(props: SiteArticleProps) {
|
|
11
|
+
export function SiteArticle() {
|
|
14
12
|
return (
|
|
15
13
|
<Article class="site-article">
|
|
16
14
|
<div class="site-article__layout">
|
|
17
15
|
<ArticleContent>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
<ArticleBody
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
16
|
+
<Breadcrumbs />
|
|
17
|
+
<Properties />
|
|
18
|
+
<ArticleBody />
|
|
19
|
+
<RecentPosts />
|
|
20
|
+
<DailyNotes />
|
|
21
|
+
<ArticleFooter class="site-article__footer">
|
|
22
|
+
<ShareControls />
|
|
23
|
+
<Backlinks />
|
|
24
|
+
<RelatedPosts />
|
|
25
|
+
</ArticleFooter>
|
|
27
26
|
</ArticleContent>
|
|
28
|
-
|
|
27
|
+
<aside class="site-article__aside">
|
|
28
|
+
<TableOfContents className="rr-table-of-contents--desktop" />
|
|
29
|
+
</aside>
|
|
29
30
|
</div>
|
|
30
31
|
</Article>
|
|
31
32
|
);
|
|
@@ -1,18 +1,9 @@
|
|
|
1
1
|
import { SiteNav } from "@riebeckite/plugin-navigation";
|
|
2
|
-
import type { NavigationItem } from "@riebeckite/plugin-navigation";
|
|
3
2
|
import { ColorModeToggle } from "@riebeckite/plugin-color-mode";
|
|
4
|
-
import {
|
|
3
|
+
import { useSiteContext } from "@riebeckite/ui";
|
|
5
4
|
|
|
6
|
-
export function SiteHeader({
|
|
7
|
-
|
|
8
|
-
items,
|
|
9
|
-
language,
|
|
10
|
-
}: {
|
|
11
|
-
path: string;
|
|
12
|
-
items: readonly NavigationItem[];
|
|
13
|
-
language?: string;
|
|
14
|
-
}) {
|
|
15
|
-
const navigation = items.filter((item) => item.href !== "/");
|
|
5
|
+
export function SiteHeader() {
|
|
6
|
+
const site = useSiteContext();
|
|
16
7
|
|
|
17
8
|
return (
|
|
18
9
|
<header class="site-header rb-site-header">
|
|
@@ -24,36 +15,22 @@ export function SiteHeader({
|
|
|
24
15
|
width="28"
|
|
25
16
|
height="28"
|
|
26
17
|
/>
|
|
27
|
-
{config.site.title}
|
|
18
|
+
{site?.config.site.title}
|
|
28
19
|
</a>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<SiteNav items={navigation} path={path} language={language} />
|
|
35
|
-
</details>
|
|
36
|
-
</>
|
|
37
|
-
) : null}
|
|
20
|
+
<SiteNav placement="primary" omitHome />
|
|
21
|
+
<details class="rb-nav__mobile">
|
|
22
|
+
<summary class="rb-nav__toggle">Menu</summary>
|
|
23
|
+
<SiteNav placement="primary" omitHome />
|
|
24
|
+
</details>
|
|
38
25
|
<ColorModeToggle />
|
|
39
26
|
</header>
|
|
40
27
|
);
|
|
41
28
|
}
|
|
42
29
|
|
|
43
|
-
export function SiteFooter({
|
|
44
|
-
path,
|
|
45
|
-
items,
|
|
46
|
-
language,
|
|
47
|
-
}: {
|
|
48
|
-
path: string;
|
|
49
|
-
items: readonly NavigationItem[];
|
|
50
|
-
language?: string;
|
|
51
|
-
}) {
|
|
52
|
-
if (items.length === 0) return null;
|
|
53
|
-
|
|
30
|
+
export function SiteFooter() {
|
|
54
31
|
return (
|
|
55
32
|
<footer class="site-footer rb-site-footer">
|
|
56
|
-
<SiteNav
|
|
33
|
+
<SiteNav placement="secondary" />
|
|
57
34
|
</footer>
|
|
58
35
|
);
|
|
59
36
|
}
|
|
@@ -1,47 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
contentRouteSsgParams,
|
|
3
|
-
resolveRiebeckiteContentRequest,
|
|
4
|
-
riebeckiteSsgParams,
|
|
5
|
-
} from "@riebeckite/honox/server";
|
|
6
|
-
import { PageBody } from "@riebeckite/honox/ui";
|
|
7
|
-
import { createPublicContentView } from "@riebeckite/core";
|
|
8
|
-
import { Backlinks, getBacklinks } from "@riebeckite/plugin-backlinks";
|
|
9
|
-
import { Breadcrumbs, getBreadcrumbs } from "@riebeckite/plugin-breadcrumbs";
|
|
10
|
-
import { Properties, getProperties } from "@riebeckite/plugin-properties";
|
|
11
|
-
import { getRelatedPosts, RelatedPosts, resolveRelatedPostsOptions } from "@riebeckite/plugin-related-posts";
|
|
12
|
-
import { getShareLinks, ShareControls } from "@riebeckite/plugin-share";
|
|
13
|
-
import { extractTableOfContents, TableOfContents } from "@riebeckite/plugin-toc";
|
|
14
|
-
import { createRoute } from "honox/factory";
|
|
1
|
+
import { createContentRoute } from "@riebeckite/honox/server";
|
|
15
2
|
import { SiteArticle } from "../components/article";
|
|
16
3
|
import { config } from "virtual:riebeckite/config";
|
|
17
4
|
import { content } from "virtual:riebeckite/content";
|
|
18
5
|
|
|
19
|
-
export default
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (resolved.kind === "response") return resolved.response;
|
|
25
|
-
|
|
26
|
-
if (resolved.kind === "page") {
|
|
27
|
-
return c.render(<PageBody html={resolved.page.body} />);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const tableOfContents = extractTableOfContents(resolved.post.html ?? "");
|
|
31
|
-
const manifest = await content.getManifest();
|
|
32
|
-
const view = createPublicContentView(manifest);
|
|
33
|
-
const entry = view.findRoutableBySlug(resolved.entry.slug);
|
|
34
|
-
if (!entry) return c.notFound();
|
|
35
|
-
const relatedOptions = resolveRelatedPostsOptions({});
|
|
36
|
-
|
|
37
|
-
return c.render(
|
|
38
|
-
<SiteArticle
|
|
39
|
-
post={resolved.post}
|
|
40
|
-
header={<Breadcrumbs items={getBreadcrumbs({ view, entry, homeLabel: config.site.title })} />}
|
|
41
|
-
metadata={<Properties data={getProperties({ view, frontmatter: resolved.post.frontmatter, options: { include: ["created", "modified", "tags", "status"], order: ["created", "modified", "tags", "status"] } })} />}
|
|
42
|
-
aside={<TableOfContents className="rr-table-of-contents--desktop" items={tableOfContents} />}
|
|
43
|
-
footer={<><ShareControls {...getShareLinks({ entry, site: config })} /><Backlinks backlinks={getBacklinks({ view, slug: entry.slug })} /><RelatedPosts entries={getRelatedPosts({ view, entry, options: relatedOptions })} options={relatedOptions} /></>}
|
|
44
|
-
/>,
|
|
45
|
-
);
|
|
46
|
-
},
|
|
47
|
-
);
|
|
6
|
+
export default createContentRoute({
|
|
7
|
+
content,
|
|
8
|
+
config,
|
|
9
|
+
render: () => <SiteArticle />,
|
|
10
|
+
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { RiebeckiteHead, ThemeRoot } from "@riebeckite/honox/ui";
|
|
2
|
+
import { createPublicContentView } from "@riebeckite/core";
|
|
3
|
+
import { SiteProvider } from "@riebeckite/ui";
|
|
2
4
|
import { jsxRenderer } from "hono/jsx-renderer";
|
|
3
|
-
import { resolveSiteNavigation } from "@riebeckite/plugin-navigation";
|
|
4
5
|
import { SearchBar } from "@riebeckite/plugin-search";
|
|
5
6
|
import { SiteFooter, SiteHeader } from "../components/site-header";
|
|
6
7
|
import { content } from "virtual:riebeckite/content";
|
|
@@ -11,41 +12,31 @@ import { config } from "virtual:riebeckite/config";
|
|
|
11
12
|
export const __importing_islands = true;
|
|
12
13
|
|
|
13
14
|
export default jsxRenderer(async ({ children }, c) => {
|
|
14
|
-
const
|
|
15
|
-
resolveSiteNavigation(
|
|
16
|
-
config,
|
|
17
|
-
await content.getManifest(),
|
|
18
|
-
c.get("htmlLanguage"),
|
|
19
|
-
) ?? { primary: [], secondary: [] };
|
|
15
|
+
const manifest = await content.getManifest();
|
|
20
16
|
|
|
21
17
|
return (
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
<SiteProvider
|
|
19
|
+
config={config}
|
|
20
|
+
manifest={manifest}
|
|
21
|
+
view={createPublicContentView(manifest)}
|
|
22
|
+
path={c.req.path}
|
|
23
|
+
language={c.get("htmlLanguage")}
|
|
24
|
+
headTags={c.get("headTags")}
|
|
25
25
|
>
|
|
26
|
-
<
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
{children}
|
|
42
|
-
</main>
|
|
43
|
-
<SiteFooter
|
|
44
|
-
path={c.req.path}
|
|
45
|
-
items={navigation.secondary}
|
|
46
|
-
language={c.get("htmlLanguage")}
|
|
47
|
-
/>
|
|
48
|
-
</body>
|
|
49
|
-
</ThemeRoot>
|
|
26
|
+
<ThemeRoot>
|
|
27
|
+
<head>
|
|
28
|
+
<RiebeckiteHead />
|
|
29
|
+
</head>
|
|
30
|
+
<body class="riebeckite-page rb-site">
|
|
31
|
+
<a class="rb-skip-link" href="#main-content">Skip to main content</a>
|
|
32
|
+
<SiteHeader />
|
|
33
|
+
<SearchBar />
|
|
34
|
+
<main id="main-content" tabindex="-1" class="riebeckite-main">
|
|
35
|
+
{children}
|
|
36
|
+
</main>
|
|
37
|
+
<SiteFooter />
|
|
38
|
+
</body>
|
|
39
|
+
</ThemeRoot>
|
|
40
|
+
</SiteProvider>
|
|
50
41
|
);
|
|
51
42
|
});
|
|
@@ -1,45 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PageBody } from "@riebeckite/honox/ui";
|
|
3
|
-
import { createPublicContentView } from "@riebeckite/core";
|
|
4
|
-
import { Backlinks, getBacklinks } from "@riebeckite/plugin-backlinks";
|
|
5
|
-
import { Breadcrumbs, getBreadcrumbs } from "@riebeckite/plugin-breadcrumbs";
|
|
6
|
-
import { Properties, getProperties } from "@riebeckite/plugin-properties";
|
|
7
|
-
import { getRelatedPosts, RelatedPosts, resolveRelatedPostsOptions } from "@riebeckite/plugin-related-posts";
|
|
8
|
-
import { DailyNotes, getDailyNotes } from "@riebeckite/plugin-daily-notes";
|
|
9
|
-
import { getRecentPosts, RecentPosts } from "@riebeckite/plugin-recent-posts";
|
|
10
|
-
import { getShareLinks, ShareControls } from "@riebeckite/plugin-share";
|
|
11
|
-
import { extractTableOfContents, TableOfContents } from "@riebeckite/plugin-toc";
|
|
12
|
-
import { createRoute } from "honox/factory";
|
|
1
|
+
import { createHomeRoute } from "@riebeckite/honox/server";
|
|
13
2
|
import { SiteArticle } from "../components/article";
|
|
14
3
|
import { config } from "virtual:riebeckite/config";
|
|
15
4
|
import { content } from "virtual:riebeckite/content";
|
|
16
5
|
|
|
17
|
-
export default
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
if (home.kind === "page") {
|
|
23
|
-
return c.render(<PageBody html={home.page.body} />);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const manifest = await content.getManifest();
|
|
27
|
-
const recentPosts = getRecentPosts({ manifest });
|
|
28
|
-
const dailyNotes = getDailyNotes({ manifest, config });
|
|
29
|
-
const tableOfContents = extractTableOfContents(home.post.html ?? "");
|
|
30
|
-
const view = createPublicContentView(manifest);
|
|
31
|
-
const entry = view.findRoutableBySlug(home.entry.slug);
|
|
32
|
-
if (!entry) return c.notFound();
|
|
33
|
-
const relatedOptions = resolveRelatedPostsOptions({});
|
|
34
|
-
|
|
35
|
-
return c.render(
|
|
36
|
-
<SiteArticle
|
|
37
|
-
post={home.post}
|
|
38
|
-
header={<Breadcrumbs items={getBreadcrumbs({ view, entry, homeLabel: config.site.title })} />}
|
|
39
|
-
metadata={<Properties data={getProperties({ view, frontmatter: home.post.frontmatter, options: { include: ["created", "modified", "tags", "status"], order: ["created", "modified", "tags", "status"] } })} />}
|
|
40
|
-
aside={<TableOfContents className="rr-table-of-contents--desktop" items={tableOfContents} />}
|
|
41
|
-
afterContent={<><RecentPosts posts={recentPosts} /><DailyNotes notes={dailyNotes} /></>}
|
|
42
|
-
footer={<><ShareControls {...getShareLinks({ entry, site: config })} /><Backlinks backlinks={getBacklinks({ view, slug: entry.slug })} /><RelatedPosts entries={getRelatedPosts({ view, entry, options: relatedOptions })} options={relatedOptions} /></>}
|
|
43
|
-
/>,
|
|
44
|
-
);
|
|
6
|
+
export default createHomeRoute({
|
|
7
|
+
content,
|
|
8
|
+
config,
|
|
9
|
+
render: () => <SiteArticle />,
|
|
45
10
|
});
|
|
@@ -1,31 +1,28 @@
|
|
|
1
|
-
import type { PostContent } from "@riebeckite/core";
|
|
2
1
|
import { Article, ArticleBody, ArticleContent, ArticleFooter } from "@riebeckite/honox/ui";
|
|
2
|
+
import { Backlinks } from "@riebeckite/plugin-backlinks";
|
|
3
|
+
import { Breadcrumbs } from "@riebeckite/plugin-breadcrumbs";
|
|
4
|
+
import { Properties } from "@riebeckite/plugin-properties";
|
|
5
|
+
import { RecentPosts } from "@riebeckite/plugin-recent-posts";
|
|
6
|
+
import { RelatedPosts } from "@riebeckite/plugin-related-posts";
|
|
7
|
+
import { TableOfContents } from "@riebeckite/plugin-toc";
|
|
3
8
|
|
|
4
|
-
|
|
5
|
-
post: PostContent;
|
|
6
|
-
header?: unknown;
|
|
7
|
-
metadata?: unknown;
|
|
8
|
-
aside?: unknown;
|
|
9
|
-
afterContent?: unknown;
|
|
10
|
-
footer?: unknown;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export function SiteArticle(props: SiteArticleProps) {
|
|
9
|
+
export function SiteArticle() {
|
|
14
10
|
return (
|
|
15
11
|
<Article class="site-article">
|
|
16
12
|
<div class="site-article__layout">
|
|
17
13
|
<ArticleContent>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
<ArticleBody
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
) : null}
|
|
14
|
+
<Breadcrumbs />
|
|
15
|
+
<Properties />
|
|
16
|
+
<ArticleBody />
|
|
17
|
+
<RecentPosts />
|
|
18
|
+
<ArticleFooter class="site-article__footer">
|
|
19
|
+
<Backlinks />
|
|
20
|
+
<RelatedPosts />
|
|
21
|
+
</ArticleFooter>
|
|
27
22
|
</ArticleContent>
|
|
28
|
-
|
|
23
|
+
<aside class="site-article__aside">
|
|
24
|
+
<TableOfContents className="rr-table-of-contents--desktop" />
|
|
25
|
+
</aside>
|
|
29
26
|
</div>
|
|
30
27
|
</Article>
|
|
31
28
|
);
|
|
@@ -1,18 +1,9 @@
|
|
|
1
1
|
import { SiteNav } from "@riebeckite/plugin-navigation";
|
|
2
|
-
import type { NavigationItem } from "@riebeckite/plugin-navigation";
|
|
3
2
|
import { ColorModeToggle } from "@riebeckite/plugin-color-mode";
|
|
4
|
-
import {
|
|
3
|
+
import { useSiteContext } from "@riebeckite/ui";
|
|
5
4
|
|
|
6
|
-
export function SiteHeader({
|
|
7
|
-
|
|
8
|
-
items,
|
|
9
|
-
language,
|
|
10
|
-
}: {
|
|
11
|
-
path: string;
|
|
12
|
-
items: readonly NavigationItem[];
|
|
13
|
-
language?: string;
|
|
14
|
-
}) {
|
|
15
|
-
const navigation = items.filter((item) => item.href !== "/");
|
|
5
|
+
export function SiteHeader() {
|
|
6
|
+
const site = useSiteContext();
|
|
16
7
|
|
|
17
8
|
return (
|
|
18
9
|
<header class="site-header rb-site-header">
|
|
@@ -24,36 +15,22 @@ export function SiteHeader({
|
|
|
24
15
|
width="28"
|
|
25
16
|
height="28"
|
|
26
17
|
/>
|
|
27
|
-
{config.site.title}
|
|
18
|
+
{site?.config.site.title}
|
|
28
19
|
</a>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<SiteNav items={navigation} path={path} language={language} />
|
|
35
|
-
</details>
|
|
36
|
-
</>
|
|
37
|
-
) : null}
|
|
20
|
+
<SiteNav placement="primary" omitHome />
|
|
21
|
+
<details class="rb-nav__mobile">
|
|
22
|
+
<summary class="rb-nav__toggle">Menu</summary>
|
|
23
|
+
<SiteNav placement="primary" omitHome />
|
|
24
|
+
</details>
|
|
38
25
|
<ColorModeToggle />
|
|
39
26
|
</header>
|
|
40
27
|
);
|
|
41
28
|
}
|
|
42
29
|
|
|
43
|
-
export function SiteFooter({
|
|
44
|
-
path,
|
|
45
|
-
items,
|
|
46
|
-
language,
|
|
47
|
-
}: {
|
|
48
|
-
path: string;
|
|
49
|
-
items: readonly NavigationItem[];
|
|
50
|
-
language?: string;
|
|
51
|
-
}) {
|
|
52
|
-
if (items.length === 0) return null;
|
|
53
|
-
|
|
30
|
+
export function SiteFooter() {
|
|
54
31
|
return (
|
|
55
32
|
<footer class="site-footer rb-site-footer">
|
|
56
|
-
<SiteNav
|
|
33
|
+
<SiteNav placement="secondary" />
|
|
57
34
|
</footer>
|
|
58
35
|
);
|
|
59
36
|
}
|
|
@@ -1,46 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
contentRouteSsgParams,
|
|
3
|
-
resolveRiebeckiteContentRequest,
|
|
4
|
-
riebeckiteSsgParams,
|
|
5
|
-
} from "@riebeckite/honox/server";
|
|
6
|
-
import { PageBody } from "@riebeckite/honox/ui";
|
|
7
|
-
import { createPublicContentView } from "@riebeckite/core";
|
|
8
|
-
import { Backlinks, getBacklinks } from "@riebeckite/plugin-backlinks";
|
|
9
|
-
import { Breadcrumbs, getBreadcrumbs } from "@riebeckite/plugin-breadcrumbs";
|
|
10
|
-
import { Properties, getProperties } from "@riebeckite/plugin-properties";
|
|
11
|
-
import { getRelatedPosts, RelatedPosts, resolveRelatedPostsOptions } from "@riebeckite/plugin-related-posts";
|
|
12
|
-
import { extractTableOfContents, TableOfContents } from "@riebeckite/plugin-toc";
|
|
13
|
-
import { createRoute } from "honox/factory";
|
|
1
|
+
import { createContentRoute } from "@riebeckite/honox/server";
|
|
14
2
|
import { SiteArticle } from "../components/article";
|
|
15
3
|
import { config } from "virtual:riebeckite/config";
|
|
16
4
|
import { content } from "virtual:riebeckite/content";
|
|
17
5
|
|
|
18
|
-
export default
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if (resolved.kind === "response") return resolved.response;
|
|
24
|
-
|
|
25
|
-
if (resolved.kind === "page") {
|
|
26
|
-
return c.render(<PageBody html={resolved.page.body} />);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const tableOfContents = extractTableOfContents(resolved.post.html ?? "");
|
|
30
|
-
const manifest = await content.getManifest();
|
|
31
|
-
const view = createPublicContentView(manifest);
|
|
32
|
-
const entry = view.findRoutableBySlug(resolved.entry.slug);
|
|
33
|
-
if (!entry) return c.notFound();
|
|
34
|
-
const relatedOptions = resolveRelatedPostsOptions({});
|
|
35
|
-
|
|
36
|
-
return c.render(
|
|
37
|
-
<SiteArticle
|
|
38
|
-
post={resolved.post}
|
|
39
|
-
header={<Breadcrumbs items={getBreadcrumbs({ view, entry, homeLabel: config.site.title })} />}
|
|
40
|
-
metadata={<Properties data={getProperties({ view, frontmatter: resolved.post.frontmatter, options: { include: ["created", "modified", "tags", "status"], order: ["created", "modified", "tags", "status"] } })} />}
|
|
41
|
-
aside={<TableOfContents className="rr-table-of-contents--desktop" items={tableOfContents} />}
|
|
42
|
-
footer={<><Backlinks backlinks={getBacklinks({ view, slug: entry.slug })} /><RelatedPosts entries={getRelatedPosts({ view, entry, options: relatedOptions })} options={relatedOptions} /></>}
|
|
43
|
-
/>,
|
|
44
|
-
);
|
|
45
|
-
},
|
|
46
|
-
);
|
|
6
|
+
export default createContentRoute({
|
|
7
|
+
content,
|
|
8
|
+
config,
|
|
9
|
+
render: () => <SiteArticle />,
|
|
10
|
+
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { RiebeckiteHead, ThemeRoot } from "@riebeckite/honox/ui";
|
|
2
|
+
import { createPublicContentView } from "@riebeckite/core";
|
|
3
|
+
import { SiteProvider } from "@riebeckite/ui";
|
|
2
4
|
import { jsxRenderer } from "hono/jsx-renderer";
|
|
3
|
-
import { resolveSiteNavigation } from "@riebeckite/plugin-navigation";
|
|
4
5
|
import { SearchBar } from "@riebeckite/plugin-search";
|
|
5
6
|
import { SiteFooter, SiteHeader } from "../components/site-header";
|
|
6
7
|
import { content } from "virtual:riebeckite/content";
|
|
@@ -11,41 +12,31 @@ import { config } from "virtual:riebeckite/config";
|
|
|
11
12
|
export const __importing_islands = true;
|
|
12
13
|
|
|
13
14
|
export default jsxRenderer(async ({ children }, c) => {
|
|
14
|
-
const
|
|
15
|
-
resolveSiteNavigation(
|
|
16
|
-
config,
|
|
17
|
-
await content.getManifest(),
|
|
18
|
-
c.get("htmlLanguage"),
|
|
19
|
-
) ?? { primary: [], secondary: [] };
|
|
15
|
+
const manifest = await content.getManifest();
|
|
20
16
|
|
|
21
17
|
return (
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
<SiteProvider
|
|
19
|
+
config={config}
|
|
20
|
+
manifest={manifest}
|
|
21
|
+
view={createPublicContentView(manifest)}
|
|
22
|
+
path={c.req.path}
|
|
23
|
+
language={c.get("htmlLanguage")}
|
|
24
|
+
headTags={c.get("headTags")}
|
|
25
25
|
>
|
|
26
|
-
<
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
{children}
|
|
42
|
-
</main>
|
|
43
|
-
<SiteFooter
|
|
44
|
-
path={c.req.path}
|
|
45
|
-
items={navigation.secondary}
|
|
46
|
-
language={c.get("htmlLanguage")}
|
|
47
|
-
/>
|
|
48
|
-
</body>
|
|
49
|
-
</ThemeRoot>
|
|
26
|
+
<ThemeRoot>
|
|
27
|
+
<head>
|
|
28
|
+
<RiebeckiteHead />
|
|
29
|
+
</head>
|
|
30
|
+
<body class="riebeckite-page rb-site">
|
|
31
|
+
<a class="rb-skip-link" href="#main-content">Skip to main content</a>
|
|
32
|
+
<SiteHeader />
|
|
33
|
+
<SearchBar />
|
|
34
|
+
<main id="main-content" tabindex="-1" class="riebeckite-main">
|
|
35
|
+
{children}
|
|
36
|
+
</main>
|
|
37
|
+
<SiteFooter />
|
|
38
|
+
</body>
|
|
39
|
+
</ThemeRoot>
|
|
40
|
+
</SiteProvider>
|
|
50
41
|
);
|
|
51
42
|
});
|
|
@@ -1,42 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PageBody } from "@riebeckite/honox/ui";
|
|
3
|
-
import { createPublicContentView } from "@riebeckite/core";
|
|
4
|
-
import { Backlinks, getBacklinks } from "@riebeckite/plugin-backlinks";
|
|
5
|
-
import { Breadcrumbs, getBreadcrumbs } from "@riebeckite/plugin-breadcrumbs";
|
|
6
|
-
import { Properties, getProperties } from "@riebeckite/plugin-properties";
|
|
7
|
-
import { getRelatedPosts, RelatedPosts, resolveRelatedPostsOptions } from "@riebeckite/plugin-related-posts";
|
|
8
|
-
import { getRecentPosts, RecentPosts } from "@riebeckite/plugin-recent-posts";
|
|
9
|
-
import { extractTableOfContents, TableOfContents } from "@riebeckite/plugin-toc";
|
|
10
|
-
import { createRoute } from "honox/factory";
|
|
1
|
+
import { createHomeRoute } from "@riebeckite/honox/server";
|
|
11
2
|
import { SiteArticle } from "../components/article";
|
|
12
3
|
import { config } from "virtual:riebeckite/config";
|
|
13
4
|
import { content } from "virtual:riebeckite/content";
|
|
14
5
|
|
|
15
|
-
export default
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
if (home.kind === "page") {
|
|
21
|
-
return c.render(<PageBody html={home.page.body} />);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const manifest = await content.getManifest();
|
|
25
|
-
const recentPosts = getRecentPosts({ manifest });
|
|
26
|
-
const tableOfContents = extractTableOfContents(home.post.html ?? "");
|
|
27
|
-
const view = createPublicContentView(manifest);
|
|
28
|
-
const entry = view.findRoutableBySlug(home.entry.slug);
|
|
29
|
-
if (!entry) return c.notFound();
|
|
30
|
-
const relatedOptions = resolveRelatedPostsOptions({});
|
|
31
|
-
|
|
32
|
-
return c.render(
|
|
33
|
-
<SiteArticle
|
|
34
|
-
post={home.post}
|
|
35
|
-
header={<Breadcrumbs items={getBreadcrumbs({ view, entry, homeLabel: config.site.title })} />}
|
|
36
|
-
metadata={<Properties data={getProperties({ view, frontmatter: home.post.frontmatter, options: { include: ["created", "modified", "tags", "status"], order: ["created", "modified", "tags", "status"] } })} />}
|
|
37
|
-
aside={<TableOfContents className="rr-table-of-contents--desktop" items={tableOfContents} />}
|
|
38
|
-
afterContent={<RecentPosts posts={recentPosts} />}
|
|
39
|
-
footer={<><Backlinks backlinks={getBacklinks({ view, slug: entry.slug })} /><RelatedPosts entries={getRelatedPosts({ view, entry, options: relatedOptions })} options={relatedOptions} /></>}
|
|
40
|
-
/>,
|
|
41
|
-
);
|
|
6
|
+
export default createHomeRoute({
|
|
7
|
+
content,
|
|
8
|
+
config,
|
|
9
|
+
render: () => <SiteArticle />,
|
|
42
10
|
});
|