@riebeckite/honox 0.0.16 → 0.0.17
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 +211 -207
- package/dist/src/scaffold/presets.js +18 -6
- package/dist/src/scaffold/templates.d.ts +1 -0
- package/dist/src/scaffold/version.d.ts +1 -1
- package/dist/src/ui/primitives.js +5 -17
- package/package.json +6 -2
package/dist/index.js
CHANGED
|
@@ -490,13 +490,8 @@ var l10n = np("@riebeckite/plugin-l10n", "l10n", (context) => {
|
|
|
490
490
|
return `{ defaultLang: ${JSON.stringify(defaultLang)}, languages: ${JSON.stringify(context.languages)} }`;
|
|
491
491
|
});
|
|
492
492
|
var seo = np("@riebeckite/plugin-seo", "seo", {
|
|
493
|
-
siteName: {
|
|
494
|
-
depth: 1,
|
|
495
|
-
value: (context) => JSON.stringify(context.variables.title)
|
|
496
|
-
},
|
|
497
493
|
sitemap: { depth: 1, value: "true" },
|
|
498
494
|
robots: { depth: 2, value: "true" },
|
|
499
|
-
defaultImage: { depth: 3, value: '"/ogp.png"' },
|
|
500
495
|
feed: { depth: 3, value: "{ rss: true, atom: true, json: true }" }
|
|
501
496
|
});
|
|
502
497
|
var toc = np("@riebeckite/plugin-toc", "tocPlugin");
|
|
@@ -517,6 +512,17 @@ var codeEnhance = np("@riebeckite/plugin-code-enhance", "codeEnhance", {
|
|
|
517
512
|
});
|
|
518
513
|
var search = np("@riebeckite/plugin-search", "searchPlugin");
|
|
519
514
|
var backlinks = np("@riebeckite/plugin-backlinks", "backlinksPlugin");
|
|
515
|
+
var breadcrumbs = np("@riebeckite/plugin-breadcrumbs", "breadcrumbsPlugin");
|
|
516
|
+
var navigationStarter = np(
|
|
517
|
+
"@riebeckite/plugin-navigation",
|
|
518
|
+
"navigation",
|
|
519
|
+
`{ items: [{ label: "Guide", href: "/guide" }, { label: "Examples", href: "/examples" }, { label: "Notes", href: "/notes/planning", children: [{ label: "Planning", href: "/notes/planning" }, { label: "Writing", href: "/notes/writing" }] }], secondary: [{ label: "Guide", href: "/guide" }, { label: "Examples", href: "/examples" }] }`
|
|
520
|
+
);
|
|
521
|
+
var navigationShowcase = np(
|
|
522
|
+
"@riebeckite/plugin-navigation",
|
|
523
|
+
"navigation",
|
|
524
|
+
`{ items: [{ label: "Guide", href: "/guide" }, { label: "Examples", href: "/examples" }, { label: "Framework", href: "/framework/plugins", children: [{ label: "Plugins", href: "/framework/plugins" }, { label: "Themes", href: "/framework/themes" }] }], secondary: [{ label: "Guide", href: "/guide" }, { label: "Examples", href: "/examples" }] }`
|
|
525
|
+
);
|
|
520
526
|
var relatedPosts = np("@riebeckite/plugin-related-posts", "relatedPosts", {
|
|
521
527
|
limit: { depth: 2, value: "5" },
|
|
522
528
|
useTags: { depth: 2, value: "true" },
|
|
@@ -615,6 +621,7 @@ var taxonomy = np("@riebeckite/plugin-taxonomy", "taxonomy", {
|
|
|
615
621
|
feeds: { depth: 3, value: "{ rss: true, atom: true, json: true }" },
|
|
616
622
|
relatedLimit: { depth: 3, value: "8" }
|
|
617
623
|
});
|
|
624
|
+
var folderPages = np("@riebeckite/plugin-folder-pages", "folderPagesPlugin");
|
|
618
625
|
var autoCardLink = np(
|
|
619
626
|
"@riebeckite/plugin-autocardlink",
|
|
620
627
|
"autoCardLinkPlugin",
|
|
@@ -803,7 +810,7 @@ var quality = np(
|
|
|
803
810
|
var deploy = np(
|
|
804
811
|
"@riebeckite/plugin-deploy",
|
|
805
812
|
"deployPlugin",
|
|
806
|
-
|
|
813
|
+
`{ provider: "cloudflare-pages" }`
|
|
807
814
|
);
|
|
808
815
|
var diagnostics = np(
|
|
809
816
|
"@riebeckite/plugin-diagnostics",
|
|
@@ -869,6 +876,8 @@ var starter = {
|
|
|
869
876
|
codeEnhance,
|
|
870
877
|
search,
|
|
871
878
|
backlinks,
|
|
879
|
+
breadcrumbs,
|
|
880
|
+
navigationStarter,
|
|
872
881
|
relatedPosts,
|
|
873
882
|
recentPosts,
|
|
874
883
|
responsiveImage,
|
|
@@ -896,6 +905,8 @@ var showcase = {
|
|
|
896
905
|
codeEnhance,
|
|
897
906
|
search,
|
|
898
907
|
backlinks,
|
|
908
|
+
breadcrumbs,
|
|
909
|
+
navigationShowcase,
|
|
899
910
|
relatedPosts,
|
|
900
911
|
share,
|
|
901
912
|
changelog,
|
|
@@ -912,6 +923,7 @@ var showcase = {
|
|
|
912
923
|
shortcodes,
|
|
913
924
|
series,
|
|
914
925
|
taxonomy,
|
|
926
|
+
folderPages,
|
|
915
927
|
autoCardLink,
|
|
916
928
|
richEmbed,
|
|
917
929
|
gallery,
|
|
@@ -2141,14 +2153,6 @@ function riebeckiteSsrExternals(externals) {
|
|
|
2141
2153
|
function hasScaffoldPlugin(preset, packageName) {
|
|
2142
2154
|
return preset.plugins.some((plugin) => plugin.package === packageName);
|
|
2143
2155
|
}
|
|
2144
|
-
function articleTitleHelper() {
|
|
2145
|
-
return `
|
|
2146
|
-
function getArticleTitle(slug: string, title: unknown): string {
|
|
2147
|
-
if (typeof title === "string" && title.trim().length > 0) return title;
|
|
2148
|
-
return slug.split("/").at(-1) ?? slug;
|
|
2149
|
-
}
|
|
2150
|
-
`;
|
|
2151
|
-
}
|
|
2152
2156
|
function server() {
|
|
2153
2157
|
return `import { mountRiebeckiteEndpoints } from "@riebeckite/honox/server";
|
|
2154
2158
|
import { createApp } from "honox/server";
|
|
@@ -2258,6 +2262,12 @@ function style(preset) {
|
|
|
2258
2262
|
imports.push('@import "./.riebeckite/theme-styles.css";');
|
|
2259
2263
|
}
|
|
2260
2264
|
const blocks = [
|
|
2265
|
+
"",
|
|
2266
|
+
"*,",
|
|
2267
|
+
"*::before,",
|
|
2268
|
+
"*::after {",
|
|
2269
|
+
" box-sizing: border-box;",
|
|
2270
|
+
"}",
|
|
2261
2271
|
"",
|
|
2262
2272
|
"body {",
|
|
2263
2273
|
" margin: 0;",
|
|
@@ -2265,21 +2275,39 @@ function style(preset) {
|
|
|
2265
2275
|
"}",
|
|
2266
2276
|
""
|
|
2267
2277
|
];
|
|
2278
|
+
if (preset.appFiles.includes("header") || preset.appFiles.includes("article")) {
|
|
2279
|
+
blocks.push(
|
|
2280
|
+
".riebeckite-page {",
|
|
2281
|
+
" display: flex;",
|
|
2282
|
+
" min-height: 100vh;",
|
|
2283
|
+
" width: 100%;",
|
|
2284
|
+
" flex-direction: column;",
|
|
2285
|
+
" align-items: center;",
|
|
2286
|
+
" padding-block: var(--rb-space-8, 4rem);",
|
|
2287
|
+
"}",
|
|
2288
|
+
""
|
|
2289
|
+
);
|
|
2290
|
+
}
|
|
2268
2291
|
if (preset.appFiles.includes("header")) {
|
|
2269
2292
|
blocks.push(
|
|
2270
2293
|
".site-header {",
|
|
2271
2294
|
" display: flex;",
|
|
2272
2295
|
" align-items: center;",
|
|
2273
|
-
"
|
|
2274
|
-
"
|
|
2275
|
-
" padding: 1rem;",
|
|
2296
|
+
" gap: var(--rb-space-3, 1.5rem);",
|
|
2297
|
+
" padding-block: var(--rb-space-3, 1.5rem);",
|
|
2276
2298
|
" border-bottom: 1px solid var(--rb-color-border);",
|
|
2277
2299
|
"}",
|
|
2278
2300
|
"",
|
|
2301
|
+
".site-header,",
|
|
2302
|
+
".rb-site-footer {",
|
|
2303
|
+
" width: min(100% - 2rem, var(--rb-layout-article-max, 48rem));",
|
|
2304
|
+
"}",
|
|
2305
|
+
"",
|
|
2279
2306
|
".site-header__home {",
|
|
2280
2307
|
" display: inline-flex;",
|
|
2281
2308
|
" align-items: center;",
|
|
2282
2309
|
" gap: 0.5rem;",
|
|
2310
|
+
" margin-right: auto;",
|
|
2283
2311
|
" color: var(--rb-color-ink);",
|
|
2284
2312
|
" font-weight: 700;",
|
|
2285
2313
|
" text-decoration: none;",
|
|
@@ -2292,7 +2320,7 @@ function style(preset) {
|
|
|
2292
2320
|
".rb-nav__list {",
|
|
2293
2321
|
" display: flex;",
|
|
2294
2322
|
" align-items: center;",
|
|
2295
|
-
" gap:
|
|
2323
|
+
" gap: var(--rb-space-3, 1.5rem);",
|
|
2296
2324
|
" margin: 0;",
|
|
2297
2325
|
" padding: 0;",
|
|
2298
2326
|
" list-style: none;",
|
|
@@ -2325,7 +2353,7 @@ function style(preset) {
|
|
|
2325
2353
|
" top: 100%;",
|
|
2326
2354
|
" left: 0;",
|
|
2327
2355
|
" min-width: max-content;",
|
|
2328
|
-
" padding:
|
|
2356
|
+
" padding: var(--rb-space-2, 1rem);",
|
|
2329
2357
|
" background: var(--rb-color-surface);",
|
|
2330
2358
|
" border: 1px solid var(--rb-color-border);",
|
|
2331
2359
|
"}",
|
|
@@ -2342,13 +2370,16 @@ function style(preset) {
|
|
|
2342
2370
|
"}",
|
|
2343
2371
|
"",
|
|
2344
2372
|
".rb-site-footer {",
|
|
2345
|
-
"
|
|
2346
|
-
"
|
|
2347
|
-
" padding-block: 1rem;",
|
|
2373
|
+
" margin-top: 1rem;",
|
|
2374
|
+
" padding-block: var(--rb-space-4, 2rem);",
|
|
2348
2375
|
" border-top: 1px solid var(--rb-color-border);",
|
|
2349
2376
|
"}",
|
|
2350
2377
|
"",
|
|
2351
2378
|
"@media (max-width: 48rem) {",
|
|
2379
|
+
" .riebeckite-page {",
|
|
2380
|
+
" padding-block: var(--rb-space-3, 1.5rem);",
|
|
2381
|
+
" }",
|
|
2382
|
+
"",
|
|
2352
2383
|
" .rb-site-header {",
|
|
2353
2384
|
" flex-wrap: wrap;",
|
|
2354
2385
|
" }",
|
|
@@ -2358,22 +2389,39 @@ function style(preset) {
|
|
|
2358
2389
|
" }",
|
|
2359
2390
|
"",
|
|
2360
2391
|
" .rb-nav__mobile {",
|
|
2392
|
+
" position: relative;",
|
|
2361
2393
|
" display: block;",
|
|
2362
2394
|
" }",
|
|
2363
2395
|
"",
|
|
2364
|
-
" .rb-nav__mobile .rb-
|
|
2365
|
-
"
|
|
2366
|
-
"
|
|
2367
|
-
"
|
|
2396
|
+
" .rb-nav__mobile > .rb-nav {",
|
|
2397
|
+
" position: absolute;",
|
|
2398
|
+
" z-index: 10;",
|
|
2399
|
+
" top: calc(100% + var(--rb-space-2, 1rem));",
|
|
2400
|
+
" right: 0;",
|
|
2401
|
+
" min-width: 12rem;",
|
|
2402
|
+
" padding: var(--rb-space-3, 1.5rem);",
|
|
2403
|
+
" background: var(--rb-color-surface);",
|
|
2404
|
+
" border: 1px solid var(--rb-color-border);",
|
|
2405
|
+
" box-shadow: 0 4px 12px",
|
|
2406
|
+
" color-mix(in oklab, var(--rb-color-ink) 14%, transparent);",
|
|
2368
2407
|
" }",
|
|
2369
2408
|
"",
|
|
2409
|
+
" .rb-nav__mobile .rb-nav__list,",
|
|
2370
2410
|
" .rb-nav__mobile .rb-nav__children {",
|
|
2371
2411
|
" display: flex;",
|
|
2372
|
-
" position: static;",
|
|
2373
2412
|
" flex-direction: column;",
|
|
2374
2413
|
" align-items: flex-start;",
|
|
2375
|
-
" gap:
|
|
2376
|
-
"
|
|
2414
|
+
" gap: var(--rb-space-2, 1rem);",
|
|
2415
|
+
" }",
|
|
2416
|
+
"",
|
|
2417
|
+
" .rb-nav__mobile .rb-nav__list {",
|
|
2418
|
+
" padding: 0;",
|
|
2419
|
+
" }",
|
|
2420
|
+
"",
|
|
2421
|
+
" .rb-nav__mobile .rb-nav__children {",
|
|
2422
|
+
" position: static;",
|
|
2423
|
+
" margin-top: var(--rb-space-2, 1rem);",
|
|
2424
|
+
" padding: 0;",
|
|
2377
2425
|
" background: transparent;",
|
|
2378
2426
|
" border: 0;",
|
|
2379
2427
|
" }",
|
|
@@ -2391,18 +2439,23 @@ function style(preset) {
|
|
|
2391
2439
|
blocks.push(
|
|
2392
2440
|
".site-article {",
|
|
2393
2441
|
" display: block;",
|
|
2394
|
-
"
|
|
2395
|
-
" padding: 2rem
|
|
2442
|
+
" width: min(100% - 2rem, var(--rb-layout-article-max, 48rem));",
|
|
2443
|
+
" padding-block: 2rem;",
|
|
2396
2444
|
" margin: 0 auto;",
|
|
2397
2445
|
"}",
|
|
2398
2446
|
"",
|
|
2399
|
-
".article-
|
|
2447
|
+
".rb-article-layout {",
|
|
2400
2448
|
" display: grid;",
|
|
2401
|
-
" grid-template-columns: minmax(0,
|
|
2449
|
+
" grid-template-columns: minmax(0, var(--rb-layout-article-max, 48rem));",
|
|
2402
2450
|
" justify-content: center;",
|
|
2403
2451
|
" gap: var(--rb-layout-gap, 2rem);",
|
|
2404
2452
|
"}",
|
|
2405
2453
|
"",
|
|
2454
|
+
".rb-article-body {",
|
|
2455
|
+
" min-width: 0;",
|
|
2456
|
+
" padding-inline: var(--rb-space-2, 1rem);",
|
|
2457
|
+
"}",
|
|
2458
|
+
"",
|
|
2406
2459
|
".site-article__aside {",
|
|
2407
2460
|
" display: none;",
|
|
2408
2461
|
"}",
|
|
@@ -2412,12 +2465,12 @@ function style(preset) {
|
|
|
2412
2465
|
"}",
|
|
2413
2466
|
"",
|
|
2414
2467
|
"@media (min-width: 88rem) {",
|
|
2415
|
-
' :is(:root, .rb-theme-root)[data-article-layout="article"] .article-
|
|
2468
|
+
' :is(:root, .rb-theme-root)[data-article-layout="article"] .rb-article-layout {',
|
|
2416
2469
|
" grid-template-columns: minmax(0, var(--rb-layout-article-max, 48rem));",
|
|
2417
2470
|
" position: relative;",
|
|
2418
2471
|
" }",
|
|
2419
2472
|
"",
|
|
2420
|
-
' :is(:root, .rb-theme-root)[data-article-layout="article"] .article-
|
|
2473
|
+
' :is(:root, .rb-theme-root)[data-article-layout="article"] .rb-article-body {',
|
|
2421
2474
|
" grid-column: 1;",
|
|
2422
2475
|
" grid-row: 1;",
|
|
2423
2476
|
" }",
|
|
@@ -2461,12 +2514,18 @@ function style(preset) {
|
|
|
2461
2514
|
return [...imports, ...blocks].join("\n");
|
|
2462
2515
|
}
|
|
2463
2516
|
function siteHeader() {
|
|
2464
|
-
return `import type { NavigationItem } from "@riebeckite/
|
|
2517
|
+
return `import type { NavigationItem } from "@riebeckite/plugin-navigation";
|
|
2465
2518
|
import { ColorModeToggle } from "@riebeckite/plugin-color-mode";
|
|
2466
2519
|
import { config } from "../config";
|
|
2467
2520
|
|
|
2468
|
-
export function SiteHeader({
|
|
2469
|
-
|
|
2521
|
+
export function SiteHeader({
|
|
2522
|
+
path,
|
|
2523
|
+
items,
|
|
2524
|
+
}: {
|
|
2525
|
+
path: string;
|
|
2526
|
+
items: readonly NavigationItem[];
|
|
2527
|
+
}) {
|
|
2528
|
+
const navigation = items.filter((item) => item.href !== "/");
|
|
2470
2529
|
|
|
2471
2530
|
return (
|
|
2472
2531
|
<header class="site-header rb-site-header">
|
|
@@ -2494,13 +2553,18 @@ export function SiteHeader({ path }: { path: string }) {
|
|
|
2494
2553
|
);
|
|
2495
2554
|
}
|
|
2496
2555
|
|
|
2497
|
-
export function SiteFooter({
|
|
2498
|
-
|
|
2499
|
-
|
|
2556
|
+
export function SiteFooter({
|
|
2557
|
+
path,
|
|
2558
|
+
items,
|
|
2559
|
+
}: {
|
|
2560
|
+
path: string;
|
|
2561
|
+
items: readonly NavigationItem[];
|
|
2562
|
+
}) {
|
|
2563
|
+
if (items.length === 0) return null;
|
|
2500
2564
|
|
|
2501
2565
|
return (
|
|
2502
2566
|
<footer class="site-footer rb-site-footer">
|
|
2503
|
-
<SiteNavigation items={
|
|
2567
|
+
<SiteNavigation items={items} path={path} />
|
|
2504
2568
|
</footer>
|
|
2505
2569
|
);
|
|
2506
2570
|
}
|
|
@@ -2531,18 +2595,22 @@ function NavigationItems({
|
|
|
2531
2595
|
return (
|
|
2532
2596
|
<ul class={isChildList ? "site-navigation__list rb-nav__list rb-nav__children" : "site-navigation__list rb-nav__list"}>
|
|
2533
2597
|
{items.map((item) => {
|
|
2534
|
-
const active = isActive(item.href, path);
|
|
2598
|
+
const active = item.href ? isActive(item.href, path) : false;
|
|
2535
2599
|
return (
|
|
2536
2600
|
<li class="site-navigation__item rb-nav__item">
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2601
|
+
{item.href ? (
|
|
2602
|
+
<a
|
|
2603
|
+
href={item.href}
|
|
2604
|
+
class={active ? "site-navigation__link rb-nav__link rb-nav__link--active is-active" : "site-navigation__link rb-nav__link"}
|
|
2605
|
+
aria-current={active ? "page" : undefined}
|
|
2606
|
+
target={item.external ? "_blank" : undefined}
|
|
2607
|
+
rel={item.external ? "noreferrer" : undefined}
|
|
2608
|
+
>
|
|
2609
|
+
{item.label}
|
|
2610
|
+
</a>
|
|
2611
|
+
) : (
|
|
2612
|
+
<span class="site-navigation__label rb-nav__label">{item.label}</span>
|
|
2613
|
+
)}
|
|
2546
2614
|
{item.children && item.children.length > 0 ? (
|
|
2547
2615
|
<NavigationItems items={item.children} path={path} isChildList />
|
|
2548
2616
|
) : null}
|
|
@@ -2567,25 +2635,13 @@ import { Article, ArticleContent, ArticleLayout } from "@riebeckite/honox/ui";
|
|
|
2567
2635
|
|
|
2568
2636
|
export function SiteArticle({
|
|
2569
2637
|
post,
|
|
2570
|
-
|
|
2571
|
-
afterHeaderHtml,
|
|
2572
|
-
afterMetaHtml,
|
|
2573
|
-
beforeContentHtml,
|
|
2574
|
-
afterContentHtml,
|
|
2575
|
-
asideHtml,
|
|
2576
|
-
footerHtml,
|
|
2638
|
+
bodySlots,
|
|
2577
2639
|
asideContent,
|
|
2578
2640
|
afterContent,
|
|
2579
2641
|
footerContent,
|
|
2580
2642
|
}: {
|
|
2581
2643
|
post: PostContent;
|
|
2582
|
-
|
|
2583
|
-
afterHeaderHtml?: string;
|
|
2584
|
-
afterMetaHtml?: string;
|
|
2585
|
-
beforeContentHtml?: string;
|
|
2586
|
-
afterContentHtml?: string;
|
|
2587
|
-
asideHtml?: string;
|
|
2588
|
-
footerHtml?: string;
|
|
2644
|
+
bodySlots?: Readonly<Record<string, string>>;
|
|
2589
2645
|
asideContent?: unknown;
|
|
2590
2646
|
afterContent?: unknown;
|
|
2591
2647
|
footerContent?: unknown;
|
|
@@ -2594,50 +2650,44 @@ export function SiteArticle({
|
|
|
2594
2650
|
<Article class="site-article">
|
|
2595
2651
|
<ArticleLayout>
|
|
2596
2652
|
{asideContent}
|
|
2597
|
-
{
|
|
2653
|
+
{bodySlots?.["article.aside"] ? (
|
|
2598
2654
|
<div
|
|
2599
2655
|
class="site-article__aside"
|
|
2600
|
-
dangerouslySetInnerHTML={{ __html:
|
|
2656
|
+
dangerouslySetInnerHTML={{ __html: bodySlots["article.aside"] }}
|
|
2601
2657
|
/>
|
|
2602
2658
|
) : null}
|
|
2603
2659
|
<ArticleContent>
|
|
2604
|
-
{
|
|
2605
|
-
<div
|
|
2606
|
-
class="site-article__after-header"
|
|
2607
|
-
dangerouslySetInnerHTML={{ __html: afterHeaderHtml }}
|
|
2608
|
-
/>
|
|
2609
|
-
) : null}
|
|
2610
|
-
{propertiesHtml ? (
|
|
2660
|
+
{bodySlots?.["article.header"] ? (
|
|
2611
2661
|
<div
|
|
2612
|
-
class="
|
|
2613
|
-
dangerouslySetInnerHTML={{ __html:
|
|
2662
|
+
class="site-article__header"
|
|
2663
|
+
dangerouslySetInnerHTML={{ __html: bodySlots["article.header"] }}
|
|
2614
2664
|
/>
|
|
2615
2665
|
) : null}
|
|
2616
|
-
{
|
|
2666
|
+
{bodySlots?.["article.metadata"] ? (
|
|
2617
2667
|
<div
|
|
2618
|
-
class="site-
|
|
2619
|
-
dangerouslySetInnerHTML={{ __html:
|
|
2668
|
+
class="site-article__metadata"
|
|
2669
|
+
dangerouslySetInnerHTML={{ __html: bodySlots["article.metadata"] }}
|
|
2620
2670
|
/>
|
|
2621
2671
|
) : null}
|
|
2622
|
-
{
|
|
2672
|
+
{bodySlots?.["article.before-content"] ? (
|
|
2623
2673
|
<div
|
|
2624
2674
|
class="site-article__before-content"
|
|
2625
|
-
dangerouslySetInnerHTML={{ __html:
|
|
2675
|
+
dangerouslySetInnerHTML={{ __html: bodySlots["article.before-content"] }}
|
|
2626
2676
|
/>
|
|
2627
2677
|
) : null}
|
|
2628
2678
|
<div dangerouslySetInnerHTML={{ __html: post.html ?? "" }} />
|
|
2629
2679
|
{afterContent}
|
|
2630
|
-
{
|
|
2680
|
+
{bodySlots?.["article.after-content"] ? (
|
|
2631
2681
|
<div
|
|
2632
2682
|
class="site-article__after-content"
|
|
2633
|
-
dangerouslySetInnerHTML={{ __html:
|
|
2683
|
+
dangerouslySetInnerHTML={{ __html: bodySlots["article.after-content"] }}
|
|
2634
2684
|
/>
|
|
2635
2685
|
) : null}
|
|
2636
2686
|
</ArticleContent>
|
|
2637
|
-
{
|
|
2687
|
+
{bodySlots?.["article.footer"] || footerContent ? (
|
|
2638
2688
|
<div class="site-article__footer">
|
|
2639
|
-
{
|
|
2640
|
-
<div dangerouslySetInnerHTML={{ __html:
|
|
2689
|
+
{bodySlots?.["article.footer"] ? (
|
|
2690
|
+
<div dangerouslySetInnerHTML={{ __html: bodySlots["article.footer"] }} />
|
|
2641
2691
|
) : null}
|
|
2642
2692
|
{footerContent}
|
|
2643
2693
|
</div>
|
|
@@ -2660,7 +2710,9 @@ import { jsxRenderer } from "hono/jsx-renderer";
|
|
|
2660
2710
|
import { Link, Script } from "honox/server";
|
|
2661
2711
|
${hasColorMode ? `import { ColorModeScript } from "@riebeckite/plugin-color-mode";
|
|
2662
2712
|
` : ""}${hasSearch ? `import { SearchBar } from "@riebeckite/plugin-search";
|
|
2713
|
+
` : ""}${hasHeader ? `import { resolveSiteNavigation } from "@riebeckite/plugin-navigation";
|
|
2663
2714
|
` : ""}${hasHeader ? `import { SiteFooter, SiteHeader } from "../components/site-header";
|
|
2715
|
+
` : ""}${hasHeader ? `import { content } from "../content";
|
|
2664
2716
|
` : ""}import { config } from "../config";
|
|
2665
2717
|
|
|
2666
2718
|
function themeAttributes() {
|
|
@@ -2679,9 +2731,10 @@ function themeAttributes() {
|
|
|
2679
2731
|
// an island component.
|
|
2680
2732
|
export const __importing_islands = true;
|
|
2681
2733
|
|
|
2682
|
-
export default jsxRenderer(({ children }, c) => {
|
|
2734
|
+
export default jsxRenderer(async ({ children }, c) => {
|
|
2683
2735
|
const headTags: readonly PluginHeadTag[] = c.get("headTags") ?? [];
|
|
2684
|
-
|
|
2736
|
+
${hasHeader ? ` const navigation = resolveSiteNavigation(config, await content.getManifest(), c.get("htmlLanguage")) ?? { primary: [], secondary: [] };
|
|
2737
|
+
` : ""}
|
|
2685
2738
|
return (
|
|
2686
2739
|
<html
|
|
2687
2740
|
lang={c.get("htmlLanguage") ?? config.site.locale}
|
|
@@ -2698,10 +2751,10 @@ ${hasColorMode ? ` <ColorModeScript />
|
|
|
2698
2751
|
<Script src="/app/client.ts" async />
|
|
2699
2752
|
</head>
|
|
2700
2753
|
<body class="riebeckite-page rb-site">
|
|
2701
|
-
${hasHeader ? ` <SiteHeader path={c.req.path} />
|
|
2754
|
+
${hasHeader ? ` <SiteHeader path={c.req.path} items={navigation.primary} />
|
|
2702
2755
|
` : ""}${hasSearch ? ` <SearchBar />
|
|
2703
2756
|
` : ""} {children}
|
|
2704
|
-
${hasHeader ? ` <SiteFooter path={c.req.path} />
|
|
2757
|
+
${hasHeader ? ` <SiteFooter path={c.req.path} items={navigation.secondary} />
|
|
2705
2758
|
` : ""} </body>
|
|
2706
2759
|
</html>
|
|
2707
2760
|
);
|
|
@@ -2750,10 +2803,6 @@ export default jsxRenderer(({ children }, c) => (
|
|
|
2750
2803
|
function indexRoute(preset) {
|
|
2751
2804
|
if (!preset.appFiles.includes("article")) return staticIndexRoute();
|
|
2752
2805
|
const hasToc = hasScaffoldPlugin(preset, "@riebeckite/plugin-toc");
|
|
2753
|
-
const hasBacklinks = hasScaffoldPlugin(
|
|
2754
|
-
preset,
|
|
2755
|
-
"@riebeckite/plugin-backlinks"
|
|
2756
|
-
);
|
|
2757
2806
|
const hasRecentPosts = hasScaffoldPlugin(
|
|
2758
2807
|
preset,
|
|
2759
2808
|
"@riebeckite/plugin-recent-posts"
|
|
@@ -2762,16 +2811,11 @@ function indexRoute(preset) {
|
|
|
2762
2811
|
preset,
|
|
2763
2812
|
"@riebeckite/plugin-daily-notes"
|
|
2764
2813
|
);
|
|
2765
|
-
const
|
|
2766
|
-
const needsConfig = hasBacklinks || hasRecentPosts || hasDailyNotes;
|
|
2814
|
+
const needsConfig = hasRecentPosts || hasDailyNotes;
|
|
2767
2815
|
const importLines = [
|
|
2816
|
+
'import { getEntryLanguage } from "@riebeckite/core";',
|
|
2768
2817
|
'import { createRoute } from "honox/factory";'
|
|
2769
2818
|
];
|
|
2770
|
-
if (hasBacklinks) {
|
|
2771
|
-
importLines.push(
|
|
2772
|
-
'import { Backlinks, getPublishedBacklinks } from "@riebeckite/plugin-backlinks";'
|
|
2773
|
-
);
|
|
2774
|
-
}
|
|
2775
2819
|
if (hasDailyNotes) {
|
|
2776
2820
|
importLines.push(
|
|
2777
2821
|
'import { DailyNotes, getDailyNotes } from "@riebeckite/plugin-daily-notes";'
|
|
@@ -2791,14 +2835,9 @@ function indexRoute(preset) {
|
|
|
2791
2835
|
if (needsConfig) importLines.push('import { config } from "../config";');
|
|
2792
2836
|
importLines.push('import { content } from "../content";');
|
|
2793
2837
|
const dataLines = [];
|
|
2794
|
-
if (hasBacklinks) {
|
|
2795
|
-
dataLines.push(
|
|
2796
|
-
' const backlinks = getPublishedBacklinks({ manifest, config, slug: "index", resolveTitle: getArticleTitle });'
|
|
2797
|
-
);
|
|
2798
|
-
}
|
|
2799
2838
|
if (hasRecentPosts) {
|
|
2800
2839
|
dataLines.push(
|
|
2801
|
-
|
|
2840
|
+
' const recentPosts = await getRecentPosts({ posts: manifest.discoverableEntries, config, getProcessedContent: (slug) => content.getProcessedContent(slug), resolveTitle: (slug, title) => typeof title === "string" && title.trim() ? title : slug.split("/").at(-1) ?? slug });'
|
|
2802
2841
|
);
|
|
2803
2842
|
}
|
|
2804
2843
|
if (hasDailyNotes) {
|
|
@@ -2809,15 +2848,7 @@ function indexRoute(preset) {
|
|
|
2809
2848
|
' const tableOfContents = extractTableOfContents(post.html ?? "");'
|
|
2810
2849
|
);
|
|
2811
2850
|
}
|
|
2812
|
-
const propLines = [
|
|
2813
|
-
" propertiesHtml={indexEntry?.bodySlots?.properties}",
|
|
2814
|
-
' afterHeaderHtml={indexEntry?.bodySlots?.["article.after-header"]}',
|
|
2815
|
-
' afterMetaHtml={indexEntry?.bodySlots?.["article.after-meta"]}',
|
|
2816
|
-
' beforeContentHtml={indexEntry?.bodySlots?.["article.before-content"]}',
|
|
2817
|
-
' afterContentHtml={indexEntry?.bodySlots?.["article.after-content"]}',
|
|
2818
|
-
' asideHtml={indexEntry?.bodySlots?.["article.aside"]}',
|
|
2819
|
-
' footerHtml={indexEntry?.bodySlots?.["article.footer"]}'
|
|
2820
|
-
];
|
|
2851
|
+
const propLines = [" bodySlots={indexEntry?.bodySlots}"];
|
|
2821
2852
|
if (hasToc) {
|
|
2822
2853
|
propLines.push(
|
|
2823
2854
|
' asideContent={<TableOfContents className="table-of-contents--desktop" items={tableOfContents} />}'
|
|
@@ -2829,12 +2860,6 @@ function indexRoute(preset) {
|
|
|
2829
2860
|
if (afterChildren.length > 0) {
|
|
2830
2861
|
propLines.push(` afterContent={<>${afterChildren.join("")}</>}`);
|
|
2831
2862
|
}
|
|
2832
|
-
if (hasBacklinks) {
|
|
2833
|
-
propLines.push(
|
|
2834
|
-
" footerContent={<Backlinks backlinks={backlinks} />}"
|
|
2835
|
-
);
|
|
2836
|
-
}
|
|
2837
|
-
const titleHelper = needsTitle ? articleTitleHelper() : "";
|
|
2838
2863
|
const dataBlock = dataLines.length > 0 ? `
|
|
2839
2864
|
${dataLines.join("\n")}
|
|
2840
2865
|
` : "";
|
|
@@ -2853,7 +2878,7 @@ export default createRoute(async (c) => {
|
|
|
2853
2878
|
}
|
|
2854
2879
|
${dataBlock}
|
|
2855
2880
|
if (indexEntry) {
|
|
2856
|
-
c.set("htmlLanguage", indexEntry
|
|
2881
|
+
c.set("htmlLanguage", getEntryLanguage(indexEntry));
|
|
2857
2882
|
c.set("headTags", indexEntry.headTags ?? []);
|
|
2858
2883
|
}
|
|
2859
2884
|
|
|
@@ -2863,7 +2888,7 @@ ${dataBlock}
|
|
|
2863
2888
|
${propLines.join("\n")}
|
|
2864
2889
|
/>,
|
|
2865
2890
|
);
|
|
2866
|
-
})
|
|
2891
|
+
});`;
|
|
2867
2892
|
}
|
|
2868
2893
|
function staticIndexRoute() {
|
|
2869
2894
|
return `import { createRoute } from "honox/factory";
|
|
@@ -2881,34 +2906,14 @@ export default createRoute((c) =>
|
|
|
2881
2906
|
}
|
|
2882
2907
|
function slugRoute(preset) {
|
|
2883
2908
|
const hasToc = hasScaffoldPlugin(preset, "@riebeckite/plugin-toc");
|
|
2884
|
-
const hasBacklinks = hasScaffoldPlugin(
|
|
2885
|
-
preset,
|
|
2886
|
-
"@riebeckite/plugin-backlinks"
|
|
2887
|
-
);
|
|
2888
|
-
const hasLocalGraph = hasScaffoldPlugin(
|
|
2889
|
-
preset,
|
|
2890
|
-
"@riebeckite/plugin-local-graph"
|
|
2891
|
-
);
|
|
2892
|
-
const needsTitle = hasBacklinks || hasLocalGraph;
|
|
2893
|
-
const needsConfig = hasBacklinks || hasLocalGraph;
|
|
2894
|
-
const needsManifest = hasBacklinks || hasLocalGraph;
|
|
2895
2909
|
const importLines = [
|
|
2910
|
+
'import { getEntryLanguage } from "@riebeckite/core";',
|
|
2896
2911
|
"import {",
|
|
2897
2912
|
" contentRouteSsgParams,",
|
|
2898
2913
|
" pluginPageSsgParams,",
|
|
2899
2914
|
" resolveRiebeckiteRoute,",
|
|
2900
2915
|
'} from "@riebeckite/honox/server";'
|
|
2901
2916
|
];
|
|
2902
|
-
if (hasBacklinks) {
|
|
2903
|
-
importLines.push(
|
|
2904
|
-
'import { Backlinks, getPublishedBacklinks } from "@riebeckite/plugin-backlinks";'
|
|
2905
|
-
);
|
|
2906
|
-
}
|
|
2907
|
-
if (hasLocalGraph) {
|
|
2908
|
-
importLines.push(
|
|
2909
|
-
'import { LocalGraph, getLocalGraph } from "@riebeckite/plugin-local-graph";'
|
|
2910
|
-
);
|
|
2911
|
-
}
|
|
2912
2917
|
if (hasToc) {
|
|
2913
2918
|
importLines.push(
|
|
2914
2919
|
'import { extractTableOfContents, TableOfContents } from "@riebeckite/plugin-toc";'
|
|
@@ -2916,52 +2921,19 @@ function slugRoute(preset) {
|
|
|
2916
2921
|
}
|
|
2917
2922
|
importLines.push('import { createRoute } from "honox/factory";');
|
|
2918
2923
|
importLines.push('import { SiteArticle } from "../components/article";');
|
|
2919
|
-
if (needsConfig) importLines.push('import { config } from "../config";');
|
|
2920
2924
|
importLines.push('import { content } from "../content";');
|
|
2921
2925
|
const dataLines = [];
|
|
2922
|
-
if (needsManifest) {
|
|
2923
|
-
dataLines.push(" const manifest = await content.getManifest();");
|
|
2924
|
-
}
|
|
2925
|
-
if (hasBacklinks) {
|
|
2926
|
-
dataLines.push(
|
|
2927
|
-
" const backlinks = getPublishedBacklinks({ manifest, config, slug: route.entry.slug, resolveTitle: getArticleTitle });"
|
|
2928
|
-
);
|
|
2929
|
-
}
|
|
2930
|
-
if (hasLocalGraph) {
|
|
2931
|
-
dataLines.push(
|
|
2932
|
-
" const localGraph = getLocalGraph({ manifest, config, slug: route.entry.slug, resolveTitle: getArticleTitle });"
|
|
2933
|
-
);
|
|
2934
|
-
}
|
|
2935
2926
|
if (hasToc) {
|
|
2936
2927
|
dataLines.push(
|
|
2937
2928
|
' const tableOfContents = extractTableOfContents(post.html ?? "");'
|
|
2938
2929
|
);
|
|
2939
2930
|
}
|
|
2940
|
-
const propLines = [
|
|
2941
|
-
" propertiesHtml={route.entry.bodySlots?.properties}",
|
|
2942
|
-
' afterHeaderHtml={route.entry.bodySlots?.["article.after-header"]}',
|
|
2943
|
-
' afterMetaHtml={route.entry.bodySlots?.["article.after-meta"]}',
|
|
2944
|
-
' beforeContentHtml={route.entry.bodySlots?.["article.before-content"]}',
|
|
2945
|
-
' afterContentHtml={route.entry.bodySlots?.["article.after-content"]}',
|
|
2946
|
-
' asideHtml={route.entry.bodySlots?.["article.aside"]}',
|
|
2947
|
-
' footerHtml={route.entry.bodySlots?.["article.footer"]}'
|
|
2948
|
-
];
|
|
2931
|
+
const propLines = [" bodySlots={route.entry.bodySlots}"];
|
|
2949
2932
|
if (hasToc) {
|
|
2950
2933
|
propLines.push(
|
|
2951
2934
|
' asideContent={<TableOfContents className="table-of-contents--desktop" items={tableOfContents} />}'
|
|
2952
2935
|
);
|
|
2953
2936
|
}
|
|
2954
|
-
const footerChildren = [];
|
|
2955
|
-
if (hasLocalGraph) {
|
|
2956
|
-
footerChildren.push("{localGraph && <LocalGraph graph={localGraph} />}");
|
|
2957
|
-
}
|
|
2958
|
-
if (hasBacklinks) {
|
|
2959
|
-
footerChildren.push("<Backlinks backlinks={backlinks} />");
|
|
2960
|
-
}
|
|
2961
|
-
if (footerChildren.length > 0) {
|
|
2962
|
-
propLines.push(` footerContent={<>${footerChildren.join("")}</>}`);
|
|
2963
|
-
}
|
|
2964
|
-
const titleHelper = needsTitle ? articleTitleHelper() : "";
|
|
2965
2937
|
const dataBlock = dataLines.length > 0 ? `
|
|
2966
2938
|
${dataLines.join("\n")}
|
|
2967
2939
|
` : "";
|
|
@@ -2986,6 +2958,7 @@ export default createRoute(
|
|
|
2986
2958
|
return c.redirect(route.location, route.status);
|
|
2987
2959
|
if (route.kind === "page") {
|
|
2988
2960
|
c.set("headTags", route.page.headTags ?? []);
|
|
2961
|
+
c.set("htmlLanguage", route.page.language);
|
|
2989
2962
|
return c.render(
|
|
2990
2963
|
<div dangerouslySetInnerHTML={{ __html: route.page.body }} />,
|
|
2991
2964
|
);
|
|
@@ -2993,7 +2966,7 @@ export default createRoute(
|
|
|
2993
2966
|
|
|
2994
2967
|
const post = await content.getProcessedContent(route.entry.slug);
|
|
2995
2968
|
${dataBlock}
|
|
2996
|
-
c.set("htmlLanguage", route.entry
|
|
2969
|
+
c.set("htmlLanguage", getEntryLanguage(route.entry));
|
|
2997
2970
|
c.set("headTags", route.entry.headTags ?? []);
|
|
2998
2971
|
|
|
2999
2972
|
return c.render(
|
|
@@ -3003,7 +2976,7 @@ ${propLines.join("\n")}
|
|
|
3003
2976
|
/>,
|
|
3004
2977
|
);
|
|
3005
2978
|
},
|
|
3006
|
-
)
|
|
2979
|
+
);`;
|
|
3007
2980
|
}
|
|
3008
2981
|
|
|
3009
2982
|
// src/scaffold/localized-content.ts
|
|
@@ -3057,7 +3030,7 @@ var PLUGIN_MARKDOWN_GUIDES = {
|
|
|
3057
3030
|
].join("\n")
|
|
3058
3031
|
},
|
|
3059
3032
|
"@riebeckite/plugin-properties": {
|
|
3060
|
-
summary:
|
|
3033
|
+
summary: "Renders selected frontmatter properties in the article metadata slot.",
|
|
3061
3034
|
markdown: [
|
|
3062
3035
|
"---",
|
|
3063
3036
|
"created: 2026-09-30",
|
|
@@ -4745,7 +4718,7 @@ function referenceThemesContent(preset) {
|
|
|
4745
4718
|
}
|
|
4746
4719
|
|
|
4747
4720
|
// src/scaffold/version.ts
|
|
4748
|
-
var RIEBECKITE_VERSION = "^0.0.
|
|
4721
|
+
var RIEBECKITE_VERSION = "^0.0.17";
|
|
4749
4722
|
|
|
4750
4723
|
// src/scaffold/templates.ts
|
|
4751
4724
|
function siteTemplateFiles(preset, variables, options = {}) {
|
|
@@ -4890,11 +4863,11 @@ function riebeckiteConfig(preset, variables) {
|
|
|
4890
4863
|
lines.push(` description: ${JSON.stringify(description)},`);
|
|
4891
4864
|
lines.push(` baseUrl: ${JSON.stringify(baseUrl)},`);
|
|
4892
4865
|
lines.push(` locale: ${JSON.stringify(locale)},`);
|
|
4866
|
+
lines.push(' defaultOgImage: "/ogp.png",');
|
|
4893
4867
|
lines.push(" },");
|
|
4894
4868
|
lines.push(" content: {");
|
|
4895
4869
|
lines.push(' directory: "content",');
|
|
4896
4870
|
lines.push(" },");
|
|
4897
|
-
for (const line of navigationConfig(preset)) lines.push(line);
|
|
4898
4871
|
if (preset.theme) {
|
|
4899
4872
|
const theme = preset.theme;
|
|
4900
4873
|
lines.push(
|
|
@@ -4910,25 +4883,6 @@ function riebeckiteConfig(preset, variables) {
|
|
|
4910
4883
|
return `${lines.join("\n")}
|
|
4911
4884
|
`;
|
|
4912
4885
|
}
|
|
4913
|
-
function navigationConfig(preset) {
|
|
4914
|
-
if (preset.name === "starter") {
|
|
4915
|
-
return [
|
|
4916
|
-
" navigation: {",
|
|
4917
|
-
' header: [{ label: "Guide", href: "/guide" }, { label: "Examples", href: "/examples" }, { label: "Notes", href: "/notes/planning", children: [{ label: "Planning", href: "/notes/planning" }, { label: "Writing", href: "/notes/writing" }] }],',
|
|
4918
|
-
' footer: [{ label: "Guide", href: "/guide" }, { label: "Examples", href: "/examples" }],',
|
|
4919
|
-
" },"
|
|
4920
|
-
];
|
|
4921
|
-
}
|
|
4922
|
-
if (preset.name === "showcase") {
|
|
4923
|
-
return [
|
|
4924
|
-
" navigation: {",
|
|
4925
|
-
' header: [{ label: "Guide", href: "/guide" }, { label: "Examples", href: "/examples" }, { label: "Framework", href: "/framework/plugins", children: [{ label: "Plugins", href: "/framework/plugins" }, { label: "Themes", href: "/framework/themes" }] }],',
|
|
4926
|
-
' footer: [{ label: "Guide", href: "/guide" }, { label: "Examples", href: "/examples" }],',
|
|
4927
|
-
" },"
|
|
4928
|
-
];
|
|
4929
|
-
}
|
|
4930
|
-
return [];
|
|
4931
|
-
}
|
|
4932
4886
|
var OPTION_DEPTH = {
|
|
4933
4887
|
empty: 0,
|
|
4934
4888
|
minimal: 0,
|
|
@@ -5155,6 +5109,9 @@ function readmeEn(preset, variables) {
|
|
|
5155
5109
|
""
|
|
5156
5110
|
);
|
|
5157
5111
|
}
|
|
5112
|
+
if (variables.externalContent === true) {
|
|
5113
|
+
lines.push(...deploymentSecretLines("en"));
|
|
5114
|
+
}
|
|
5158
5115
|
if (preset.readme === "rich") {
|
|
5159
5116
|
lines.push(...demoPagesLines(preset, variables, words, "en"));
|
|
5160
5117
|
lines.push(...copyPasteDemoLines(preset, words, "en"));
|
|
@@ -5213,6 +5170,9 @@ function readmeJa(preset, variables) {
|
|
|
5213
5170
|
""
|
|
5214
5171
|
);
|
|
5215
5172
|
}
|
|
5173
|
+
if (variables.externalContent === true) {
|
|
5174
|
+
lines.push(...deploymentSecretLines("ja"));
|
|
5175
|
+
}
|
|
5216
5176
|
if (preset.readme === "rich") {
|
|
5217
5177
|
lines.push(...demoPagesLines(preset, variables, words, "ja"));
|
|
5218
5178
|
lines.push(...copyPasteDemoLines(preset, words, "ja"));
|
|
@@ -5228,6 +5188,34 @@ function readmeJa(preset, variables) {
|
|
|
5228
5188
|
}
|
|
5229
5189
|
return lines.join("\n");
|
|
5230
5190
|
}
|
|
5191
|
+
function deploymentSecretLines(language) {
|
|
5192
|
+
if (language === "ja") {
|
|
5193
|
+
return [
|
|
5194
|
+
"## デプロイ用 Secret",
|
|
5195
|
+
"",
|
|
5196
|
+
"GitHub Actions のデプロイは content repository を読み、Cloudflare へ配信します。初回実行の前に、次の repository secret を登録してください。",
|
|
5197
|
+
"",
|
|
5198
|
+
"- `RIEBECKITE_CONTENT_READ_TOKEN` — **この Site Repository** に登録します。content repository が private / internal のときだけ必要です。content repository に限定した fine-grained token を作成し、**Contents: read** を付与します。",
|
|
5199
|
+
"- `SITE_DISPATCH_TOKEN` — **content repository** に登録します。content repository の `notify-site.yml` からこの Site へ更新を通知するために使います。この Site Repository に限定した fine-grained token を作成し、**Contents: read and write** を付与します。",
|
|
5200
|
+
"- `CLOUDFLARE_API_TOKEN` と `CLOUDFLARE_ACCOUNT_ID` — **この Site Repository** に登録し、Cloudflare へのデプロイに使います。",
|
|
5201
|
+
"",
|
|
5202
|
+
`workflow はこれらの secret 名を参照するだけで、値は含みません。値は絶対に commit しないでください。全体の手順は [別 Content Repository のガイド](${REPO}/blob/main/docs/ja/docs/guides/deployment/separate-content-repository.md) を参照してください。`,
|
|
5203
|
+
""
|
|
5204
|
+
];
|
|
5205
|
+
}
|
|
5206
|
+
return [
|
|
5207
|
+
"## Deployment secrets",
|
|
5208
|
+
"",
|
|
5209
|
+
"The GitHub Actions deployment reads the content repository and deploys to Cloudflare. Add these repository secrets before the first run:",
|
|
5210
|
+
"",
|
|
5211
|
+
"- `RIEBECKITE_CONTENT_READ_TOKEN` — in **this site repository**. Required only when the content repository is private or internal. Use a fine-grained token scoped to the content repository with **Contents: read**.",
|
|
5212
|
+
"- `SITE_DISPATCH_TOKEN` — in the **content repository**. Lets its `notify-site.yml` dispatch updates to this site. Use a fine-grained token scoped to this site repository with **Contents: read and write**.",
|
|
5213
|
+
"- `CLOUDFLARE_API_TOKEN` and `CLOUDFLARE_ACCOUNT_ID` — in **this site repository** for the Cloudflare deploy.",
|
|
5214
|
+
"",
|
|
5215
|
+
`The workflows reference these secret names and never contain their values. Never commit the values. See the [separate content repository guide](${REPO}/blob/main/docs/en/docs/guides/deployment/separate-content-repository.md) for the full setup.`,
|
|
5216
|
+
""
|
|
5217
|
+
];
|
|
5218
|
+
}
|
|
5231
5219
|
function languagesLabel(preset, words) {
|
|
5232
5220
|
if (preset.languages.length === 0) return words.none;
|
|
5233
5221
|
if (preset.languages.length === 1)
|
|
@@ -5740,7 +5728,8 @@ function templateVariables(options, targetDirectory) {
|
|
|
5740
5728
|
title: options.siteTitle ?? name,
|
|
5741
5729
|
description: options.description ?? "",
|
|
5742
5730
|
baseUrl: options.baseUrl ?? "",
|
|
5743
|
-
locale: options.locale ?? "en"
|
|
5731
|
+
locale: options.locale ?? "en",
|
|
5732
|
+
externalContent: options.contentRepository !== void 0
|
|
5744
5733
|
};
|
|
5745
5734
|
}
|
|
5746
5735
|
async function assertTargetWritable(targetDirectory, files, overwrite) {
|
|
@@ -5786,14 +5775,29 @@ function formatScaffoldNextSteps(relativeDirectory, options = {}) {
|
|
|
5786
5775
|
lines.push(` ${options.editFile}`);
|
|
5787
5776
|
lines.push("");
|
|
5788
5777
|
lines.push("Common first settings:");
|
|
5789
|
-
lines.push(
|
|
5778
|
+
lines.push(
|
|
5779
|
+
" riebeckite.config.ts: site.title, site.baseUrl, content.directory"
|
|
5780
|
+
);
|
|
5790
5781
|
}
|
|
5791
5782
|
if (options.externalContent === true) {
|
|
5792
5783
|
lines.push("");
|
|
5793
|
-
lines.push(
|
|
5784
|
+
lines.push(
|
|
5785
|
+
"Operational content lives in the content repository. CI checks it out to content/."
|
|
5786
|
+
);
|
|
5794
5787
|
lines.push(
|
|
5795
5788
|
"Copy github/notify-site.yml to the content repository as .github/workflows/notify-site.yml."
|
|
5796
5789
|
);
|
|
5790
|
+
lines.push("");
|
|
5791
|
+
lines.push("Required GitHub Actions repository secrets:");
|
|
5792
|
+
lines.push(
|
|
5793
|
+
" RIEBECKITE_CONTENT_READ_TOKEN: site repository; only when the content repository is private or internal (Contents: read)"
|
|
5794
|
+
);
|
|
5795
|
+
lines.push(
|
|
5796
|
+
" SITE_DISPATCH_TOKEN: content repository (fine-grained token for the site repository, Contents: read and write)"
|
|
5797
|
+
);
|
|
5798
|
+
lines.push(
|
|
5799
|
+
" CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID: site repository"
|
|
5800
|
+
);
|
|
5797
5801
|
}
|
|
5798
5802
|
return lines.join("\n");
|
|
5799
5803
|
}
|
|
@@ -42,13 +42,8 @@ var l10n = np("@riebeckite/plugin-l10n", "l10n", (context) => {
|
|
|
42
42
|
return `{ defaultLang: ${JSON.stringify(defaultLang)}, languages: ${JSON.stringify(context.languages)} }`;
|
|
43
43
|
});
|
|
44
44
|
var seo = np("@riebeckite/plugin-seo", "seo", {
|
|
45
|
-
siteName: {
|
|
46
|
-
depth: 1,
|
|
47
|
-
value: (context) => JSON.stringify(context.variables.title)
|
|
48
|
-
},
|
|
49
45
|
sitemap: { depth: 1, value: "true" },
|
|
50
46
|
robots: { depth: 2, value: "true" },
|
|
51
|
-
defaultImage: { depth: 3, value: '"/ogp.png"' },
|
|
52
47
|
feed: { depth: 3, value: "{ rss: true, atom: true, json: true }" }
|
|
53
48
|
});
|
|
54
49
|
var toc = np("@riebeckite/plugin-toc", "tocPlugin");
|
|
@@ -69,6 +64,17 @@ var codeEnhance = np("@riebeckite/plugin-code-enhance", "codeEnhance", {
|
|
|
69
64
|
});
|
|
70
65
|
var search = np("@riebeckite/plugin-search", "searchPlugin");
|
|
71
66
|
var backlinks = np("@riebeckite/plugin-backlinks", "backlinksPlugin");
|
|
67
|
+
var breadcrumbs = np("@riebeckite/plugin-breadcrumbs", "breadcrumbsPlugin");
|
|
68
|
+
var navigationStarter = np(
|
|
69
|
+
"@riebeckite/plugin-navigation",
|
|
70
|
+
"navigation",
|
|
71
|
+
`{ items: [{ label: "Guide", href: "/guide" }, { label: "Examples", href: "/examples" }, { label: "Notes", href: "/notes/planning", children: [{ label: "Planning", href: "/notes/planning" }, { label: "Writing", href: "/notes/writing" }] }], secondary: [{ label: "Guide", href: "/guide" }, { label: "Examples", href: "/examples" }] }`
|
|
72
|
+
);
|
|
73
|
+
var navigationShowcase = np(
|
|
74
|
+
"@riebeckite/plugin-navigation",
|
|
75
|
+
"navigation",
|
|
76
|
+
`{ items: [{ label: "Guide", href: "/guide" }, { label: "Examples", href: "/examples" }, { label: "Framework", href: "/framework/plugins", children: [{ label: "Plugins", href: "/framework/plugins" }, { label: "Themes", href: "/framework/themes" }] }], secondary: [{ label: "Guide", href: "/guide" }, { label: "Examples", href: "/examples" }] }`
|
|
77
|
+
);
|
|
72
78
|
var relatedPosts = np("@riebeckite/plugin-related-posts", "relatedPosts", {
|
|
73
79
|
limit: { depth: 2, value: "5" },
|
|
74
80
|
useTags: { depth: 2, value: "true" },
|
|
@@ -167,6 +173,7 @@ var taxonomy = np("@riebeckite/plugin-taxonomy", "taxonomy", {
|
|
|
167
173
|
feeds: { depth: 3, value: "{ rss: true, atom: true, json: true }" },
|
|
168
174
|
relatedLimit: { depth: 3, value: "8" }
|
|
169
175
|
});
|
|
176
|
+
var folderPages = np("@riebeckite/plugin-folder-pages", "folderPagesPlugin");
|
|
170
177
|
var autoCardLink = np(
|
|
171
178
|
"@riebeckite/plugin-autocardlink",
|
|
172
179
|
"autoCardLinkPlugin",
|
|
@@ -355,7 +362,7 @@ var quality = np(
|
|
|
355
362
|
var deploy = np(
|
|
356
363
|
"@riebeckite/plugin-deploy",
|
|
357
364
|
"deployPlugin",
|
|
358
|
-
|
|
365
|
+
`{ provider: "cloudflare-pages" }`
|
|
359
366
|
);
|
|
360
367
|
var diagnostics = np(
|
|
361
368
|
"@riebeckite/plugin-diagnostics",
|
|
@@ -421,6 +428,8 @@ var starter = {
|
|
|
421
428
|
codeEnhance,
|
|
422
429
|
search,
|
|
423
430
|
backlinks,
|
|
431
|
+
breadcrumbs,
|
|
432
|
+
navigationStarter,
|
|
424
433
|
relatedPosts,
|
|
425
434
|
recentPosts,
|
|
426
435
|
responsiveImage,
|
|
@@ -448,6 +457,8 @@ var showcase = {
|
|
|
448
457
|
codeEnhance,
|
|
449
458
|
search,
|
|
450
459
|
backlinks,
|
|
460
|
+
breadcrumbs,
|
|
461
|
+
navigationShowcase,
|
|
451
462
|
relatedPosts,
|
|
452
463
|
share,
|
|
453
464
|
changelog,
|
|
@@ -464,6 +475,7 @@ var showcase = {
|
|
|
464
475
|
shortcodes,
|
|
465
476
|
series,
|
|
466
477
|
taxonomy,
|
|
478
|
+
folderPages,
|
|
467
479
|
autoCardLink,
|
|
468
480
|
richEmbed,
|
|
469
481
|
gallery,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const RIEBECKITE_VERSION = "^0.0.
|
|
1
|
+
export declare const RIEBECKITE_VERSION = "^0.0.17";
|
|
@@ -4,11 +4,7 @@ function Article(props) {
|
|
|
4
4
|
return /* @__PURE__ */ jsx(
|
|
5
5
|
"article",
|
|
6
6
|
{
|
|
7
|
-
class: joinClassNames(
|
|
8
|
-
"article-shell rb-article",
|
|
9
|
-
props.class,
|
|
10
|
-
props.className
|
|
11
|
-
),
|
|
7
|
+
class: joinClassNames("rb-article", props.class, props.className),
|
|
12
8
|
"data-slot": props["data-slot"] ?? "article",
|
|
13
9
|
children: props.children
|
|
14
10
|
}
|
|
@@ -18,11 +14,7 @@ function ArticleLayout(props) {
|
|
|
18
14
|
return /* @__PURE__ */ jsxs(
|
|
19
15
|
"div",
|
|
20
16
|
{
|
|
21
|
-
class: joinClassNames(
|
|
22
|
-
"article-shell__layout rb-article-layout",
|
|
23
|
-
props.class,
|
|
24
|
-
props.className
|
|
25
|
-
),
|
|
17
|
+
class: joinClassNames("rb-article-layout", props.class, props.className),
|
|
26
18
|
children: [
|
|
27
19
|
props.children,
|
|
28
20
|
props.aside
|
|
@@ -32,7 +24,7 @@ function ArticleLayout(props) {
|
|
|
32
24
|
}
|
|
33
25
|
function ArticleHeader(props) {
|
|
34
26
|
const className = joinClassNames(
|
|
35
|
-
"
|
|
27
|
+
"rb-article-header",
|
|
36
28
|
props.class,
|
|
37
29
|
props.className
|
|
38
30
|
);
|
|
@@ -51,11 +43,7 @@ function ArticleMeta(props) {
|
|
|
51
43
|
return /* @__PURE__ */ jsx(
|
|
52
44
|
"aside",
|
|
53
45
|
{
|
|
54
|
-
class: joinClassNames(
|
|
55
|
-
"article-frontmatter rb-article-meta",
|
|
56
|
-
props.class,
|
|
57
|
-
props.className
|
|
58
|
-
),
|
|
46
|
+
class: joinClassNames("rb-article-meta", props.class, props.className),
|
|
59
47
|
"aria-label": props.label ?? "Article metadata",
|
|
60
48
|
children: props.children
|
|
61
49
|
}
|
|
@@ -63,7 +51,7 @@ function ArticleMeta(props) {
|
|
|
63
51
|
}
|
|
64
52
|
function ArticleContent(props) {
|
|
65
53
|
const className = joinClassNames(
|
|
66
|
-
"
|
|
54
|
+
"rb-article-body",
|
|
67
55
|
props.class,
|
|
68
56
|
props.className
|
|
69
57
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riebeckite/honox",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -36,7 +36,11 @@
|
|
|
36
36
|
"esbuild": "^0.28.2",
|
|
37
37
|
"hono": "^4.12.25",
|
|
38
38
|
"vite": "^8.0.9",
|
|
39
|
-
"@riebeckite/core": "0.0.
|
|
39
|
+
"@riebeckite/core": "0.0.17"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"tsx": "^4.22.4",
|
|
43
|
+
"@riebeckite/test": "0.0.17"
|
|
40
44
|
},
|
|
41
45
|
"publishConfig": {
|
|
42
46
|
"access": "public"
|