@riebeckite/honox 0.0.31 → 0.0.33
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/index.js +534 -134
- package/dist/server.js +6 -0
- package/dist/src/asset_entries.d.ts +2 -1
- package/dist/src/client_module.d.ts +1 -1
- package/dist/src/content_assets.d.ts +1 -1
- package/dist/src/content_watch.d.ts +2 -1
- package/dist/src/endpoints.d.ts +1 -1
- package/dist/src/ssg/output_cache.d.ts +2 -2
- package/dist/src/ssg/types.d.ts +3 -2
- package/dist/src/ui/primitives.d.ts +36 -18
- package/dist/src/ui/primitives.js +229 -2
- package/dist/src/vite_runner.d.ts +3 -2
- package/package.json +10 -8
- package/style.css +249 -0
package/dist/server.js
CHANGED
|
@@ -35,6 +35,11 @@ async function resolveRiebeckiteContentRequest(c, content, parameter = "slug") {
|
|
|
35
35
|
const requestedSlug = c.req.param(parameter);
|
|
36
36
|
if (!requestedSlug) return { kind: "response", response: c.notFound() };
|
|
37
37
|
if (contentExtensionPattern.test(requestedSlug)) {
|
|
38
|
+
const page = await content.resolvePage(c.req.path);
|
|
39
|
+
if (page) {
|
|
40
|
+
applyRiebeckiteRouteContext(c, { kind: "page", page });
|
|
41
|
+
return { kind: "page", page };
|
|
42
|
+
}
|
|
38
43
|
return { kind: "response", response: c.notFound() };
|
|
39
44
|
}
|
|
40
45
|
return resolveRouteRequest(c, content);
|
|
@@ -250,6 +255,7 @@ import {
|
|
|
250
255
|
} from "@riebeckite/ui";
|
|
251
256
|
|
|
252
257
|
// src/ui/primitives.tsx
|
|
258
|
+
import { escapeScriptJson, uniqueStrings } from "@riebeckite/core";
|
|
253
259
|
import { ColorModeScript } from "@riebeckite/plugin-color-mode";
|
|
254
260
|
import { raw } from "hono/html";
|
|
255
261
|
import { Link, Script } from "honox/server";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type ResolvedRiebeckiteConfig } from "@riebeckite/core";
|
|
2
|
-
|
|
2
|
+
type GeneratedAssetPaths = {
|
|
3
3
|
frameworkStyles: string;
|
|
4
4
|
pluginStyles: string;
|
|
5
5
|
themeStyles: string;
|
|
6
6
|
};
|
|
7
7
|
export declare function writeRiebeckiteAssetEntries(config: ResolvedRiebeckiteConfig, paths: GeneratedAssetPaths): void;
|
|
8
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ResolvedRiebeckiteConfig } from "@riebeckite/core";
|
|
2
2
|
import type { Plugin } from "vite";
|
|
3
|
-
export declare function riebeckiteClientModule(getConfig: () => Pick<ResolvedRiebeckiteConfig, "plugins">): Plugin;
|
|
3
|
+
export declare function riebeckiteClientModule(getConfig: () => Pick<ResolvedRiebeckiteConfig, "plugins" | "spa">): Plugin;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Plugin, ViteDevServer } from "vite";
|
|
2
|
-
|
|
2
|
+
type RiebeckiteContentWatchOptions = {
|
|
3
3
|
appRoot: () => string;
|
|
4
4
|
contentRoot: () => string;
|
|
5
5
|
exclude: () => readonly string[];
|
|
@@ -9,3 +9,4 @@ export declare function isSiteAssetPath(logicalPath: string): boolean;
|
|
|
9
9
|
export declare function isPathInsideDirectory(directory: string, file: string): boolean;
|
|
10
10
|
export declare function toLogicalPath(directory: string, file: string): string;
|
|
11
11
|
export declare function invalidateApplicationRuntime(server: Pick<ViteDevServer, "environments">, appRoot: string): number;
|
|
12
|
+
export {};
|
package/dist/src/endpoints.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { NoChangeFastPathOutputMetrics, NoChangeFastPathResult, OutputCacheDecision, OutputCacheRejectionReason } from "./types.js";
|
|
2
|
-
|
|
2
|
+
type OutputCacheEntry = {
|
|
3
3
|
cachePath: string;
|
|
4
4
|
checksum: string;
|
|
5
5
|
};
|
|
@@ -26,4 +26,4 @@ export declare function loadOutputCache(path: string, timingsMs?: Record<string,
|
|
|
26
26
|
}) | undefined>;
|
|
27
27
|
export declare function saveOutputCache(path: string, state: OutputCacheState, outputDirectory: string, timingsMs?: Record<string, number>): Promise<string>;
|
|
28
28
|
export declare function decodeOutput(outputCachePath: string, entry: OutputCacheEntry): Promise<Uint8Array>;
|
|
29
|
-
export
|
|
29
|
+
export {};
|
package/dist/src/ssg/types.d.ts
CHANGED
|
@@ -5,13 +5,13 @@ export type GeneratedOutputAsset = {
|
|
|
5
5
|
fileName: string;
|
|
6
6
|
source: string | Uint8Array;
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
type SsgGeneratedHtmlDiagnostic = {
|
|
9
9
|
severity: "info" | "warning" | "error";
|
|
10
10
|
message: string;
|
|
11
11
|
code?: string;
|
|
12
12
|
filePath?: string;
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
type SsgHtmlInspectorPlugin = {
|
|
15
15
|
name?: string;
|
|
16
16
|
inspectGeneratedHtml?: (page: {
|
|
17
17
|
path: string;
|
|
@@ -125,3 +125,4 @@ export type NoChangeFastPathOutputMetrics = {
|
|
|
125
125
|
outputFilesHashed: number;
|
|
126
126
|
outputBytesHashed: number;
|
|
127
127
|
};
|
|
128
|
+
export {};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import type { PluginHeadTag, PostContent, PublicContentEntry, ResolvedRiebeckiteConfig } from "@riebeckite/core";
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { PluginHeadTag, PostContent, PublicContentEntry, ResolvedRiebeckiteConfig, SeoMetadata } from "@riebeckite/core";
|
|
2
|
+
type PrimitiveChildren = unknown;
|
|
3
|
+
type PrimitiveProps = {
|
|
4
4
|
children?: PrimitiveChildren;
|
|
5
5
|
class?: string;
|
|
6
6
|
className?: string;
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
type PrimitiveClassProps = {
|
|
9
9
|
class?: string;
|
|
10
10
|
className?: string;
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
type ArticleProps = PrimitiveProps & {
|
|
13
13
|
post?: PostContent;
|
|
14
14
|
entry?: PublicContentEntry;
|
|
15
15
|
};
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
type ArticleLayoutProps = PrimitiveProps;
|
|
17
|
+
type ArticleHeaderProps = (PrimitiveClassProps & {
|
|
18
18
|
dangerouslySetInnerHTML: {
|
|
19
19
|
__html: string;
|
|
20
20
|
};
|
|
@@ -23,26 +23,26 @@ export type ArticleHeaderProps = (PrimitiveClassProps & {
|
|
|
23
23
|
dangerouslySetInnerHTML?: never;
|
|
24
24
|
children?: PrimitiveChildren;
|
|
25
25
|
});
|
|
26
|
-
|
|
26
|
+
type ArticleContentProps = PrimitiveClassProps & {
|
|
27
27
|
children?: PrimitiveChildren;
|
|
28
28
|
};
|
|
29
|
-
|
|
29
|
+
type ArticleMetaProps = PrimitiveProps & {
|
|
30
30
|
label?: string;
|
|
31
31
|
};
|
|
32
|
-
|
|
32
|
+
type SidebarProps = PrimitiveProps & {
|
|
33
33
|
label?: string;
|
|
34
34
|
};
|
|
35
|
-
|
|
35
|
+
type ArticleFooterProps = PrimitiveProps;
|
|
36
36
|
export declare function Article(props: ArticleProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
|
|
37
37
|
export declare function ArticleLayout(props: ArticleLayoutProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
|
|
38
38
|
export declare function ArticleHeader(props: ArticleHeaderProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
|
|
39
39
|
export declare function ArticleMeta(props: ArticleMetaProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
|
|
40
40
|
export declare function ArticleContent(props: ArticleContentProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
|
|
41
|
-
|
|
41
|
+
type ArticleBodyProps = PrimitiveClassProps & {
|
|
42
42
|
html?: string;
|
|
43
43
|
};
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
type HtmlFragmentSource = "markdown" | "plugin-page";
|
|
45
|
+
type HtmlFragmentProps = {
|
|
46
46
|
html: string;
|
|
47
47
|
source: HtmlFragmentSource;
|
|
48
48
|
};
|
|
@@ -53,7 +53,7 @@ export declare function HtmlFragment(props: HtmlFragmentProps): import("hono/uti
|
|
|
53
53
|
* Owns the `.rb-article-content` Stable Hook so Sites never hand-write it.
|
|
54
54
|
*/
|
|
55
55
|
export declare function ArticleBody(props: ArticleBodyProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
|
|
56
|
-
|
|
56
|
+
type PageBodyProps = PrimitiveClassProps & {
|
|
57
57
|
html: string;
|
|
58
58
|
};
|
|
59
59
|
/**
|
|
@@ -65,7 +65,7 @@ export type PageBodyProps = PrimitiveClassProps & {
|
|
|
65
65
|
export declare function PageBody(props: PageBodyProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
|
|
66
66
|
export declare function ArticleFooter(props: ArticleFooterProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
|
|
67
67
|
export declare function Sidebar(props: SidebarProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
|
|
68
|
-
|
|
68
|
+
type ThemeRootProps = {
|
|
69
69
|
theme?: ResolvedRiebeckiteConfig["theme"];
|
|
70
70
|
lang?: string;
|
|
71
71
|
children?: PrimitiveChildren;
|
|
@@ -84,7 +84,7 @@ export declare function themeRootAttributes(theme: ResolvedRiebeckiteConfig["the
|
|
|
84
84
|
* `<head>` and `<body>` as children.
|
|
85
85
|
*/
|
|
86
86
|
export declare function ThemeRoot(props: ThemeRootProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
|
|
87
|
-
|
|
87
|
+
type PluginHeadTagsProps = {
|
|
88
88
|
tags?: readonly PluginHeadTag[];
|
|
89
89
|
};
|
|
90
90
|
/**
|
|
@@ -93,12 +93,14 @@ export type PluginHeadTagsProps = {
|
|
|
93
93
|
* The Site owns placement; this primitive owns the conversion and ordering.
|
|
94
94
|
*/
|
|
95
95
|
export declare function PluginHeadTags(props: PluginHeadTagsProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
|
|
96
|
-
|
|
96
|
+
type RiebeckiteHeadProps = {
|
|
97
97
|
title?: string;
|
|
98
98
|
headTags?: readonly PluginHeadTag[];
|
|
99
99
|
faviconHref?: string | null;
|
|
100
100
|
colorModeScript?: boolean;
|
|
101
101
|
stylesheets?: readonly string[];
|
|
102
|
+
themeStyle?: string;
|
|
103
|
+
themeStylesheets?: readonly string[];
|
|
102
104
|
clientSrc?: string | null;
|
|
103
105
|
prod?: boolean;
|
|
104
106
|
children?: PrimitiveChildren;
|
|
@@ -111,3 +113,19 @@ export type RiebeckiteHeadProps = {
|
|
|
111
113
|
* surrounding `<head>` so it can add its own elements next to this primitive.
|
|
112
114
|
*/
|
|
113
115
|
export declare function RiebeckiteHead(props: RiebeckiteHeadProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
|
|
116
|
+
type SeoHeadProps = {
|
|
117
|
+
seo: SeoMetadata;
|
|
118
|
+
siteTitle: string;
|
|
119
|
+
author?: string;
|
|
120
|
+
ogLocale?: string;
|
|
121
|
+
ogAlternates?: readonly string[];
|
|
122
|
+
twitterSite?: string;
|
|
123
|
+
feedLinks?: readonly {
|
|
124
|
+
href: string;
|
|
125
|
+
type: string;
|
|
126
|
+
}[];
|
|
127
|
+
};
|
|
128
|
+
export declare function SeoHead(props: SeoHeadProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
|
|
129
|
+
export declare function getThemeStyle(tokens: ResolvedRiebeckiteConfig["theme"]["tokens"]): string;
|
|
130
|
+
export declare function getThemeStylesheets(userCss: readonly string[]): string[];
|
|
131
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// src/ui/primitives.tsx
|
|
2
|
+
import { escapeScriptJson, uniqueStrings } from "@riebeckite/core";
|
|
2
3
|
import { ColorModeScript } from "@riebeckite/plugin-color-mode";
|
|
3
4
|
import { raw } from "hono/html";
|
|
4
5
|
import { Link, Script } from "honox/server";
|
|
@@ -128,20 +129,26 @@ function PluginHeadTags(props) {
|
|
|
128
129
|
function renderPluginHeadTag(tag, index) {
|
|
129
130
|
const key = `${tag.tag}-${index}`;
|
|
130
131
|
if (tag.tag === "meta") {
|
|
131
|
-
return /* @__PURE__ */ createElement("meta", { ...tag.attrs, key });
|
|
132
|
+
return /* @__PURE__ */ createElement("meta", { ...tag.attrs, "data-riebeckite-head": "page", key });
|
|
132
133
|
}
|
|
133
134
|
if (tag.tag === "link") {
|
|
134
|
-
return /* @__PURE__ */ createElement("link", { ...tag.attrs, key });
|
|
135
|
+
return /* @__PURE__ */ createElement("link", { ...tag.attrs, "data-riebeckite-head": "page", key });
|
|
135
136
|
}
|
|
136
137
|
return /* @__PURE__ */ createElement(
|
|
137
138
|
"script",
|
|
138
139
|
{
|
|
139
140
|
...tag.attrs,
|
|
141
|
+
"data-riebeckite-head": isDataScript(tag) ? "page" : void 0,
|
|
140
142
|
key,
|
|
141
143
|
dangerouslySetInnerHTML: tag.children ? { __html: tag.children } : void 0
|
|
142
144
|
}
|
|
143
145
|
);
|
|
144
146
|
}
|
|
147
|
+
function isDataScript(tag) {
|
|
148
|
+
if (tag.tag !== "script") return false;
|
|
149
|
+
const type = tag.attrs?.type?.trim().toLowerCase();
|
|
150
|
+
return type === "application/ld+json" || type === "application/json";
|
|
151
|
+
}
|
|
145
152
|
function RiebeckiteHead(props) {
|
|
146
153
|
const site = useSiteContext();
|
|
147
154
|
const faviconHref = props.faviconHref === void 0 ? "/favicon.ico" : props.faviconHref;
|
|
@@ -155,11 +162,228 @@ function RiebeckiteHead(props) {
|
|
|
155
162
|
faviconHref ? /* @__PURE__ */ jsx("link", { rel: "icon", href: faviconHref }) : null,
|
|
156
163
|
colorModeScript ? /* @__PURE__ */ jsx(ColorModeScript, {}) : null,
|
|
157
164
|
stylesheets.map((href) => /* @__PURE__ */ jsx(Link, { href, rel: "stylesheet", prod: props.prod }, href)),
|
|
165
|
+
props.themeStyle ? /* @__PURE__ */ jsx("style", { dangerouslySetInnerHTML: { __html: props.themeStyle } }) : null,
|
|
166
|
+
props.themeStylesheets?.map((href) => /* @__PURE__ */ jsx(Link, { href, rel: "stylesheet", prod: props.prod }, href)),
|
|
158
167
|
/* @__PURE__ */ jsx(PluginHeadTags, { tags: props.headTags ?? site?.headTags }),
|
|
159
168
|
clientSrc ? /* @__PURE__ */ jsx(Script, { src: clientSrc, async: true, prod: props.prod }) : null,
|
|
160
169
|
props.children
|
|
161
170
|
] });
|
|
162
171
|
}
|
|
172
|
+
function SeoHead(props) {
|
|
173
|
+
const { seo } = props;
|
|
174
|
+
const twitterCard = seo.imageUrl ? "summary_large_image" : "summary";
|
|
175
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
176
|
+
/* @__PURE__ */ jsx(
|
|
177
|
+
"meta",
|
|
178
|
+
{
|
|
179
|
+
name: "description",
|
|
180
|
+
content: seo.description,
|
|
181
|
+
"data-riebeckite-head": "page"
|
|
182
|
+
}
|
|
183
|
+
),
|
|
184
|
+
props.author ? /* @__PURE__ */ jsx(
|
|
185
|
+
"meta",
|
|
186
|
+
{
|
|
187
|
+
name: "author",
|
|
188
|
+
content: props.author,
|
|
189
|
+
"data-riebeckite-head": "page"
|
|
190
|
+
}
|
|
191
|
+
) : null,
|
|
192
|
+
seo.noindex ? /* @__PURE__ */ jsx(
|
|
193
|
+
"meta",
|
|
194
|
+
{
|
|
195
|
+
name: "robots",
|
|
196
|
+
content: "noindex, nofollow",
|
|
197
|
+
"data-riebeckite-head": "page"
|
|
198
|
+
}
|
|
199
|
+
) : null,
|
|
200
|
+
/* @__PURE__ */ jsx("title", { children: seo.title }),
|
|
201
|
+
seo.canonicalUrl ? /* @__PURE__ */ jsx(
|
|
202
|
+
"link",
|
|
203
|
+
{
|
|
204
|
+
rel: "canonical",
|
|
205
|
+
href: seo.canonicalUrl,
|
|
206
|
+
"data-riebeckite-head": "page"
|
|
207
|
+
}
|
|
208
|
+
) : null,
|
|
209
|
+
/* @__PURE__ */ jsx(
|
|
210
|
+
"meta",
|
|
211
|
+
{
|
|
212
|
+
property: "og:title",
|
|
213
|
+
content: seo.title,
|
|
214
|
+
"data-riebeckite-head": "page"
|
|
215
|
+
}
|
|
216
|
+
),
|
|
217
|
+
/* @__PURE__ */ jsx(
|
|
218
|
+
"meta",
|
|
219
|
+
{
|
|
220
|
+
property: "og:description",
|
|
221
|
+
content: seo.description,
|
|
222
|
+
"data-riebeckite-head": "page"
|
|
223
|
+
}
|
|
224
|
+
),
|
|
225
|
+
/* @__PURE__ */ jsx("meta", { property: "og:type", content: seo.type, "data-riebeckite-head": "page" }),
|
|
226
|
+
seo.canonicalUrl ? /* @__PURE__ */ jsx(
|
|
227
|
+
"meta",
|
|
228
|
+
{
|
|
229
|
+
property: "og:url",
|
|
230
|
+
content: seo.canonicalUrl,
|
|
231
|
+
"data-riebeckite-head": "page"
|
|
232
|
+
}
|
|
233
|
+
) : null,
|
|
234
|
+
/* @__PURE__ */ jsx(
|
|
235
|
+
"meta",
|
|
236
|
+
{
|
|
237
|
+
property: "og:site_name",
|
|
238
|
+
content: props.siteTitle,
|
|
239
|
+
"data-riebeckite-head": "page"
|
|
240
|
+
}
|
|
241
|
+
),
|
|
242
|
+
props.ogLocale ? /* @__PURE__ */ jsx(
|
|
243
|
+
"meta",
|
|
244
|
+
{
|
|
245
|
+
property: "og:locale",
|
|
246
|
+
content: props.ogLocale,
|
|
247
|
+
"data-riebeckite-head": "page"
|
|
248
|
+
}
|
|
249
|
+
) : null,
|
|
250
|
+
props.ogAlternates?.map((locale) => /* @__PURE__ */ jsx(
|
|
251
|
+
"meta",
|
|
252
|
+
{
|
|
253
|
+
property: "og:locale:alternate",
|
|
254
|
+
content: locale,
|
|
255
|
+
"data-riebeckite-head": "page"
|
|
256
|
+
},
|
|
257
|
+
locale
|
|
258
|
+
)),
|
|
259
|
+
seo.imageUrl ? /* @__PURE__ */ jsx(
|
|
260
|
+
"meta",
|
|
261
|
+
{
|
|
262
|
+
property: "og:image",
|
|
263
|
+
content: seo.imageUrl,
|
|
264
|
+
"data-riebeckite-head": "page"
|
|
265
|
+
}
|
|
266
|
+
) : null,
|
|
267
|
+
seo.publishedTime ? /* @__PURE__ */ jsx(
|
|
268
|
+
"meta",
|
|
269
|
+
{
|
|
270
|
+
property: "article:published_time",
|
|
271
|
+
content: seo.publishedTime,
|
|
272
|
+
"data-riebeckite-head": "page"
|
|
273
|
+
}
|
|
274
|
+
) : null,
|
|
275
|
+
seo.modifiedTime ? /* @__PURE__ */ jsx(
|
|
276
|
+
"meta",
|
|
277
|
+
{
|
|
278
|
+
property: "article:modified_time",
|
|
279
|
+
content: seo.modifiedTime,
|
|
280
|
+
"data-riebeckite-head": "page"
|
|
281
|
+
}
|
|
282
|
+
) : null,
|
|
283
|
+
seo.tags.map((tag) => /* @__PURE__ */ jsx(
|
|
284
|
+
"meta",
|
|
285
|
+
{
|
|
286
|
+
property: "article:tag",
|
|
287
|
+
content: tag,
|
|
288
|
+
"data-riebeckite-head": "page"
|
|
289
|
+
},
|
|
290
|
+
tag
|
|
291
|
+
)),
|
|
292
|
+
/* @__PURE__ */ jsx(
|
|
293
|
+
"meta",
|
|
294
|
+
{
|
|
295
|
+
name: "twitter:card",
|
|
296
|
+
content: twitterCard,
|
|
297
|
+
"data-riebeckite-head": "page"
|
|
298
|
+
}
|
|
299
|
+
),
|
|
300
|
+
/* @__PURE__ */ jsx(
|
|
301
|
+
"meta",
|
|
302
|
+
{
|
|
303
|
+
name: "twitter:title",
|
|
304
|
+
content: seo.title,
|
|
305
|
+
"data-riebeckite-head": "page"
|
|
306
|
+
}
|
|
307
|
+
),
|
|
308
|
+
/* @__PURE__ */ jsx(
|
|
309
|
+
"meta",
|
|
310
|
+
{
|
|
311
|
+
name: "twitter:description",
|
|
312
|
+
content: seo.description,
|
|
313
|
+
"data-riebeckite-head": "page"
|
|
314
|
+
}
|
|
315
|
+
),
|
|
316
|
+
props.twitterSite ? /* @__PURE__ */ jsx(
|
|
317
|
+
"meta",
|
|
318
|
+
{
|
|
319
|
+
name: "twitter:site",
|
|
320
|
+
content: props.twitterSite,
|
|
321
|
+
"data-riebeckite-head": "page"
|
|
322
|
+
}
|
|
323
|
+
) : null,
|
|
324
|
+
seo.imageUrl ? /* @__PURE__ */ jsx(
|
|
325
|
+
"meta",
|
|
326
|
+
{
|
|
327
|
+
name: "twitter:image",
|
|
328
|
+
content: seo.imageUrl,
|
|
329
|
+
"data-riebeckite-head": "page"
|
|
330
|
+
}
|
|
331
|
+
) : null,
|
|
332
|
+
props.feedLinks?.map((feed) => /* @__PURE__ */ jsx(
|
|
333
|
+
"link",
|
|
334
|
+
{
|
|
335
|
+
rel: "alternate",
|
|
336
|
+
type: feed.type,
|
|
337
|
+
href: feed.href,
|
|
338
|
+
"data-riebeckite-head": "global"
|
|
339
|
+
},
|
|
340
|
+
feed.href
|
|
341
|
+
)),
|
|
342
|
+
seo.jsonLd ? /* @__PURE__ */ jsx(
|
|
343
|
+
"script",
|
|
344
|
+
{
|
|
345
|
+
type: "application/ld+json",
|
|
346
|
+
"data-riebeckite-head": "page",
|
|
347
|
+
dangerouslySetInnerHTML: {
|
|
348
|
+
__html: escapeScriptJson(JSON.stringify(seo.jsonLd))
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
) : null
|
|
352
|
+
] });
|
|
353
|
+
}
|
|
354
|
+
function getThemeStyle(tokens) {
|
|
355
|
+
const variables = [
|
|
356
|
+
["--rb-color-paper", tokens.color?.paper],
|
|
357
|
+
["--rb-color-ink", tokens.color?.ink],
|
|
358
|
+
["--rb-color-muted", tokens.color?.muted],
|
|
359
|
+
["--rb-color-accent", tokens.color?.accent],
|
|
360
|
+
["--rb-color-link", tokens.color?.link],
|
|
361
|
+
["--rb-color-focus", tokens.color?.focus],
|
|
362
|
+
["--rb-color-selected", tokens.color?.selected],
|
|
363
|
+
["--rb-color-border", tokens.color?.border],
|
|
364
|
+
["--rb-color-border-strong", tokens.color?.borderStrong],
|
|
365
|
+
["--rb-color-surface", tokens.color?.surface],
|
|
366
|
+
["--rb-color-surface-hover", tokens.color?.surfaceHover],
|
|
367
|
+
["--rb-color-overlay", tokens.color?.overlay],
|
|
368
|
+
["--rb-color-danger", tokens.color?.danger],
|
|
369
|
+
["--rb-color-success", tokens.color?.success],
|
|
370
|
+
["--rb-color-code-background", tokens.color?.codeBackground],
|
|
371
|
+
["--rb-color-code-ink", tokens.color?.codeInk],
|
|
372
|
+
["--rb-color-code-inline", tokens.color?.codeInline],
|
|
373
|
+
["--rb-font-body", tokens.typography?.bodyFont],
|
|
374
|
+
["--rb-font-heading", tokens.typography?.headingFont],
|
|
375
|
+
["--rb-font-mono", tokens.typography?.monoFont],
|
|
376
|
+
["--rb-layout-page-max", tokens.layout?.pageMaxWidth],
|
|
377
|
+
["--rb-layout-article-max", tokens.layout?.articleMaxWidth],
|
|
378
|
+
["--rb-layout-sidebar", tokens.layout?.sidebarWidth],
|
|
379
|
+
["--rb-layout-gap", tokens.layout?.contentGap]
|
|
380
|
+
];
|
|
381
|
+
const declarations = variables.filter((variable) => Boolean(variable[1])).map(([name, value]) => `${name}: ${value};`);
|
|
382
|
+
return declarations.length === 0 ? "" : `:root { ${declarations.join(" ")} }`;
|
|
383
|
+
}
|
|
384
|
+
function getThemeStylesheets(userCss) {
|
|
385
|
+
return uniqueStrings([...userCss]);
|
|
386
|
+
}
|
|
163
387
|
function joinClassNames(...classNames) {
|
|
164
388
|
return classNames.filter(Boolean).join(" ");
|
|
165
389
|
}
|
|
@@ -175,7 +399,10 @@ export {
|
|
|
175
399
|
PageBody,
|
|
176
400
|
PluginHeadTags,
|
|
177
401
|
RiebeckiteHead,
|
|
402
|
+
SeoHead,
|
|
178
403
|
Sidebar,
|
|
179
404
|
ThemeRoot,
|
|
405
|
+
getThemeStyle,
|
|
406
|
+
getThemeStylesheets,
|
|
180
407
|
themeRootAttributes
|
|
181
408
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ResolvedRiebeckiteConfig, Tracer } from "@riebeckite/core";
|
|
2
2
|
import { type RiebeckiteConfigLoaderOptions } from "./config_loader.js";
|
|
3
|
-
|
|
3
|
+
type HonoxApplicationOptions = {
|
|
4
4
|
root: string;
|
|
5
5
|
tracer?: Tracer;
|
|
6
6
|
server?: {
|
|
@@ -8,7 +8,7 @@ export type HonoxApplicationOptions = {
|
|
|
8
8
|
open?: boolean;
|
|
9
9
|
port?: number;
|
|
10
10
|
};
|
|
11
|
-
onServerReady?: (urls: readonly string[]) => void
|
|
11
|
+
onServerReady?: (urls: readonly string[]) => void | Promise<void>;
|
|
12
12
|
restartOnChange?: readonly string[];
|
|
13
13
|
};
|
|
14
14
|
export type ResolvedHonoxApplication = {
|
|
@@ -29,3 +29,4 @@ export declare class HonoxApplicationRootError extends Error {
|
|
|
29
29
|
export declare function resolveHonoxApplication(options: ResolveHonoxApplicationOptions): Promise<ResolvedHonoxApplication>;
|
|
30
30
|
export declare function startHonoxDevServer(options: HonoxApplicationOptions): Promise<void>;
|
|
31
31
|
export declare function buildHonoxApplication(options: HonoxApplicationOptions): Promise<void>;
|
|
32
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riebeckite/honox",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.33",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -40,18 +40,20 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@babel/parser": "^7.29.3",
|
|
43
|
+
"@riebeckite/core": "0.0.33",
|
|
44
|
+
"@riebeckite/diagnostics": "0.0.33",
|
|
45
|
+
"@riebeckite/node": "0.0.33",
|
|
46
|
+
"@riebeckite/plugin-color-mode": "0.0.33",
|
|
47
|
+
"@riebeckite/spa": "0.0.33",
|
|
48
|
+
"@riebeckite/ui": "0.0.33",
|
|
43
49
|
"esbuild": "^0.28.2",
|
|
44
50
|
"hono": "^4.12.25",
|
|
45
51
|
"honox": "0.1.56",
|
|
46
|
-
"vite": "^8.
|
|
47
|
-
"@riebeckite/core": "0.0.31",
|
|
48
|
-
"@riebeckite/diagnostics": "0.0.31",
|
|
49
|
-
"@riebeckite/plugin-color-mode": "0.0.31",
|
|
50
|
-
"@riebeckite/ui": "0.0.31"
|
|
52
|
+
"vite": "^8.3.5"
|
|
51
53
|
},
|
|
52
54
|
"devDependencies": {
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
+
"@riebeckite/test": "0.0.33",
|
|
56
|
+
"tsx": "^4.22.4"
|
|
55
57
|
},
|
|
56
58
|
"publishConfig": {
|
|
57
59
|
"access": "public"
|