@riebeckite/honox 0.0.25 → 0.0.27

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/server.js CHANGED
@@ -306,16 +306,7 @@ async function renderContent(c, options, entry, post) {
306
306
  const publicEntry = view.findRoutableBySlug(entry.slug);
307
307
  if (!publicEntry) return c.notFound();
308
308
  return c.render(
309
- /* @__PURE__ */ jsx2(
310
- SiteProvider,
311
- {
312
- config: options.config,
313
- manifest,
314
- view,
315
- path: c.req.path,
316
- children: /* @__PURE__ */ jsx2(ArticleProvider, { entry: publicEntry, post, children: options.render({ entry, post }) })
317
- }
318
- )
309
+ /* @__PURE__ */ jsx2(ArticleProvider, { entry: publicEntry, post, children: options.render({ entry, post }) })
319
310
  );
320
311
  }
321
312
  export {
@@ -68,7 +68,7 @@ export declare function PageBody(props: PageBodyProps): import("hono/jsx/jsx-dev
68
68
  export declare function ArticleFooter(props: ArticleFooterProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
69
69
  export declare function Sidebar(props: SidebarProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
70
70
  export type ThemeRootProps = {
71
- theme: ResolvedRiebeckiteConfig["theme"];
71
+ theme?: ResolvedRiebeckiteConfig["theme"];
72
72
  lang?: string;
73
73
  children?: PrimitiveChildren;
74
74
  };
@@ -96,7 +96,7 @@ export type PluginHeadTagsProps = {
96
96
  */
97
97
  export declare function PluginHeadTags(props: PluginHeadTagsProps): import("hono/jsx/jsx-dev-runtime").JSX.Element;
98
98
  export type RiebeckiteHeadProps = {
99
- title: string;
99
+ title?: string;
100
100
  headTags?: readonly PluginHeadTag[];
101
101
  faviconHref?: string | null;
102
102
  colorModeScript?: boolean;
@@ -124,7 +124,11 @@ function themeRootAttributes(theme) {
124
124
  };
125
125
  }
126
126
  function ThemeRoot(props) {
127
- return /* @__PURE__ */ jsx("html", { lang: props.lang, ...themeRootAttributes(props.theme), children: props.children });
127
+ const site = useSiteContext();
128
+ const theme = props.theme ?? site?.config.theme;
129
+ const lang = props.lang ?? site?.language ?? site?.config.site.locale;
130
+ if (!theme) return /* @__PURE__ */ jsx("html", { lang, children: props.children });
131
+ return /* @__PURE__ */ jsx("html", { lang, ...themeRootAttributes(theme), children: props.children });
128
132
  }
129
133
  function PluginHeadTags(props) {
130
134
  return /* @__PURE__ */ jsx(Fragment, { children: props.tags?.map(renderPluginHeadTag) });
@@ -147,6 +151,7 @@ function renderPluginHeadTag(tag, index) {
147
151
  );
148
152
  }
149
153
  function RiebeckiteHead(props) {
154
+ const site = useSiteContext();
150
155
  const faviconHref = props.faviconHref === void 0 ? "/favicon.ico" : props.faviconHref;
151
156
  const stylesheets = props.stylesheets ?? ["/app/style.css"];
152
157
  const clientSrc = props.clientSrc === void 0 ? "/app/client.ts" : props.clientSrc;
@@ -154,11 +159,11 @@ function RiebeckiteHead(props) {
154
159
  return /* @__PURE__ */ jsxs(Fragment, { children: [
155
160
  /* @__PURE__ */ jsx("meta", { charset: "utf-8" }),
156
161
  /* @__PURE__ */ jsx("meta", { name: "viewport", content: "width=device-width, initial-scale=1.0" }),
157
- /* @__PURE__ */ jsx("title", { children: props.title }),
162
+ /* @__PURE__ */ jsx("title", { children: props.title ?? site?.config.site.title }),
158
163
  faviconHref ? /* @__PURE__ */ jsx("link", { rel: "icon", href: faviconHref }) : null,
159
164
  colorModeScript ? /* @__PURE__ */ jsx(ColorModeScript, {}) : null,
160
165
  stylesheets.map((href) => /* @__PURE__ */ jsx(Link, { href, rel: "stylesheet", prod: props.prod }, href)),
161
- /* @__PURE__ */ jsx(PluginHeadTags, { tags: props.headTags }),
166
+ /* @__PURE__ */ jsx(PluginHeadTags, { tags: props.headTags ?? site?.headTags }),
162
167
  clientSrc ? /* @__PURE__ */ jsx(Script, { src: clientSrc, async: true, prod: props.prod }) : null,
163
168
  props.children
164
169
  ] });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riebeckite/honox",
3
- "version": "0.0.25",
3
+ "version": "0.0.27",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -44,13 +44,13 @@
44
44
  "hono": "^4.12.25",
45
45
  "honox": "0.1.56",
46
46
  "vite": "^8.0.9",
47
- "@riebeckite/core": "0.0.25",
48
- "@riebeckite/plugin-color-mode": "0.0.25",
49
- "@riebeckite/ui": "0.0.25"
47
+ "@riebeckite/core": "0.0.27",
48
+ "@riebeckite/ui": "0.0.27",
49
+ "@riebeckite/plugin-color-mode": "0.0.27"
50
50
  },
51
51
  "devDependencies": {
52
52
  "tsx": "^4.22.4",
53
- "@riebeckite/test": "0.0.25"
53
+ "@riebeckite/test": "0.0.27"
54
54
  },
55
55
  "publishConfig": {
56
56
  "access": "public"