@publish.os/nextjs 0.0.1-alpha.90 → 0.0.1-alpha.92
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/compiler-assets/nextjs/defaults/group/index.tsx +16 -11
- package/compiler-assets/nextjs/defaults/group/layout.tsx +6 -6
- package/compiler-assets/nextjs/defaults/group/page.tsx +36 -26
- package/compiler-assets/nextjs/defaults/project/next.config.mjs +21 -11
- package/compiler-assets/nextjs/defaults/project/tsconfig.json.template +10 -0
- package/compiler-assets/nextjs/defaults/root/css/components/code-block.css +18 -0
- package/compiler-assets/nextjs/defaults/root/index.tsx +16 -11
- package/compiler-assets/nextjs/defaults/root/layout.tsx +7 -3
- package/compiler-assets/nextjs/shims/agent-user-agents.ts +65 -0
- package/compiler-assets/nextjs/shims/document.tsx +46 -0
- package/compiler-assets/nextjs/shims/generated-leaf-page.tsx +5 -0
- package/compiler-assets/nextjs/shims/global-layout.tsx +8 -42
- package/compiler-assets/nextjs/shims/global-not-found.tsx +69 -0
- package/compiler-assets/nextjs/shims/markdown-route.ts +2 -0
- package/compiler-assets/nextjs/shims/metadata-icons.tsx +39 -0
- package/compiler-assets/nextjs/shims/not-found-content.tsx +53 -0
- package/compiler-assets/nextjs/shims/not-found-navigation.tsx +60 -0
- package/compiler-assets/nextjs/shims/proxy.ts +254 -86
- package/compiler-assets/nextjs/shims/site-fenced-code-block.tsx +2 -6
- package/compiler-assets/nextjs/shims/site-mdx-components.tsx +28 -16
- package/compiler-assets/nextjs/shims/site-mdx.tsx +6 -1
- package/dist/{build-operation-2JAYBSKF.js → build-operation-CJDUL4OW.js} +29 -23
- package/dist/{button-c3WGnxIj.d.ts → button-D6Xp2HBm.d.ts} +4 -4
- package/dist/capture-local-source-WGGDIUU2.js +258 -0
- package/dist/chunk-22RSSUNV.js +13 -0
- package/dist/chunk-3T4HVDSC.js +426 -0
- package/dist/{chunk-WKTEO6RS.js → chunk-4BC2L2KA.js} +46 -12
- package/dist/{chunk-WDY4IK6Z.js → chunk-5J3YUNRY.js} +3 -10
- package/dist/chunk-5KAD7W53.js +248 -0
- package/dist/{chunk-DWA3ZRGW.js → chunk-6C65KV7O.js} +2 -2
- package/dist/{chunk-GGKFQ3MA.js → chunk-6D2E6UMD.js} +144 -70
- package/dist/{chunk-7OGTPSKI.js → chunk-7NY22B5U.js} +8 -3
- package/dist/chunk-DX7PXFCM.js +2519 -0
- package/dist/{chunk-726GV2NF.js → chunk-DZ3VWEV5.js} +950 -632
- package/dist/chunk-EFO6AWXN.js +19 -0
- package/dist/chunk-IL4RJOKI.js +186 -0
- package/dist/{chunk-H6XILMZX.js → chunk-NHSLTARU.js} +2588 -1493
- package/dist/{chunk-DLDFHU7Y.js → chunk-NNBJZPFM.js} +4 -2
- package/dist/{chunk-VO2I7MTM.js → chunk-SBMDONTV.js} +10 -7
- package/dist/{chunk-YLTOLYWM.js → chunk-WL75GQ5M.js} +6 -18
- package/dist/compiler.d.ts +15 -2
- package/dist/compiler.js +111 -23
- package/dist/components/blocks/agent-actions.d.ts +81 -0
- package/dist/components/blocks/agent-actions.js +563 -0
- package/dist/components/blocks/toc.d.ts +43 -0
- package/dist/components/blocks/toc.js +136 -0
- package/dist/components/ui/button.d.ts +4 -0
- package/dist/components/ui/button.js +94 -0
- package/dist/compose-44GJSMXD.js +16 -0
- package/dist/config/createNextConfig.js +19 -3
- package/dist/{dev-operation-TZDVJCN7.js → dev-operation-WNECBHZ5.js} +134 -84
- package/dist/{framework-selection-X4U6Y6QC.js → framework-selection-ZVO323PK.js} +3 -2
- package/dist/ide-support-TG74L4FF.js +16 -0
- package/dist/index.d.ts +151 -95
- package/dist/index.js +25 -0
- package/dist/jsx-dev-runtime.d.ts +6 -0
- package/dist/jsx-dev-runtime.js +100 -0
- package/dist/jsx-runtime.d.ts +7 -0
- package/dist/jsx-runtime.js +97 -0
- package/dist/kernel/components/blocks/AgentActions.d.ts +37 -8
- package/dist/kernel/components/blocks/AgentActions.js +384 -174
- package/dist/kernel/components/blocks/agent-actions.d.ts +4 -0
- package/dist/kernel/components/blocks/agent-actions.js +563 -0
- package/dist/kernel/components/blocks/animated-icon-swap.d.ts +2 -2
- package/dist/kernel/components/blocks/animated-icon-swap.js +1 -1
- package/dist/kernel/components/blocks/color-palette.d.ts +2 -2
- package/dist/kernel/components/blocks/color-palette.js +4 -4
- package/dist/kernel/components/blocks/logo-block.d.ts +2 -2
- package/dist/kernel/components/blocks/logo-block.js +1 -1
- package/dist/kernel/components/blocks/nav-breadcrumb.d.ts +6 -5
- package/dist/kernel/components/blocks/nav-breadcrumb.js +21 -15
- package/dist/kernel/components/blocks/navbar.d.ts +5 -4
- package/dist/kernel/components/blocks/navbar.js +79 -59
- package/dist/kernel/components/blocks/navigation-progress.d.ts +2 -2
- package/dist/kernel/components/blocks/navigation-progress.js +2 -2
- package/dist/kernel/components/blocks/next-prev.d.ts +4 -4
- package/dist/kernel/components/blocks/next-prev.js +30 -7
- package/dist/kernel/components/blocks/page-list.d.ts +4 -4
- package/dist/kernel/components/blocks/page-list.js +32 -9
- package/dist/kernel/components/blocks/search.d.ts +9 -15
- package/dist/kernel/components/blocks/search.js +16 -17
- package/dist/kernel/components/blocks/sidebar-node.d.ts +3 -5
- package/dist/kernel/components/blocks/sidebar-node.js +13 -3
- package/dist/kernel/components/blocks/sidebar.d.ts +6 -7
- package/dist/kernel/components/blocks/sidebar.js +137 -28
- package/dist/kernel/components/blocks/theme-toggle.d.ts +3 -4
- package/dist/kernel/components/blocks/theme-toggle.js +5 -5
- package/dist/kernel/components/blocks/toc-client.d.ts +40 -0
- package/dist/kernel/components/blocks/toc-client.js +495 -0
- package/dist/kernel/components/blocks/toc.d.ts +20 -2
- package/dist/kernel/components/blocks/toc.js +121 -179
- package/dist/kernel/components/mdx/components/blockquote.d.ts +2 -2
- package/dist/kernel/components/mdx/components/blockquote.js +1 -1
- package/dist/kernel/components/mdx/components/callout.d.ts +3 -3
- package/dist/kernel/components/mdx/components/callout.js +1 -1
- package/dist/kernel/components/mdx/components/code-block.d.ts +2 -2
- package/dist/kernel/components/mdx/components/code-block.js +2 -2
- package/dist/kernel/components/mdx/components/copy-code-button.d.ts +2 -2
- package/dist/kernel/components/mdx/components/copy-code-button.js +5 -4
- package/dist/kernel/components/mdx/components/figure-caption.d.ts +3 -3
- package/dist/kernel/components/mdx/components/figure-caption.js +3 -2
- package/dist/kernel/components/mdx/components/figure.d.ts +8 -4
- package/dist/kernel/components/mdx/components/figure.js +23 -13
- package/dist/kernel/components/mdx/components/footnotes.d.ts +2 -2
- package/dist/kernel/components/mdx/components/footnotes.js +1 -1
- package/dist/kernel/components/mdx/components/heading-copy-link.d.ts +2 -2
- package/dist/kernel/components/mdx/components/heading-copy-link.js +1 -1
- package/dist/kernel/components/mdx/components/heading.d.ts +2 -2
- package/dist/kernel/components/mdx/components/heading.js +6 -3
- package/dist/kernel/components/mdx/components/hr.d.ts +4 -4
- package/dist/kernel/components/mdx/components/hr.js +2 -2
- package/dist/kernel/components/mdx/components/image-zoom.d.ts +3 -3
- package/dist/kernel/components/mdx/components/image-zoom.js +4 -3
- package/dist/kernel/components/mdx/components/image.d.ts +2 -2
- package/dist/kernel/components/mdx/components/image.js +22 -17
- package/dist/kernel/components/mdx/components/inline-code.d.ts +2 -2
- package/dist/kernel/components/mdx/components/inline-code.js +1 -1
- package/dist/kernel/components/mdx/components/kbd.d.ts +3 -3
- package/dist/kernel/components/mdx/components/kbd.js +2 -2
- package/dist/kernel/components/mdx/components/link.d.ts +6 -6
- package/dist/kernel/components/mdx/components/link.js +2 -2
- package/dist/kernel/components/mdx/components/paragraph.d.ts +2 -2
- package/dist/kernel/components/mdx/components/paragraph.js +1 -1
- package/dist/kernel/components/mdx/components/strikethrough.d.ts +2 -2
- package/dist/kernel/components/mdx/components/strikethrough.js +1 -1
- package/dist/kernel/components/mdx/components/table.d.ts +7 -7
- package/dist/kernel/components/mdx/components/table.js +2 -2
- package/dist/kernel/components/mdx/components/task-list.d.ts +3 -3
- package/dist/kernel/components/mdx/components/task-list.js +1 -1
- package/dist/kernel/components/mdx/components/video-player.d.ts +8 -4
- package/dist/kernel/components/mdx/components/video-player.js +6 -2
- package/dist/kernel/components/mdx/components/video.d.ts +5 -4
- package/dist/kernel/components/mdx/components/video.js +7 -5
- package/dist/kernel/components/mdx/error-boundary.d.ts +3 -4
- package/dist/kernel/components/mdx/error-boundary.js +2 -2
- package/dist/kernel/components/mdx/error-fallback.d.ts +2 -2
- package/dist/kernel/components/mdx/error-fallback.js +1 -1
- package/dist/kernel/components/mdx/mdx.d.ts +57 -16
- package/dist/kernel/components/mdx/mdx.js +232 -35
- package/dist/kernel/components/mdx/rehype-heading-ids.d.ts +1 -0
- package/dist/kernel/components/mdx/rehype-heading-ids.js +5 -3
- package/dist/kernel/components/mdx/types.d.ts +1 -1
- package/dist/kernel/components/next-image.d.ts +12 -0
- package/dist/kernel/components/next-image.js +61 -0
- package/dist/kernel/components/ui/accordion.d.ts +7 -7
- package/dist/kernel/components/ui/accordion.js +1 -1
- package/dist/kernel/components/ui/breadcrumb-trail.d.ts +3 -4
- package/dist/kernel/components/ui/breadcrumb-trail.js +2 -2
- package/dist/kernel/components/ui/breadcrumb.d.ts +14 -14
- package/dist/kernel/components/ui/breadcrumb.js +4 -4
- package/dist/kernel/components/ui/button-group.d.ts +6 -6
- package/dist/kernel/components/ui/button-group.js +3 -3
- package/dist/kernel/components/ui/button.d.ts +59 -7
- package/dist/kernel/components/ui/button.js +43 -39
- package/dist/kernel/components/ui/card.d.ts +7 -7
- package/dist/kernel/components/ui/card.js +1 -1
- package/dist/kernel/components/ui/dialog.d.ts +10 -10
- package/dist/kernel/components/ui/dialog.js +1 -1
- package/dist/kernel/components/ui/drawer.d.ts +12 -12
- package/dist/kernel/components/ui/drawer.js +1 -1
- package/dist/kernel/components/ui/input.d.ts +2 -2
- package/dist/kernel/components/ui/input.js +1 -1
- package/dist/kernel/components/ui/kbd.d.ts +4 -4
- package/dist/kernel/components/ui/kbd.js +1 -1
- package/dist/kernel/components/ui/link.d.ts +11 -5
- package/dist/kernel/components/ui/link.js +2 -2
- package/dist/kernel/components/ui/menu.d.ts +22 -22
- package/dist/kernel/components/ui/menu.js +1 -1
- package/dist/kernel/components/ui/mod-key.d.ts +2 -3
- package/dist/kernel/components/ui/mod-key.js +2 -2
- package/dist/kernel/components/ui/navigation-menu.d.ts +15 -15
- package/dist/kernel/components/ui/navigation-menu.js +1 -1
- package/dist/kernel/components/ui/popover.d.ts +11 -11
- package/dist/kernel/components/ui/popover.js +1 -1
- package/dist/kernel/components/ui/progress.d.ts +7 -7
- package/dist/kernel/components/ui/progress.js +1 -1
- package/dist/kernel/components/ui/scroll-area.d.ts +9 -10
- package/dist/kernel/components/ui/scroll-area.js +1 -1
- package/dist/kernel/components/ui/select.d.ts +16 -16
- package/dist/kernel/components/ui/select.js +1 -1
- package/dist/kernel/components/ui/separator.d.ts +3 -3
- package/dist/kernel/components/ui/separator.js +1 -1
- package/dist/kernel/components/ui/table.d.ts +7 -7
- package/dist/kernel/components/ui/table.js +1 -1
- package/dist/kernel/components/ui/tabs.d.ts +12 -12
- package/dist/kernel/components/ui/tabs.js +1 -1
- package/dist/kernel/components/ui/tag.d.ts +3 -3
- package/dist/kernel/components/ui/tag.js +1 -1
- package/dist/kernel/components/ui/text.d.ts +4 -4
- package/dist/kernel/components/ui/text.js +1 -1
- package/dist/kernel/components/ui/toast.d.ts +11 -11
- package/dist/kernel/components/ui/toast.js +1 -1
- package/dist/kernel/components/ui/tooltip.d.ts +9 -9
- package/dist/kernel/components/ui/tooltip.js +1 -1
- package/dist/kernel/defaults.registry.d.ts +4 -17
- package/dist/kernel/defaults.registry.js +4 -19
- package/dist/kernel/routes/agent/markdown.d.ts +7 -0
- package/dist/kernel/routes/agent/markdown.js +229 -54
- package/dist/kernel/routes/layouts/group.d.ts +1 -1
- package/dist/kernel/routes/layouts/group.js +5 -7
- package/dist/kernel/routes/metadata/feed.d.ts +1 -2
- package/dist/kernel/routes/metadata/feed.js +119 -88
- package/dist/kernel/routes/metadata/llms.d.ts +3 -23
- package/dist/kernel/routes/metadata/llms.js +2 -103
- package/dist/kernel/routes/metadata/og-image.js +1 -1
- package/dist/kernel/routes/metadata/robots.d.ts +5 -3
- package/dist/kernel/routes/metadata/robots.js +4 -25
- package/dist/kernel/routes/metadata/sitemap.d.ts +36 -3
- package/dist/kernel/routes/metadata/sitemap.js +277 -49
- package/dist/kernel/routes/not-found.d.ts +34 -0
- package/dist/kernel/routes/not-found.js +213 -0
- package/dist/kernel/routes/pages/group.d.ts +5 -5
- package/dist/kernel/routes/pages/group.js +11 -5
- package/dist/kernel/routes/pages/leaf.d.ts +38 -6
- package/dist/kernel/routes/pages/leaf.js +21 -12
- package/dist/kernel/routes/pages/root.d.ts +5 -5
- package/dist/kernel/routes/pages/root.js +21 -6
- package/dist/keyboard-shortcuts.d.ts +2 -2
- package/dist/keyboard-shortcuts.js +1 -1
- package/dist/manifest-types-CcVPH_jh.d.ts +83 -0
- package/dist/resolvers/manifest-resolver.d.ts +2 -2
- package/dist/resolvers/manifest-resolver.js +65 -35
- package/dist/route-metadata-og-image-BeKKFHg7.d.ts +58 -0
- package/dist/search.d.ts +2 -9
- package/dist/search.js +9 -16
- package/dist/sidebar-types-CMrMM0Nj.d.ts +105 -0
- package/dist/theme-scope.d.ts +2 -2
- package/dist/theme-scope.js +1 -1
- package/dist/types-BbqmOzLC.d.ts +168 -0
- package/dist/types-TjH1ek0X.d.ts +22 -0
- package/dist/types-sM2g9nW0.d.ts +12 -0
- package/dist/types.d.ts +117 -91
- package/dist/utils/heading-ids.js +30 -11
- package/dist/utils/toc-selection.d.ts +7 -0
- package/dist/utils/toc-selection.js +14 -0
- package/dist/validate-local-source-EN2GW4FR.js +16 -0
- package/dist/validate-publish-os-source-OEWQDB7B.js +14 -0
- package/init/seed/minimal/publish.os/assets/blog/hello-world.svg +13 -0
- package/init/seed/minimal/publish.os/assets/favicon.dark.svg +13 -0
- package/init/seed/minimal/publish.os/assets/favicon.svg +13 -0
- package/init/seed/minimal/publish.os/blog/content/hello-world.mdx +48 -0
- package/init/seed/minimal/publish.os/blog/content/series-a.mdx +11 -0
- package/init/seed/minimal/publish.os/blog/index.tsx +85 -0
- package/init/seed/minimal/publish.os/blog/layout.tsx +13 -0
- package/init/seed/minimal/publish.os/blog/page.tsx +91 -0
- package/init/seed/minimal/publish.os/components/blog/copy-link.tsx +64 -0
- package/init/seed/minimal/publish.os/components/blog/frontmatter.ts +41 -0
- package/init/seed/minimal/publish.os/docs/content/get-started.mdx +2 -3
- package/init/seed/minimal/publish.os/docs/content/groups.mdx +5 -6
- package/init/seed/minimal/publish.os/publish.os.config.json +17 -2
- package/init/seed/minimal/publish.os/theme.css +3 -3
- package/init/seed/minimal/seed.json +12 -4
- package/init/seed/scratch/publish.os/docs/content/get-started.mdx +1 -1
- package/init/seed/scratch/publish.os/publish.os.config.json +1 -1
- package/package.json +48 -23
- package/release/app/phosphor/package.json +4 -4
- package/release/app/phosphor/pnpm-lock.yaml.template +123 -184
- package/release/compiler/package.json +5 -3
- package/release/compiler/pnpm-lock.yaml.template +153 -183
- package/release/release.json +6 -6
- package/dist/button-CtzUJB8u.d.ts +0 -11
- package/dist/chunk-535TM4A5.js +0 -1455
- package/dist/chunk-B2V22WRT.js +0 -297
- package/dist/chunk-NECL5IBJ.js +0 -318
- package/dist/chunk-SVYGXXYR.js +0 -36
- package/dist/chunk-UF6ATARM.js +0 -1100
- package/dist/compose-NN23UJGC.js +0 -13
- package/dist/ide-support-ZNW7ODFY.js +0 -15
- package/dist/kernel/components/blocks/design-system-preview.d.ts +0 -61
- package/dist/kernel/components/blocks/design-system-preview.js +0 -667
- package/dist/kernel/components/blocks/link-playground.d.ts +0 -5
- package/dist/kernel/components/blocks/link-playground.js +0 -744
- package/dist/kernel/components/blocks/navigation-progress-playground.d.ts +0 -5
- package/dist/kernel/components/blocks/navigation-progress-playground.js +0 -629
- package/dist/kernel/components/ui/theme-toggle.d.ts +0 -24
- package/dist/kernel/components/ui/theme-toggle.js +0 -53
- package/dist/sidebar-types-DKpR27II.d.ts +0 -25
- package/dist/types-BzkZty3r.d.ts +0 -147
- package/dist/types-CJWRG05y.d.ts +0 -76
- package/dist/types-CUtrppxt.d.ts +0 -69
- package/dist/validate-local-source-XRL2Y7XE.js +0 -14
- package/dist/validate-publish-os-source-DAPZ4QGE.js +0 -12
- package/init/seed/minimal/publish.os/assets/favicon/favicon.dark.png +0 -0
- package/init/seed/minimal/publish.os/assets/favicon/favicon.png +0 -0
package/dist/types.d.ts
CHANGED
|
@@ -1,10 +1,90 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
2
|
|
|
3
|
+
type OgImageMetadata$1 = string | {
|
|
4
|
+
src: string;
|
|
5
|
+
alt?: string;
|
|
6
|
+
};
|
|
7
|
+
type OgMetadata$1 = {
|
|
8
|
+
title?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
image?: OgImageMetadata$1;
|
|
11
|
+
};
|
|
12
|
+
type PageStatus$1 = "published" | "draft";
|
|
13
|
+
type PageMetadata$1 = {
|
|
14
|
+
openGraph?: OgMetadata$1;
|
|
15
|
+
robots?: {
|
|
16
|
+
index?: boolean;
|
|
17
|
+
follow?: boolean;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
type PageFrontmatter$1<TCustom extends Record<string, unknown> = Record<string, unknown>> = TCustom & {
|
|
21
|
+
title: string;
|
|
22
|
+
description: string;
|
|
23
|
+
slug: string;
|
|
24
|
+
status: PageStatus$1;
|
|
25
|
+
metadata: PageMetadata$1;
|
|
26
|
+
};
|
|
27
|
+
type PageData$1<TCustom extends Record<string, unknown> = Record<string, unknown>> = {
|
|
28
|
+
fileID: string;
|
|
29
|
+
group: string;
|
|
30
|
+
path: string;
|
|
31
|
+
frontmatter: PageFrontmatter$1<TCustom>;
|
|
32
|
+
body: string;
|
|
33
|
+
};
|
|
34
|
+
type NavigationPageNode = {
|
|
35
|
+
id: string;
|
|
36
|
+
type: "page";
|
|
37
|
+
label: string;
|
|
38
|
+
href: string;
|
|
39
|
+
page: Omit<PageData$1, "body">;
|
|
40
|
+
children?: NavigationNode[];
|
|
41
|
+
};
|
|
42
|
+
type NavigationGroupNode = {
|
|
43
|
+
id: string;
|
|
44
|
+
type: "group";
|
|
45
|
+
label: string;
|
|
46
|
+
groupKey: string;
|
|
47
|
+
route: string;
|
|
48
|
+
presentation: "page" | "folder";
|
|
49
|
+
href?: string;
|
|
50
|
+
children: NavigationNode[];
|
|
51
|
+
};
|
|
52
|
+
type NavigationContainerNode = {
|
|
53
|
+
id: string;
|
|
54
|
+
type: "section" | "folder";
|
|
55
|
+
label: string;
|
|
56
|
+
children: NavigationNode[];
|
|
57
|
+
};
|
|
58
|
+
type NavigationLinkNode = {
|
|
59
|
+
id: string;
|
|
60
|
+
type: "link";
|
|
61
|
+
label: string;
|
|
62
|
+
href: string;
|
|
63
|
+
};
|
|
64
|
+
type NavigationViewNode = {
|
|
65
|
+
id: string;
|
|
66
|
+
type: "view";
|
|
67
|
+
label?: string;
|
|
68
|
+
viewId?: string;
|
|
69
|
+
items: NavigationNode[];
|
|
70
|
+
};
|
|
71
|
+
type NavigationSwitchViewNode = {
|
|
72
|
+
id: string;
|
|
73
|
+
type: "switch-view";
|
|
74
|
+
label: string;
|
|
75
|
+
target: string | {
|
|
76
|
+
view: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
type NavigationNode = NavigationPageNode | NavigationGroupNode | NavigationContainerNode | NavigationLinkNode | NavigationViewNode | NavigationSwitchViewNode;
|
|
80
|
+
type ResolvedNavigation = {
|
|
81
|
+
rootGroup: string;
|
|
82
|
+
items: NavigationNode[];
|
|
83
|
+
};
|
|
84
|
+
|
|
3
85
|
type SearchInput = {
|
|
4
86
|
filters?: {
|
|
5
|
-
author?: string;
|
|
6
87
|
group?: string;
|
|
7
|
-
tag?: string;
|
|
8
88
|
};
|
|
9
89
|
limit?: number;
|
|
10
90
|
offset?: number;
|
|
@@ -21,17 +101,12 @@ type SearchResult = {
|
|
|
21
101
|
excerpt: string;
|
|
22
102
|
id: string;
|
|
23
103
|
meta: {
|
|
24
|
-
author?: string;
|
|
25
104
|
description?: string;
|
|
26
105
|
group?: string;
|
|
27
|
-
image?: string;
|
|
28
106
|
nodeId?: string;
|
|
29
107
|
path?: string;
|
|
30
|
-
publishedAt?: string;
|
|
31
108
|
section?: string;
|
|
32
|
-
tags?: string;
|
|
33
109
|
title?: string;
|
|
34
|
-
updatedAt?: string;
|
|
35
110
|
};
|
|
36
111
|
plainExcerpt: string;
|
|
37
112
|
score?: number;
|
|
@@ -88,7 +163,7 @@ type SiteData = {
|
|
|
88
163
|
name: string;
|
|
89
164
|
description?: string;
|
|
90
165
|
origin?: string;
|
|
91
|
-
|
|
166
|
+
metadata?: IndexMetadata;
|
|
92
167
|
};
|
|
93
168
|
type OgImageMetadata = string | {
|
|
94
169
|
src: string;
|
|
@@ -99,8 +174,10 @@ type OgMetadata = {
|
|
|
99
174
|
description?: string;
|
|
100
175
|
image?: OgImageMetadata;
|
|
101
176
|
};
|
|
102
|
-
type
|
|
103
|
-
|
|
177
|
+
type IndexMetadata = {
|
|
178
|
+
openGraph?: OgMetadata & {
|
|
179
|
+
scope?: "page" | "subtree";
|
|
180
|
+
};
|
|
104
181
|
};
|
|
105
182
|
type Author = {
|
|
106
183
|
id?: string;
|
|
@@ -109,83 +186,32 @@ type Author = {
|
|
|
109
186
|
avatar?: string;
|
|
110
187
|
url?: string;
|
|
111
188
|
};
|
|
112
|
-
type PageStatus = "published" | "draft"
|
|
113
|
-
type
|
|
189
|
+
type PageStatus = "published" | "draft";
|
|
190
|
+
type PageMetadata = {
|
|
191
|
+
openGraph?: OgMetadata;
|
|
192
|
+
robots?: {
|
|
193
|
+
index?: boolean;
|
|
194
|
+
follow?: boolean;
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
type PageFrontmatter<TCustom extends Record<string, unknown> = Record<string, unknown>> = TCustom & {
|
|
114
198
|
title: string;
|
|
115
|
-
|
|
116
|
-
description?: string;
|
|
117
|
-
status?: PageStatus;
|
|
118
|
-
publishedAt?: string;
|
|
119
|
-
updatedAt?: string;
|
|
120
|
-
authors?: (string | Author)[];
|
|
121
|
-
tags?: string[];
|
|
122
|
-
[key: string]: unknown;
|
|
123
|
-
};
|
|
124
|
-
type PageData<TMeta extends Record<string, unknown> = Record<string, unknown>> = {
|
|
125
|
-
fileID: string;
|
|
126
|
-
group: string;
|
|
199
|
+
description: string;
|
|
127
200
|
slug: string;
|
|
128
|
-
path: string;
|
|
129
|
-
title: string;
|
|
130
|
-
description?: string;
|
|
131
201
|
status: PageStatus;
|
|
132
|
-
|
|
133
|
-
updatedAt?: string;
|
|
134
|
-
authors: Author[];
|
|
135
|
-
tags: string[];
|
|
136
|
-
og?: OgMetadata;
|
|
137
|
-
meta: TMeta;
|
|
138
|
-
body: string;
|
|
139
|
-
};
|
|
140
|
-
type PageSummary<TMeta extends Record<string, unknown> = Record<string, unknown>> = Omit<PageData<TMeta>, "body"> & {
|
|
141
|
-
body?: string;
|
|
202
|
+
metadata: PageMetadata;
|
|
142
203
|
};
|
|
143
|
-
type
|
|
144
|
-
type: "page";
|
|
204
|
+
type PageData<TCustom extends Record<string, unknown> = Record<string, unknown>> = {
|
|
145
205
|
fileID: string;
|
|
146
|
-
title: string;
|
|
147
|
-
path: string;
|
|
148
|
-
href?: string;
|
|
149
206
|
group: string;
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
updatedAt?: string;
|
|
154
|
-
authors: Author[];
|
|
155
|
-
tags?: string[];
|
|
156
|
-
og?: OgMetadata;
|
|
157
|
-
meta: Record<string, unknown>;
|
|
158
|
-
};
|
|
159
|
-
type SectionNode = {
|
|
160
|
-
type: "section";
|
|
161
|
-
id: string;
|
|
162
|
-
title: string;
|
|
163
|
-
path?: string;
|
|
164
|
-
href?: string;
|
|
165
|
-
group?: string;
|
|
166
|
-
children: TreeNode[];
|
|
167
|
-
};
|
|
168
|
-
type FolderNode = {
|
|
169
|
-
type: "folder";
|
|
170
|
-
id: string;
|
|
171
|
-
title: string;
|
|
172
|
-
path?: string;
|
|
173
|
-
href?: string;
|
|
174
|
-
group?: string;
|
|
175
|
-
children: TreeNode[];
|
|
207
|
+
path: string;
|
|
208
|
+
frontmatter: PageFrontmatter<TCustom>;
|
|
209
|
+
body: string;
|
|
176
210
|
};
|
|
177
|
-
type
|
|
178
|
-
|
|
179
|
-
id: string;
|
|
180
|
-
title: string;
|
|
181
|
-
href: string;
|
|
211
|
+
type PageSummary<TCustom extends Record<string, unknown> = Record<string, unknown>> = Omit<PageData<TCustom>, "body"> & {
|
|
212
|
+
body?: string;
|
|
182
213
|
};
|
|
183
|
-
|
|
184
|
-
type NavPage = PageNode;
|
|
185
|
-
type NavLink = LinkNode;
|
|
186
|
-
type NavSection = SectionNode;
|
|
187
|
-
type NavFolder = FolderNode;
|
|
188
|
-
type NavItem = TreeNode;
|
|
214
|
+
|
|
189
215
|
type RouteRecord = {
|
|
190
216
|
fileID: string;
|
|
191
217
|
slug: string;
|
|
@@ -207,9 +233,9 @@ type GroupManifest = {
|
|
|
207
233
|
path: string;
|
|
208
234
|
origin?: string;
|
|
209
235
|
ancestry?: string[];
|
|
210
|
-
|
|
236
|
+
metadata?: IndexMetadata;
|
|
211
237
|
meta?: Record<string, unknown>;
|
|
212
|
-
|
|
238
|
+
navigation: ResolvedNavigation;
|
|
213
239
|
pages: PageData[];
|
|
214
240
|
};
|
|
215
241
|
type ManifestLike = {
|
|
@@ -217,42 +243,42 @@ type ManifestLike = {
|
|
|
217
243
|
groups: Record<string, GroupManifest>;
|
|
218
244
|
routes: RouteRecord[];
|
|
219
245
|
pages: PageData[];
|
|
220
|
-
tree: TreeNode[];
|
|
221
246
|
attribution?: Record<string, ResolvedAttribution>;
|
|
222
247
|
contentHash: string;
|
|
223
248
|
};
|
|
224
249
|
type RootLayoutProps = {
|
|
225
250
|
children: React.ReactNode;
|
|
226
251
|
site: SiteData;
|
|
227
|
-
|
|
252
|
+
navigation: ResolvedNavigation;
|
|
228
253
|
currentPath?: string;
|
|
229
254
|
currentGroup?: GroupContext;
|
|
230
255
|
activeGroups?: readonly GroupContext[];
|
|
231
256
|
};
|
|
232
257
|
type RootPageProps = {
|
|
233
258
|
site: SiteData;
|
|
234
|
-
|
|
259
|
+
navigation: ResolvedNavigation;
|
|
235
260
|
};
|
|
236
261
|
type LayoutProps = {
|
|
237
262
|
children: React.ReactNode;
|
|
238
263
|
site: SiteData;
|
|
239
|
-
|
|
240
|
-
node:
|
|
264
|
+
navigation: ResolvedNavigation;
|
|
265
|
+
node: NavigationNode;
|
|
241
266
|
currentPath: string;
|
|
242
267
|
group: string;
|
|
243
268
|
};
|
|
244
269
|
type PageProps<TMeta extends Record<string, unknown> = Record<string, unknown>> = {
|
|
245
270
|
site: SiteData;
|
|
246
|
-
|
|
247
|
-
node:
|
|
271
|
+
navigation: ResolvedNavigation;
|
|
272
|
+
node: NavigationNode;
|
|
248
273
|
page: PageData<TMeta>;
|
|
274
|
+
markdownRevision?: string;
|
|
249
275
|
currentPath: string;
|
|
250
276
|
group: string;
|
|
251
277
|
};
|
|
252
278
|
type IndexPageProps = {
|
|
253
279
|
site: SiteData;
|
|
254
|
-
|
|
255
|
-
node:
|
|
280
|
+
navigation: ResolvedNavigation;
|
|
281
|
+
node: NavigationNode;
|
|
256
282
|
currentPath: string;
|
|
257
283
|
group: string;
|
|
258
284
|
};
|
|
@@ -273,4 +299,4 @@ type GroupContext = {
|
|
|
273
299
|
|
|
274
300
|
declare const __publishOsTypesModule = true;
|
|
275
301
|
|
|
276
|
-
export { type Author, type
|
|
302
|
+
export { type Author, type GroupContext, type GroupForcedMode, type GroupManifest, type Heading, type IndexMetadata, type IndexPageProps, type LayoutProps, type ManifestLike, type NavigationContainerNode, type NavigationGroupNode, type NavigationLinkNode, type NavigationNode, type NavigationPageNode, type NavigationSwitchViewNode, type NavigationViewNode, type OgImageMetadata, type OgMetadata, type PageData, type PageFrontmatter, type PageMetadata, type PageProps, type PageStatus, type PageSummary, type ResolvedAttribution, type ResolvedNavigation, type RootLayoutProps, type RootPageProps, type RouteRecord, type SearchBlockActions, type SearchBlockContextValue, type SearchBlockMeta, type SearchBlockState, type SearchInput, type SearchOutput, type SearchResult, type SearchStatus, type SearchSubResult, type SiteData, type ThemeMode, __publishOsTypesModule };
|
|
@@ -1,6 +1,29 @@
|
|
|
1
1
|
// src/components/mdx/heading-ids.ts
|
|
2
2
|
import { isValidElement } from "react";
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
// src/components/mdx/heading-string.ts
|
|
5
|
+
var SELF_CLOSING_TAG_RE = /<[^>]+\/>/g, PAIRED_TAG_RE = /<\/?\w[^>]*>/g, MDX_BOLD_RE = /\*\*(.*?)\*\*/g, MDX_ITALIC_RE = /\*(.*?)\*/g, MDX_UNDERLINE_BOLD_RE = /__(.*?)__/g, MDX_UNDERLINE_ITALIC_RE = /_(.*?)_/g, MDX_STRIKETHROUGH_RE = /~~(.*?)~~/g, MDX_INLINE_CODE_RE = /`(.*?)`/g, MDX_LINK_RE = /\[(.*?)\]\(.*?\)/g, NON_ALPHANUMERIC_RE = /[^a-z0-9]+/g, LEADING_TRAILING_HYPHEN_RE = /^-+|-+$/g, LEADING_DIGIT_RE = /^(\d)/;
|
|
6
|
+
function cleanHeadingString(input) {
|
|
7
|
+
return input.replace(SELF_CLOSING_TAG_RE, "").replace(PAIRED_TAG_RE, "").replace(MDX_BOLD_RE, "$1").replace(MDX_ITALIC_RE, "$1").replace(MDX_UNDERLINE_BOLD_RE, "$1").replace(MDX_UNDERLINE_ITALIC_RE, "$1").replace(MDX_STRIKETHROUGH_RE, "$1").replace(MDX_INLINE_CODE_RE, "$1").replace(MDX_LINK_RE, "$1").trim();
|
|
8
|
+
}
|
|
9
|
+
function headingStringToHTMLId(input) {
|
|
10
|
+
let text = cleanHeadingString(input);
|
|
11
|
+
return text ? text.toLowerCase().replace(NON_ALPHANUMERIC_RE, "-").replace(LEADING_TRAILING_HYPHEN_RE, "").replace(LEADING_DIGIT_RE, "id-$1") || "heading" : "empty-heading";
|
|
12
|
+
}
|
|
13
|
+
function createHeadingStringIdGenerator() {
|
|
14
|
+
let nextSuffix = /* @__PURE__ */ new Map(), usedIds = /* @__PURE__ */ new Set();
|
|
15
|
+
return (input) => {
|
|
16
|
+
let baseId = headingStringToHTMLId(input);
|
|
17
|
+
if (baseId === "empty-heading") return baseId;
|
|
18
|
+
let suffix = nextSuffix.get(baseId) ?? 0, id = suffix === 0 ? baseId : `${baseId}-${suffix}`;
|
|
19
|
+
for (; usedIds.has(id); )
|
|
20
|
+
suffix += 1, id = `${baseId}-${suffix}`;
|
|
21
|
+
return nextSuffix.set(baseId, suffix + 1), usedIds.add(id), id;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// src/components/mdx/heading-ids.ts
|
|
26
|
+
var HEADING_RE = /^(#{1,6})[ \t]+(.+?)\s*#*\s*$/gm, FENCED_CODE_RE = /```[\s\S]*?```|~~~[\s\S]*?~~~/g;
|
|
4
27
|
function extractText(node) {
|
|
5
28
|
if (typeof node == "string") return node;
|
|
6
29
|
if (typeof node == "number") return String(node);
|
|
@@ -14,26 +37,22 @@ function extractText(node) {
|
|
|
14
37
|
return "";
|
|
15
38
|
}
|
|
16
39
|
function cleanHeadingText(input) {
|
|
17
|
-
|
|
40
|
+
let text = typeof input == "string" ? input : extractText(input);
|
|
41
|
+
return cleanHeadingString(text);
|
|
18
42
|
}
|
|
19
43
|
function slugify(text) {
|
|
20
|
-
return text
|
|
44
|
+
return headingStringToHTMLId(text);
|
|
21
45
|
}
|
|
22
46
|
function headingToHTMLId(input) {
|
|
23
47
|
try {
|
|
24
|
-
return slugify(cleanHeadingText(input)) || "empty-heading";
|
|
48
|
+
return slugify(cleanHeadingText(input)) || (cleanHeadingText(input) ? "heading" : "empty-heading");
|
|
25
49
|
} catch {
|
|
26
50
|
return "empty-heading";
|
|
27
51
|
}
|
|
28
52
|
}
|
|
29
53
|
function createHeadingIdGenerator() {
|
|
30
|
-
let
|
|
31
|
-
return (input) =>
|
|
32
|
-
let baseId = headingToHTMLId(input);
|
|
33
|
-
if (baseId === "empty-heading") return baseId;
|
|
34
|
-
let count = usedIds.get(baseId) ?? 0;
|
|
35
|
-
return usedIds.set(baseId, count + 1), count === 0 ? baseId : `${baseId}-${count}`;
|
|
36
|
-
};
|
|
54
|
+
let headingId = createHeadingStringIdGenerator();
|
|
55
|
+
return (input) => headingId(cleanHeadingText(input));
|
|
37
56
|
}
|
|
38
57
|
function extractMdxHeadings(content = "", levels) {
|
|
39
58
|
let [minDepth, maxDepth] = levels, headingId = createHeadingIdGenerator(), headings = [], searchableContent = content.replace(FENCED_CODE_RE, "");
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// src/components/block/toc/selection.ts
|
|
2
|
+
function findActiveHeadingIndex(headings, readingLine, isAtBottom = !1) {
|
|
3
|
+
if (headings.length === 0) return -1;
|
|
4
|
+
if (isAtBottom) return headings.length - 1;
|
|
5
|
+
let low = 0, high = headings.length;
|
|
6
|
+
for (; low < high; ) {
|
|
7
|
+
let middle = low + Math.floor((high - low) / 2), heading = headings[middle];
|
|
8
|
+
heading && heading.top <= readingLine ? low = middle + 1 : high = middle;
|
|
9
|
+
}
|
|
10
|
+
return Math.max(0, low - 1);
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
findActiveHeadingIndex
|
|
14
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
validateLocalSource
|
|
3
|
+
} from "./chunk-SBMDONTV.js";
|
|
4
|
+
import "./chunk-NNBJZPFM.js";
|
|
5
|
+
import "./chunk-DZ3VWEV5.js";
|
|
6
|
+
import "./chunk-7NY22B5U.js";
|
|
7
|
+
import "./chunk-DX7PXFCM.js";
|
|
8
|
+
import "./chunk-EFO6AWXN.js";
|
|
9
|
+
import "./chunk-5KAD7W53.js";
|
|
10
|
+
import "./chunk-WL75GQ5M.js";
|
|
11
|
+
import "./chunk-AI2UULNX.js";
|
|
12
|
+
import "./chunk-5J3YUNRY.js";
|
|
13
|
+
import "./chunk-22RSSUNV.js";
|
|
14
|
+
export {
|
|
15
|
+
validateLocalSource
|
|
16
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
validatePublishOsSource
|
|
3
|
+
} from "./chunk-DZ3VWEV5.js";
|
|
4
|
+
import "./chunk-7NY22B5U.js";
|
|
5
|
+
import "./chunk-DX7PXFCM.js";
|
|
6
|
+
import "./chunk-EFO6AWXN.js";
|
|
7
|
+
import "./chunk-5KAD7W53.js";
|
|
8
|
+
import "./chunk-WL75GQ5M.js";
|
|
9
|
+
import "./chunk-AI2UULNX.js";
|
|
10
|
+
import "./chunk-5J3YUNRY.js";
|
|
11
|
+
import "./chunk-22RSSUNV.js";
|
|
12
|
+
export {
|
|
13
|
+
validatePublishOsSource
|
|
14
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1600" height="800" viewBox="0 0 1600 800" fill="none">
|
|
2
|
+
<rect width="1600" height="800" fill="#101214"/>
|
|
3
|
+
<g stroke="#343A40" stroke-width="2">
|
|
4
|
+
<path d="M160 240H1440M160 320H1440M160 480H1440M160 560H1440"/>
|
|
5
|
+
<path d="M160 400H560C640 400 640 280 720 280H880C960 280 960 400 1040 400H1440"/>
|
|
6
|
+
<path d="M160 400H560C640 400 640 520 720 520H880C960 520 960 400 1040 400H1440"/>
|
|
7
|
+
</g>
|
|
8
|
+
<path d="M160 400H1440" stroke="#A9CFFF" stroke-width="3"/>
|
|
9
|
+
<circle cx="800" cy="400" r="50" fill="#101214" stroke="#A9CFFF" stroke-width="3"/>
|
|
10
|
+
<path d="m786 383-17 17 17 17m28-34 17 17-17 17" stroke="#A9CFFF" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
|
|
11
|
+
<g fill="#727C86"><circle cx="160" cy="240" r="4"/><circle cx="160" cy="320" r="4"/><circle cx="160" cy="480" r="4"/><circle cx="160" cy="560" r="4"/></g>
|
|
12
|
+
<circle cx="160" cy="400" r="4" fill="#A9CFFF"/>
|
|
13
|
+
</svg>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect width="512" height="512" rx="120" fill="#181818"/>
|
|
3
|
+
<rect x="6" y="6" width="500" height="500" rx="114" stroke="white" stroke-opacity="0.18" stroke-width="12"/>
|
|
4
|
+
<g clip-path="url(#clip0_1715_626)">
|
|
5
|
+
<path d="M273.137 237.996L306.335 157.85L343.538 173.259L310.7 252.535L372.044 191.192L400.518 219.666L339.839 280.343L419.988 247.145L435.398 284.348L307.078 337.498L312.354 339.684H196.574L201.851 337.498L73.5332 284.348L88.9434 247.145L166.473 279.258L106.881 219.666L135.354 191.192L194.937 250.774L162.829 173.259L200.032 157.85L232.869 237.124V152.184H273.137V237.996Z" fill="white"/>
|
|
6
|
+
<rect x="68.5" y="319.551" width="375" height="40.2685" fill="white"/>
|
|
7
|
+
</g>
|
|
8
|
+
<defs>
|
|
9
|
+
<clipPath id="clip0_1715_626">
|
|
10
|
+
<rect width="375" height="375" fill="white" transform="translate(68.5 68.5)"/>
|
|
11
|
+
</clipPath>
|
|
12
|
+
</defs>
|
|
13
|
+
</svg>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect width="512" height="512" rx="120" fill="white"/>
|
|
3
|
+
<rect x="6" y="6" width="500" height="500" rx="114" stroke="#291E00" stroke-opacity="0.2" stroke-width="12"/>
|
|
4
|
+
<g clip-path="url(#clip0_1715_611)">
|
|
5
|
+
<path d="M273.137 237.996L306.335 157.85L343.538 173.259L310.7 252.535L372.044 191.192L400.518 219.666L339.839 280.343L419.988 247.145L435.398 284.348L307.078 337.498L312.354 339.684H196.574L201.851 337.498L73.5332 284.348L88.9434 247.145L166.473 279.258L106.881 219.666L135.354 191.192L194.937 250.774L162.829 173.259L200.032 157.85L232.869 237.124V152.184H273.137V237.996Z" fill="#161000"/>
|
|
6
|
+
<rect x="68.5" y="319.551" width="375" height="40.2685" fill="#161000"/>
|
|
7
|
+
</g>
|
|
8
|
+
<defs>
|
|
9
|
+
<clipPath id="clip0_1715_611">
|
|
10
|
+
<rect width="375" height="375" fill="white" transform="translate(68.5 68.5)"/>
|
|
11
|
+
</clipPath>
|
|
12
|
+
</defs>
|
|
13
|
+
</svg>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Hello, world.
|
|
3
|
+
description: Publish your first post and make this blog your own.
|
|
4
|
+
publishedAt: 2026-10-20
|
|
5
|
+
authors: [Matthew B]
|
|
6
|
+
tags: [Press]
|
|
7
|
+
image:
|
|
8
|
+
src: /assets/blog/hello-world.svg
|
|
9
|
+
alt: A code symbol where several publishing paths meet.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
Use this blog to share news, releases, and what you learn. Edit this post in `publish.os/blog/content/hello-world.mdx`.
|
|
13
|
+
|
|
14
|
+
## Add a post
|
|
15
|
+
|
|
16
|
+
Create another `.mdx` file in `publish.os/blog/content/`:
|
|
17
|
+
|
|
18
|
+
```mdx
|
|
19
|
+
---
|
|
20
|
+
title: A small beginning
|
|
21
|
+
description: Why this project exists.
|
|
22
|
+
publishedAt: 2026-10-21
|
|
23
|
+
authors: [Matthew B]
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
This project starts with one problem and one useful solution.
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The blog index shows published posts, newest first. Set `publishedAt` to edit the publication date.
|
|
30
|
+
|
|
31
|
+
## Customize the blog
|
|
32
|
+
|
|
33
|
+
Edit `index.tsx` to change the post list at `/blog`. Edit `page.tsx` to change individual posts. The shared [theme](/docs/themes) supplies colors and typography.
|
|
34
|
+
|
|
35
|
+
```txt
|
|
36
|
+
publish.os/blog/
|
|
37
|
+
├── layout.tsx
|
|
38
|
+
├── index.tsx
|
|
39
|
+
├── page.tsx
|
|
40
|
+
└── content/
|
|
41
|
+
├── hello-world.mdx
|
|
42
|
+
└── series-a.mdx
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
Edit `layout.tsx` to change the blog layout.
|
|
47
|
+
|
|
48
|
+
Add `tags` and an `image` with `src` and `alt` to a post's frontmatter to customize its header. Keep local images in `publish.os/assets/` and reference them with `/assets/` paths.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Our $5M Series A
|
|
3
|
+
description: A fictional funding announcement for your starter blog.
|
|
4
|
+
publishedAt: 2026-10-18
|
|
5
|
+
authors: [Matthew B]
|
|
6
|
+
tags: [Company news]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
Example Co. raised $5 million in Series A funding to help teams publish useful documentation. We will use the investment to grow the team and improve the product.
|
|
10
|
+
|
|
11
|
+
This is a fictional announcement for the starter site. Replace it with your own news.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { authoredDate, authorNames } from "@components/blog/frontmatter";
|
|
2
|
+
import type {
|
|
3
|
+
IndexPageProps,
|
|
4
|
+
NavigationNode,
|
|
5
|
+
NavigationPageNode,
|
|
6
|
+
} from "@publish.os/nextjs/types";
|
|
7
|
+
import { prettyDate } from "@publish.os/nextjs/utils/pretty-date";
|
|
8
|
+
import Link from "next/link";
|
|
9
|
+
|
|
10
|
+
function pageNodes(nodes: NavigationNode[]): NavigationPageNode[] {
|
|
11
|
+
return nodes.flatMap((node) => {
|
|
12
|
+
if (node.type === "page") return [node];
|
|
13
|
+
if (
|
|
14
|
+
node.type === "section" ||
|
|
15
|
+
node.type === "folder" ||
|
|
16
|
+
node.type === "group"
|
|
17
|
+
) {
|
|
18
|
+
return pageNodes(node.children);
|
|
19
|
+
}
|
|
20
|
+
if (node.type === "view") return pageNodes(node.items);
|
|
21
|
+
return [];
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default function BlogIndex({ node, navigation }: IndexPageProps) {
|
|
26
|
+
const posts = pageNodes(navigation.items).filter(
|
|
27
|
+
(entry) => entry.page.frontmatter.status === "published",
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<section className="w-full px-4 py-12 md:px-5 lg:px-6 lg:py-16">
|
|
32
|
+
<h1 className="mb-10 text-balance text-5xl font-medium leading-none tracking-tight text-foreground-1">
|
|
33
|
+
{node.type === "page" ? node.page.frontmatter.title : node.label}
|
|
34
|
+
</h1>
|
|
35
|
+
{posts.length > 0 ? (
|
|
36
|
+
<ul>
|
|
37
|
+
{posts.map((post) => {
|
|
38
|
+
const authors = authorNames(post.page.frontmatter.authors);
|
|
39
|
+
const publishedAt = authoredDate(post.page.frontmatter.publishedAt);
|
|
40
|
+
const date = prettyDate(publishedAt);
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<li
|
|
44
|
+
className="border-b border-stroke-4 last:border-b-0"
|
|
45
|
+
key={post.page.path}
|
|
46
|
+
>
|
|
47
|
+
<Link
|
|
48
|
+
className="-mx-4 flex min-h-12 items-center gap-6 rounded-card px-4 py-4 text-sm text-foreground-1 hover:bg-surface-hover active:bg-surface-active focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-stroke"
|
|
49
|
+
href={post.href}
|
|
50
|
+
title={post.page.frontmatter.title}
|
|
51
|
+
>
|
|
52
|
+
<span className="min-w-0 flex-1 truncate">
|
|
53
|
+
{post.page.frontmatter.title}
|
|
54
|
+
</span>
|
|
55
|
+
<span className="hidden min-w-0 max-w-[45%] items-baseline gap-1.5 text-foreground-3 md:flex">
|
|
56
|
+
{authors ? (
|
|
57
|
+
<span className="truncate">{authors}</span>
|
|
58
|
+
) : null}
|
|
59
|
+
{authors && date ? <span aria-hidden="true">·</span> : null}
|
|
60
|
+
{date ? (
|
|
61
|
+
<time
|
|
62
|
+
className="shrink-0 whitespace-nowrap"
|
|
63
|
+
dateTime={publishedAt}
|
|
64
|
+
>
|
|
65
|
+
{date}
|
|
66
|
+
</time>
|
|
67
|
+
) : null}
|
|
68
|
+
</span>
|
|
69
|
+
<span
|
|
70
|
+
aria-hidden="true"
|
|
71
|
+
className="shrink-0 text-foreground-2 md:hidden rtl:rotate-180"
|
|
72
|
+
>
|
|
73
|
+
→
|
|
74
|
+
</span>
|
|
75
|
+
</Link>
|
|
76
|
+
</li>
|
|
77
|
+
);
|
|
78
|
+
})}
|
|
79
|
+
</ul>
|
|
80
|
+
) : (
|
|
81
|
+
<p className="text-sm text-foreground-2">No posts yet.</p>
|
|
82
|
+
)}
|
|
83
|
+
</section>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { LayoutProps } from "@publish.os/nextjs/types";
|
|
2
|
+
|
|
3
|
+
export default function BlogLayout({ children }: LayoutProps) {
|
|
4
|
+
return (
|
|
5
|
+
<main
|
|
6
|
+
className="mx-auto flex min-h-0 min-w-0 w-full max-w-(--layout-site-max-width) flex-1 flex-col border-x border-stroke-3 bg-surface-1"
|
|
7
|
+
id="main-content"
|
|
8
|
+
tabIndex={-1}
|
|
9
|
+
>
|
|
10
|
+
{children}
|
|
11
|
+
</main>
|
|
12
|
+
);
|
|
13
|
+
}
|