@publish.os/nextjs 0.0.1-alpha.81 → 0.0.1-alpha.91
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/app/globals.css +1 -0
- package/compiler-assets/nextjs/defaults/group/index.tsx +50 -0
- package/compiler-assets/nextjs/defaults/group/layout.tsx +8 -8
- package/compiler-assets/nextjs/defaults/group/page.tsx +44 -43
- package/compiler-assets/nextjs/defaults/project/next.config.mjs +33 -13
- package/compiler-assets/nextjs/defaults/project/tsconfig.json.template +10 -3
- package/compiler-assets/nextjs/defaults/root/css/animation.css +131 -0
- package/compiler-assets/nextjs/defaults/root/css/components/code-block.css +18 -0
- package/compiler-assets/nextjs/defaults/root/css/components/dialog.css +4 -1
- package/compiler-assets/nextjs/defaults/root/css/components/menu.css +1 -1
- package/compiler-assets/nextjs/defaults/root/css/components/navigation-menu.css +1 -1
- package/compiler-assets/nextjs/defaults/root/css/components/popover.css +1 -1
- package/compiler-assets/nextjs/defaults/root/css/components/select.css +1 -1
- package/compiler-assets/nextjs/defaults/root/css/components/tooltip.css +1 -1
- package/compiler-assets/nextjs/defaults/root/css/shadow.css +6 -25
- package/compiler-assets/nextjs/defaults/root/css/typography.css +51 -68
- package/compiler-assets/nextjs/defaults/root/globals.css +25 -0
- package/compiler-assets/nextjs/defaults/root/{page.tsx → index.tsx} +6 -2
- package/compiler-assets/nextjs/defaults/root/layout.tsx +7 -1
- package/compiler-assets/nextjs/defaults/root/theme.css +22 -22
- package/compiler-assets/nextjs/shims/document.tsx +38 -0
- package/compiler-assets/nextjs/shims/generated-group-page.tsx +19 -2
- package/compiler-assets/nextjs/shims/generated-leaf-page.tsx +18 -2
- package/compiler-assets/nextjs/shims/global-layout.tsx +19 -85
- 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 +143 -65
- package/compiler-assets/nextjs/shims/publish-os-theme-provider.tsx +76 -15
- package/compiler-assets/nextjs/shims/root-page.tsx +7 -1
- package/compiler-assets/nextjs/shims/site-fenced-code-block.tsx +30 -0
- package/compiler-assets/nextjs/shims/site-heading-level.tsx +14 -0
- package/compiler-assets/nextjs/shims/site-mdx-components.tsx +112 -0
- package/compiler-assets/nextjs/shims/site-mdx.tsx +17 -0
- package/compiler-assets/nextjs/shims/theme-defaults.css +41 -25
- package/dist/build-operation-5QMLXF7N.js +89 -0
- package/dist/{button-CFdx-ohV.d.ts → button-BdCScEKi.d.ts} +6 -6
- package/dist/capture-local-source-WGGDIUU2.js +258 -0
- package/dist/chunk-22RSSUNV.js +13 -0
- package/dist/chunk-4BC2L2KA.js +620 -0
- package/dist/chunk-5J3YUNRY.js +121 -0
- package/dist/chunk-5KAD7W53.js +248 -0
- package/dist/chunk-6C65KV7O.js +142 -0
- package/dist/chunk-6D2E6UMD.js +695 -0
- package/dist/chunk-7NY22B5U.js +161 -0
- package/dist/chunk-AI2UULNX.js +9 -0
- package/dist/chunk-EFO6AWXN.js +19 -0
- package/dist/chunk-F3AGNDF4.js +2377 -0
- package/dist/chunk-GBPLER5H.js +426 -0
- package/dist/chunk-IL4RJOKI.js +186 -0
- package/dist/chunk-NNBJZPFM.js +193 -0
- package/dist/chunk-ORIUWJBQ.js +58 -0
- package/dist/chunk-OXOFRXEI.js +7129 -0
- package/dist/chunk-UYGCOWRF.js +1709 -0
- package/dist/chunk-WL75GQ5M.js +80 -0
- package/dist/compiler.d.ts +54 -7
- package/dist/compiler.js +121 -13147
- package/dist/components/blocks/agent-actions.d.ts +81 -0
- package/dist/components/blocks/agent-actions.js +594 -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 +5 -0
- package/dist/components/ui/button.js +94 -0
- package/dist/compose-CVBJRAF6.js +16 -0
- package/dist/config/createNextConfig.js +27 -0
- package/dist/dev-operation-OSHHWRWK.js +1095 -0
- package/dist/framework-selection-ZVO323PK.js +11 -0
- package/dist/ide-support-CU6Z5PVR.js +16 -0
- package/dist/index.d.ts +55 -4
- 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 +35 -6
- package/dist/kernel/components/blocks/AgentActions.js +401 -150
- package/dist/kernel/components/blocks/agent-actions.d.ts +5 -0
- package/dist/kernel/components/blocks/agent-actions.js +594 -0
- package/dist/kernel/components/blocks/animated-icon-swap.js +1 -1
- package/dist/kernel/components/blocks/color-palette.js +4 -4
- package/dist/kernel/components/blocks/logo-block.js +3 -3
- package/dist/kernel/components/blocks/nav-breadcrumb.d.ts +10 -2
- package/dist/kernel/components/blocks/nav-breadcrumb.js +22 -7
- package/dist/kernel/components/blocks/navbar.d.ts +2 -2
- package/dist/kernel/components/blocks/navbar.js +406 -65
- package/dist/kernel/components/blocks/navigation-progress.js +6 -3
- package/dist/kernel/components/blocks/next-prev.d.ts +1 -1
- package/dist/kernel/components/blocks/next-prev.js +12 -24
- package/dist/kernel/components/blocks/page-list.d.ts +1 -1
- package/dist/kernel/components/blocks/page-list.js +7 -6
- package/dist/kernel/components/blocks/search.d.ts +83 -58
- package/dist/kernel/components/blocks/search.js +554 -428
- package/dist/kernel/components/blocks/sidebar-node.d.ts +2 -2
- package/dist/kernel/components/blocks/sidebar-node.js +12 -10
- package/dist/kernel/components/blocks/sidebar.d.ts +3 -3
- package/dist/kernel/components/blocks/sidebar.js +24 -14
- package/dist/kernel/components/blocks/theme-toggle.d.ts +2 -2
- package/dist/kernel/components/blocks/theme-toggle.js +47 -1
- 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 +19 -1
- package/dist/kernel/components/blocks/toc.js +122 -180
- package/dist/kernel/components/mdx/components/blockquote.js +2 -2
- package/dist/kernel/components/mdx/components/callout.d.ts +5 -7
- package/dist/kernel/components/mdx/components/callout.js +67 -36
- package/dist/kernel/components/mdx/components/code-block.d.ts +5 -2
- package/dist/kernel/components/mdx/components/code-block.js +106 -5
- package/dist/kernel/components/mdx/components/copy-code-button.d.ts +8 -0
- package/dist/kernel/components/mdx/components/copy-code-button.js +61 -0
- package/dist/kernel/components/mdx/components/figure-caption.d.ts +1 -1
- package/dist/kernel/components/mdx/components/figure-caption.js +4 -3
- package/dist/kernel/components/mdx/components/figure.d.ts +6 -2
- package/dist/kernel/components/mdx/components/figure.js +24 -14
- package/dist/kernel/components/mdx/components/footnotes.js +1 -1
- package/dist/kernel/components/mdx/components/heading-copy-link.js +4 -4
- package/dist/kernel/components/mdx/components/heading.js +6 -3
- package/dist/kernel/components/mdx/components/hr.js +2 -2
- package/dist/kernel/components/mdx/components/image-zoom.js +2 -2
- package/dist/kernel/components/mdx/components/image.d.ts +1 -1
- package/dist/kernel/components/mdx/components/image.js +94 -68
- package/dist/kernel/components/mdx/components/inline-code.js +2 -2
- package/dist/kernel/components/mdx/components/kbd.d.ts +2 -2
- package/dist/kernel/components/mdx/components/kbd.js +5 -4
- package/dist/kernel/components/mdx/components/link.d.ts +35 -4
- package/dist/kernel/components/mdx/components/link.js +3 -3
- package/dist/kernel/components/mdx/components/paragraph.js +2 -5
- package/dist/kernel/components/mdx/components/strikethrough.js +1 -1
- package/dist/kernel/components/mdx/components/table.js +2 -2
- package/dist/kernel/components/mdx/components/task-list.js +2 -2
- package/dist/kernel/components/mdx/components/video-player.d.ts +6 -2
- package/dist/kernel/components/mdx/components/video-player.js +8 -4
- package/dist/kernel/components/mdx/components/video.d.ts +5 -3
- package/dist/kernel/components/mdx/components/video.js +8 -6
- package/dist/kernel/components/mdx/error-boundary.js +2 -2
- package/dist/kernel/components/mdx/error-fallback.js +1 -1
- package/dist/kernel/components/mdx/mdx.d.ts +28 -14
- package/dist/kernel/components/mdx/mdx.js +336 -63
- package/dist/kernel/components/mdx/rehype-heading-ids.d.ts +1 -0
- package/dist/kernel/components/mdx/rehype-heading-ids.js +6 -4
- 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.js +1 -1
- package/dist/kernel/components/ui/breadcrumb-trail.d.ts +6 -23
- package/dist/kernel/components/ui/breadcrumb-trail.js +2 -2
- package/dist/kernel/components/ui/breadcrumb.d.ts +11 -3
- package/dist/kernel/components/ui/breadcrumb.js +10 -8
- package/dist/kernel/components/ui/button-group.js +8 -7
- package/dist/kernel/components/ui/button.d.ts +58 -6
- package/dist/kernel/components/ui/button.js +43 -39
- package/dist/kernel/components/ui/card.d.ts +2 -2
- package/dist/kernel/components/ui/card.js +1 -1
- package/dist/kernel/components/ui/dialog.js +1 -1
- package/dist/kernel/components/ui/drawer.d.ts +3 -1
- package/dist/kernel/components/ui/drawer.js +6 -2
- 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.js +10 -17
- package/dist/kernel/components/ui/link.d.ts +11 -3
- package/dist/kernel/components/ui/link.js +12 -11
- package/dist/kernel/components/ui/menu.js +6 -6
- package/dist/kernel/components/ui/mod-key.d.ts +10 -0
- package/dist/kernel/components/ui/mod-key.js +36 -0
- package/dist/kernel/components/ui/navigation-menu.js +3 -3
- package/dist/kernel/components/ui/popover.js +1 -1
- package/dist/kernel/components/ui/progress.js +2 -2
- package/dist/kernel/components/ui/scroll-area.js +5 -5
- package/dist/kernel/components/ui/select.js +8 -11
- package/dist/kernel/components/ui/separator.js +1 -1
- package/dist/kernel/components/ui/table.js +1 -1
- package/dist/kernel/components/ui/tabs.js +1 -1
- package/dist/kernel/components/ui/tag.js +1 -1
- package/dist/kernel/components/ui/text.d.ts +2 -2
- package/dist/kernel/components/ui/text.js +1 -1
- package/dist/kernel/components/ui/toast.js +1 -1
- package/dist/kernel/components/ui/tooltip.js +1 -1
- package/dist/kernel/defaults.registry.d.ts +11 -24
- package/dist/kernel/defaults.registry.js +11 -26
- package/dist/kernel/routes/agent/markdown.d.ts +3 -1
- package/dist/kernel/routes/agent/markdown.js +219 -48
- 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 -1
- package/dist/kernel/routes/metadata/feed.js +111 -81
- package/dist/kernel/routes/metadata/llms.d.ts +12 -3
- package/dist/kernel/routes/metadata/llms.js +156 -59
- package/dist/kernel/routes/metadata/og-image.js +1 -1
- package/dist/kernel/routes/metadata/robots.d.ts +1 -1
- package/dist/kernel/routes/metadata/robots.js +2 -2
- package/dist/kernel/routes/metadata/sitemap.d.ts +26 -4
- package/dist/kernel/routes/metadata/sitemap.js +206 -38
- 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 +2 -2
- package/dist/kernel/routes/pages/group.js +21 -13
- package/dist/kernel/routes/pages/leaf.d.ts +28 -1
- package/dist/kernel/routes/pages/leaf.js +25 -16
- package/dist/kernel/routes/pages/root.js +19 -13
- package/dist/keyboard-shortcuts.js +1 -1
- package/dist/resolvers/manifest-resolver.js +29 -6
- package/dist/search.d.ts +6 -7
- package/dist/search.js +52 -29
- package/dist/{sidebar-types-Bgchdfd6.d.ts → sidebar-types-DKpR27II.d.ts} +1 -1
- package/dist/theme-scope.js +1 -1
- package/dist/{types-DHBm7-j6.d.ts → types-CJWRG05y.d.ts} +20 -1
- package/dist/{types-B_b3C0U6.d.ts → types-CUtrppxt.d.ts} +8 -2
- package/dist/{types-CIwwieNw.d.ts → types-J2w_puPF.d.ts} +11 -10
- package/dist/types.d.ts +15 -6
- 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-SV44DBQT.js +16 -0
- package/dist/validate-publish-os-source-NZJF3TB2.js +14 -0
- package/init/seed/minimal/.gitignore +1 -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 +82 -0
- package/init/seed/minimal/publish.os/blog/layout.tsx +13 -0
- package/init/seed/minimal/publish.os/blog/page.tsx +76 -0
- package/init/seed/minimal/publish.os/components/blog/copy-link.tsx +64 -0
- package/init/seed/minimal/publish.os/docs/content/get-started.mdx +6 -11
- package/init/seed/minimal/publish.os/docs/content/groups.mdx +6 -7
- package/init/seed/minimal/publish.os/docs/content/{theme.mdx → themes.mdx} +14 -12
- package/init/seed/minimal/publish.os/publish.os.config.json +7 -7
- package/init/seed/minimal/publish.os/theme.css +52 -24
- package/init/seed/minimal/publish.os/tsconfig.json +3 -0
- package/init/seed/minimal/seed.json +12 -2
- package/init/seed/scratch/publish.os/docs/content/get-started.mdx +6 -0
- package/init/seed/scratch/publish.os/publish.os.config.json +4 -0
- package/init/seed/scratch/seed.json +5 -0
- package/package.json +55 -44
- package/release/app/phosphor/package.json +5 -5
- package/release/app/phosphor/pnpm-lock.yaml.template +553 -377
- package/release/app/phosphor/pnpm-workspace.yaml +3 -0
- package/release/compiler/package.json +5 -3
- package/release/compiler/pnpm-lock.yaml.template +500 -303
- package/release/compiler/pnpm-workspace.yaml +3 -0
- package/release/release.json +8 -37
- package/compiler-assets/nextjs/defaults/group/leaf.tsx +0 -48
- package/dist/icons.d.ts +0 -1
- package/dist/icons.js +0 -2
- package/dist/kernel/components/blocks/design-system-preview.d.ts +0 -61
- package/dist/kernel/components/blocks/design-system-preview.js +0 -648
- 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/mdx/components/pre.d.ts +0 -6
- package/dist/kernel/components/mdx/components/pre.js +0 -18
- package/dist/kernel/components/ui/meta-key.d.ts +0 -17
- package/dist/kernel/components/ui/meta-key.js +0 -9
- package/dist/kernel/components/ui/theme-toggle.d.ts +0 -24
- package/dist/kernel/components/ui/theme-toggle.js +0 -58
- package/dist/kernel/framework-icons.d.ts +0 -1
- package/dist/kernel/framework-icons.js +0 -39
- package/dist/link-CYaCRDb6.d.ts +0 -35
- package/release/app/lucide/package.json +0 -30
- package/release/app/lucide/pnpm-lock.yaml.template +0 -2905
- package/release/app/lucide/pnpm-workspace.yaml +0 -11
- package/release/app/tabler/package.json +0 -30
- package/release/app/tabler/pnpm-lock.yaml.template +0 -2911
- package/release/app/tabler/pnpm-workspace.yaml +0 -11
|
@@ -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,82 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
IndexPageProps,
|
|
3
|
+
PageNode,
|
|
4
|
+
TreeNode,
|
|
5
|
+
} from "@publish.os/nextjs/types";
|
|
6
|
+
import { prettyDate } from "@publish.os/nextjs/utils/pretty-date";
|
|
7
|
+
import Link from "next/link";
|
|
8
|
+
|
|
9
|
+
function pageNodes(nodes: TreeNode[]): PageNode[] {
|
|
10
|
+
return nodes.flatMap((node) => {
|
|
11
|
+
if (node.type === "page") return [node];
|
|
12
|
+
if (node.type === "section" || node.type === "folder") {
|
|
13
|
+
return pageNodes(node.children);
|
|
14
|
+
}
|
|
15
|
+
return [];
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default function BlogIndex({ node, tree }: IndexPageProps) {
|
|
20
|
+
const posts = pageNodes(tree)
|
|
21
|
+
.filter((page) => page.status === "published")
|
|
22
|
+
.sort(
|
|
23
|
+
(a, b) =>
|
|
24
|
+
(b.publishedAt ?? "").localeCompare(a.publishedAt ?? "") ||
|
|
25
|
+
a.path.localeCompare(b.path),
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<section className="w-full px-4 py-12 md:px-5 lg:px-6 lg:py-16">
|
|
30
|
+
<h1 className="mb-10 text-balance text-5xl font-medium leading-none tracking-tight text-foreground-1">
|
|
31
|
+
{node.title}
|
|
32
|
+
</h1>
|
|
33
|
+
{posts.length > 0 ? (
|
|
34
|
+
<ul>
|
|
35
|
+
{posts.map((post) => {
|
|
36
|
+
const authors = post.authors
|
|
37
|
+
.map((author) => author.name)
|
|
38
|
+
.join(", ");
|
|
39
|
+
const date = prettyDate(post.publishedAt);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<li
|
|
43
|
+
className="border-b border-stroke-4 last:border-b-0"
|
|
44
|
+
key={post.path}
|
|
45
|
+
>
|
|
46
|
+
<Link
|
|
47
|
+
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"
|
|
48
|
+
href={post.path}
|
|
49
|
+
title={post.title}
|
|
50
|
+
>
|
|
51
|
+
<span className="min-w-0 flex-1 truncate">{post.title}</span>
|
|
52
|
+
<span className="hidden min-w-0 max-w-[45%] items-baseline gap-1.5 text-foreground-3 md:flex">
|
|
53
|
+
{authors ? (
|
|
54
|
+
<span className="truncate">{authors}</span>
|
|
55
|
+
) : null}
|
|
56
|
+
{authors && date ? <span aria-hidden="true">·</span> : null}
|
|
57
|
+
{date ? (
|
|
58
|
+
<time
|
|
59
|
+
className="shrink-0 whitespace-nowrap"
|
|
60
|
+
dateTime={post.publishedAt}
|
|
61
|
+
>
|
|
62
|
+
{date}
|
|
63
|
+
</time>
|
|
64
|
+
) : null}
|
|
65
|
+
</span>
|
|
66
|
+
<span
|
|
67
|
+
aria-hidden="true"
|
|
68
|
+
className="shrink-0 text-foreground-2 md:hidden rtl:rotate-180"
|
|
69
|
+
>
|
|
70
|
+
→
|
|
71
|
+
</span>
|
|
72
|
+
</Link>
|
|
73
|
+
</li>
|
|
74
|
+
);
|
|
75
|
+
})}
|
|
76
|
+
</ul>
|
|
77
|
+
) : (
|
|
78
|
+
<p className="text-sm text-foreground-2">No posts yet.</p>
|
|
79
|
+
)}
|
|
80
|
+
</section>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { CaretLeftIcon } from "@phosphor-icons/react/ssr";
|
|
2
|
+
import { MDX } from "@publish.os/nextjs/mdx";
|
|
3
|
+
import type { PageProps } from "@publish.os/nextjs/types";
|
|
4
|
+
import { prettyDate } from "@publish.os/nextjs/utils/pretty-date";
|
|
5
|
+
import Image from "next/image";
|
|
6
|
+
import Link from "next/link";
|
|
7
|
+
import { CopyLink } from "../components/blog/copy-link";
|
|
8
|
+
|
|
9
|
+
type BlogMeta = {
|
|
10
|
+
image?: { src: string; alt: string };
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default function BlogLeaf({ page }: PageProps<BlogMeta>) {
|
|
14
|
+
const authors = page.authors.map((author) => author.name).join(", ");
|
|
15
|
+
const date = prettyDate(page.publishedAt);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<div className="flex min-h-0 min-w-0 flex-1 flex-col px-4 pt-6 md:px-5 lg:px-6 lg:pt-8">
|
|
19
|
+
<nav aria-label="Blog" className="mb-8 lg:mb-12">
|
|
20
|
+
<Link
|
|
21
|
+
className="-ms-2 inline-flex min-h-11 items-center gap-1.5 rounded-button px-2 text-sm text-foreground-3 hover:text-foreground-1 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus-stroke"
|
|
22
|
+
href="/blog"
|
|
23
|
+
>
|
|
24
|
+
<CaretLeftIcon
|
|
25
|
+
aria-hidden="true"
|
|
26
|
+
className="size-3.5 shrink-0 rtl:rotate-180"
|
|
27
|
+
/>
|
|
28
|
+
Blog
|
|
29
|
+
</Link>
|
|
30
|
+
</nav>
|
|
31
|
+
<article className="mx-auto flex min-w-0 w-full max-w-4xl flex-1 flex-col wrap-anywhere">
|
|
32
|
+
<header>
|
|
33
|
+
<div className="mx-auto w-full max-w-2xl">
|
|
34
|
+
<h1 className="text-balance text-center text-4xl font-medium leading-tight tracking-tight text-foreground-1 md:text-5xl">
|
|
35
|
+
{page.title}
|
|
36
|
+
</h1>
|
|
37
|
+
</div>
|
|
38
|
+
{page.meta.image ? (
|
|
39
|
+
<Image
|
|
40
|
+
alt={page.meta.image.alt}
|
|
41
|
+
className="mt-10 aspect-2/1 w-full rounded-media border border-stroke-3 object-cover"
|
|
42
|
+
height={800}
|
|
43
|
+
priority
|
|
44
|
+
sizes="(max-width: 896px) 100vw, 896px"
|
|
45
|
+
src={page.meta.image.src}
|
|
46
|
+
width={1600}
|
|
47
|
+
/>
|
|
48
|
+
) : null}
|
|
49
|
+
<div className="mx-auto w-full max-w-2xl">
|
|
50
|
+
{page.description ? (
|
|
51
|
+
<p className="mt-12 text-pretty text-center text-base italic leading-7 text-foreground-2">
|
|
52
|
+
{page.description}
|
|
53
|
+
</p>
|
|
54
|
+
) : null}
|
|
55
|
+
<hr className="my-10 border-stroke-3" />
|
|
56
|
+
</div>
|
|
57
|
+
</header>
|
|
58
|
+
<div className="mx-auto flex w-full max-w-2xl flex-1 flex-col">
|
|
59
|
+
<div className="markdown-prose min-w-0 flex-1">
|
|
60
|
+
<MDX page={page} />
|
|
61
|
+
</div>
|
|
62
|
+
<div className="mx-auto mt-12 mb-24 flex w-full max-w-2xl flex-wrap items-center justify-between gap-3 border-t border-stroke-3 pt-6">
|
|
63
|
+
{authors || date ? (
|
|
64
|
+
<p className="flex flex-wrap items-baseline gap-x-1.5 text-sm text-foreground-3">
|
|
65
|
+
{authors ? <span>{authors}</span> : null}
|
|
66
|
+
{authors && date ? <span aria-hidden="true">·</span> : null}
|
|
67
|
+
{date ? <time dateTime={page.publishedAt}>{date}</time> : null}
|
|
68
|
+
</p>
|
|
69
|
+
) : null}
|
|
70
|
+
<CopyLink className="ms-auto" path={page.path} />
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
</article>
|
|
74
|
+
</div>
|
|
75
|
+
);
|
|
76
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Link } from "@components/ui/link";
|
|
4
|
+
import { LinkSimpleIcon } from "@phosphor-icons/react/ssr";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
|
|
7
|
+
export function CopyLink({
|
|
8
|
+
className,
|
|
9
|
+
path,
|
|
10
|
+
}: {
|
|
11
|
+
className?: string;
|
|
12
|
+
path: string;
|
|
13
|
+
}) {
|
|
14
|
+
const [status, setStatus] = useState<"idle" | "pending" | "copied" | "error">(
|
|
15
|
+
"idle",
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
async function copyLink() {
|
|
19
|
+
setStatus("pending");
|
|
20
|
+
try {
|
|
21
|
+
await navigator.clipboard.writeText(
|
|
22
|
+
new URL(path, window.location.origin).href,
|
|
23
|
+
);
|
|
24
|
+
setStatus("copied");
|
|
25
|
+
} catch {
|
|
26
|
+
setStatus("error");
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<div className={className}>
|
|
32
|
+
<Link
|
|
33
|
+
aria-busy={status === "pending" || undefined}
|
|
34
|
+
className="inline-flex min-h-11 items-center text-foreground-3 hover:text-foreground-1 active:text-foreground-1 motion-safe:transition-[color,scale] motion-safe:duration-150 motion-safe:active:scale-[0.96] motion-reduce:transition-none"
|
|
35
|
+
href={path}
|
|
36
|
+
leftIcon={<LinkSimpleIcon aria-hidden="true" />}
|
|
37
|
+
onClick={(event) => {
|
|
38
|
+
if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey)
|
|
39
|
+
return;
|
|
40
|
+
event.preventDefault();
|
|
41
|
+
if (status !== "pending") void copyLink();
|
|
42
|
+
}}
|
|
43
|
+
prefetch={false}
|
|
44
|
+
size="xs"
|
|
45
|
+
>
|
|
46
|
+
Copy link
|
|
47
|
+
</Link>
|
|
48
|
+
<p
|
|
49
|
+
className={
|
|
50
|
+
status === "error"
|
|
51
|
+
? "mt-2 max-w-60 text-sm text-foreground-2"
|
|
52
|
+
: "sr-only"
|
|
53
|
+
}
|
|
54
|
+
role="status"
|
|
55
|
+
>
|
|
56
|
+
{status === "copied"
|
|
57
|
+
? "Link copied."
|
|
58
|
+
: status === "error"
|
|
59
|
+
? "Could not copy. Try again, or copy the address from your browser."
|
|
60
|
+
: ""}
|
|
61
|
+
</p>
|
|
62
|
+
</div>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Get started
|
|
3
3
|
description: Preview your site and make your first change.
|
|
4
|
-
order: 1
|
|
5
4
|
---
|
|
6
5
|
|
|
7
6
|
A publishOS site starts with a folder. The `publish.os/` folder contains your content, theme, and configuration.
|
|
@@ -14,11 +13,11 @@ Local previews and builds do not require an account.
|
|
|
14
13
|
|
|
15
14
|
From your project directory, run this command:
|
|
16
15
|
|
|
17
|
-
```bash
|
|
18
|
-
npx
|
|
16
|
+
```bash title="Preview the site"
|
|
17
|
+
npx @publish.os/cli@latest dev
|
|
19
18
|
```
|
|
20
19
|
|
|
21
|
-
Open the address that the CLI shows. To stop the preview, press
|
|
20
|
+
Open the address that the CLI shows. To stop the preview, press <kbd>Ctrl</kbd>+<kbd>C</kbd>.
|
|
22
21
|
|
|
23
22
|
## Make one change
|
|
24
23
|
|
|
@@ -30,13 +29,7 @@ Use Markdown for normal text. You can use **bold text**, _italic text_, and `cod
|
|
|
30
29
|
|
|
31
30
|
You can also use MDX components to add interactive elements to your pages.
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
A short notice or piece of information.
|
|
35
|
-
</Callout>
|
|
36
|
-
|
|
37
|
-
```text
|
|
38
|
-
Code blocks can show quick examples.
|
|
39
|
-
```
|
|
32
|
+
Use the [blog](/blog) to share updates alongside your documentation.
|
|
40
33
|
|
|
41
34
|
You can show a keyboard shortcut such as <kbd>Ctrl</kbd>+<kbd>Enter</kbd>.
|
|
42
35
|
|
|
@@ -52,3 +45,5 @@ description: Add a page to your site.
|
|
|
52
45
|
|
|
53
46
|
Each MDX file contains one page.
|
|
54
47
|
```
|
|
48
|
+
|
|
49
|
+
Next, organize your [groups](/docs/groups) or customize your [theme](/docs/themes).
|
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Groups
|
|
3
3
|
description: Give each group one purpose and each page a clear name.
|
|
4
|
-
order: 2
|
|
5
4
|
---
|
|
6
5
|
|
|
7
|
-
A content group keeps related pages together. This site has
|
|
6
|
+
A content group keeps related pages together. This site has two groups: `docs` and `blog`.
|
|
8
7
|
|
|
9
8
|
## Add a group
|
|
10
9
|
|
|
11
|
-
Create `publish.os/
|
|
10
|
+
Create `publish.os/notes/content/first-note.mdx`:
|
|
12
11
|
|
|
13
12
|
```mdx
|
|
14
13
|
---
|
|
15
|
-
title:
|
|
16
|
-
description:
|
|
14
|
+
title: Project notes
|
|
15
|
+
description: What we learned while building this project.
|
|
17
16
|
---
|
|
18
17
|
|
|
19
18
|
This project starts with one problem and one useful solution.
|
|
20
19
|
```
|
|
21
20
|
|
|
22
|
-
The `
|
|
21
|
+
The `notes` folder creates a separate content group. Its pages can share a layout and theme without changes to the other groups.
|
|
23
22
|
|
|
24
23
|
## Choose clear names
|
|
25
24
|
|
|
@@ -28,4 +27,4 @@ The `blog` folder creates a separate content group. Its pages can share a layout
|
|
|
28
27
|
| `docs` | Explain how to use it |
|
|
29
28
|
| `blog` | Explain what you learn |
|
|
30
29
|
|
|
31
|
-
Use short file names with hyphens between words. Link to the page that answers the next question, such as [how to change the theme](/docs/
|
|
30
|
+
Use short file names with hyphens between words. Link to the page that answers the next question, such as [how to change the theme](/docs/themes).
|
|
@@ -27,21 +27,21 @@ You can use `xs`, `sm`, `md`, `lg`, `xl`, or `none`. You can also use a custom v
|
|
|
27
27
|
|
|
28
28
|
The neutral color palette changes the complete design system. Define the palette with a neutral scale.
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
Keep every palette color opaque, including subtle surfaces. Hover, active, and stroke tokens use transparency so controls adapt to the surface beneath them.
|
|
31
31
|
|
|
32
32
|
```css
|
|
33
|
-
--gray-100: #
|
|
34
|
-
--gray-200: #
|
|
35
|
-
--gray-300: #
|
|
36
|
-
--gray-400: #
|
|
37
|
-
--gray-500: #
|
|
38
|
-
--gray-600: #
|
|
39
|
-
--gray-700: #
|
|
33
|
+
--gray-100: #fcfcfc;
|
|
34
|
+
--gray-200: #f9f9f9;
|
|
35
|
+
--gray-300: #f3f3f3;
|
|
36
|
+
--gray-400: #f0f0f0;
|
|
37
|
+
--gray-500: #e0e0e0;
|
|
38
|
+
--gray-600: #c6c6c6;
|
|
39
|
+
--gray-700: #999999;
|
|
40
40
|
--gray-800: #737373;
|
|
41
|
-
--gray-900: #
|
|
42
|
-
--gray-1000: #
|
|
43
|
-
--gray-1100: #
|
|
44
|
-
--gray-1200: #
|
|
41
|
+
--gray-900: #5d5d5d;
|
|
42
|
+
--gray-1000: #464646;
|
|
43
|
+
--gray-1100: #2e2e2e;
|
|
44
|
+
--gray-1200: #171717;
|
|
45
45
|
|
|
46
46
|
--neutral-100: var(--gray-100);
|
|
47
47
|
--neutral-200: var(--gray-200);
|
|
@@ -62,3 +62,5 @@ Set the accent to your brand color or a color from the palette:
|
|
|
62
62
|
```css
|
|
63
63
|
--accent: #ed940f;
|
|
64
64
|
```
|
|
65
|
+
|
|
66
|
+
For layered controls, keep page and popup surfaces opaque. Derive hover, pressed, and border colors from a foreground or accent with transparency. The default theme does this with `color-mix()`, so the same control works on both light and dark surfaces. Keep text and solid button fills opaque for contrast.
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 1,
|
|
3
|
-
"runtime": "@publish.os/nextjs@0.0.1-alpha.
|
|
3
|
+
"runtime": "@publish.os/nextjs@0.0.1-alpha.91",
|
|
4
4
|
"site": {
|
|
5
|
-
"name": "
|
|
6
|
-
"description": "
|
|
5
|
+
"name": "publish.os guides",
|
|
6
|
+
"description": "Documentation and updates for your project."
|
|
7
7
|
},
|
|
8
8
|
"fonts": {
|
|
9
9
|
"main": {
|
|
10
|
-
"family": "
|
|
11
|
-
"weight": "100 900"
|
|
10
|
+
"family": "Inter"
|
|
12
11
|
},
|
|
13
12
|
"mono": {
|
|
14
13
|
"family": "DM Mono",
|
|
15
14
|
"weight": ["300", "400", "500"]
|
|
16
15
|
}
|
|
17
16
|
},
|
|
18
|
-
"
|
|
19
|
-
"
|
|
17
|
+
"groups": {
|
|
18
|
+
"docs": { "title": "Docs" },
|
|
19
|
+
"blog": { "title": "Blog" }
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/* Delete this file to use the same PublishOS fallback theme. */
|
|
2
2
|
|
|
3
3
|
:root {
|
|
4
|
-
--gray-100: #
|
|
5
|
-
--gray-200: #
|
|
6
|
-
--gray-300: #
|
|
7
|
-
--gray-400: #
|
|
8
|
-
--gray-500: #
|
|
9
|
-
--gray-600: #
|
|
10
|
-
--gray-700: #
|
|
4
|
+
--gray-100: #fcfcfc;
|
|
5
|
+
--gray-200: #f9f9f9;
|
|
6
|
+
--gray-300: #f3f3f3;
|
|
7
|
+
--gray-400: #f0f0f0;
|
|
8
|
+
--gray-500: #e0e0e0;
|
|
9
|
+
--gray-600: #c6c6c6;
|
|
10
|
+
--gray-700: #999999;
|
|
11
11
|
--gray-800: #737373;
|
|
12
|
-
--gray-900: #
|
|
13
|
-
--gray-1000: #
|
|
14
|
-
--gray-1100: #
|
|
15
|
-
--gray-1200: #
|
|
12
|
+
--gray-900: #5d5d5d;
|
|
13
|
+
--gray-1000: #464646;
|
|
14
|
+
--gray-1100: #2e2e2e;
|
|
15
|
+
--gray-1200: #171717;
|
|
16
16
|
|
|
17
17
|
--neutral-100: var(--gray-100);
|
|
18
18
|
--neutral-200: var(--gray-200);
|
|
@@ -27,21 +27,49 @@
|
|
|
27
27
|
--neutral-1100: var(--gray-1100);
|
|
28
28
|
--neutral-1200: var(--gray-1200);
|
|
29
29
|
|
|
30
|
-
--
|
|
31
|
-
--
|
|
30
|
+
--blue-100: #f7fbff;
|
|
31
|
+
--blue-200: #edf6fe;
|
|
32
|
+
--blue-300: #e3f1fd;
|
|
33
|
+
--blue-400: #d8ecfc;
|
|
34
|
+
--blue-500: #b3dbfd;
|
|
35
|
+
--blue-600: #8ecaff;
|
|
36
|
+
--blue-700: #6ab7ff;
|
|
37
|
+
--blue-800: #42a3ff;
|
|
38
|
+
--blue-900: #018dff;
|
|
39
|
+
--blue-1000: #0071ce;
|
|
40
|
+
--blue-1100: #00569f;
|
|
41
|
+
--blue-1200: #003d73;
|
|
42
|
+
|
|
43
|
+
--accent: var(--blue-1000);
|
|
44
|
+
--theme-radius: var(--theme-radius-sm);
|
|
32
45
|
}
|
|
33
46
|
|
|
34
47
|
.dark {
|
|
35
|
-
--gray-100: #
|
|
36
|
-
--gray-200: #
|
|
37
|
-
--gray-300: #
|
|
38
|
-
--gray-400: #
|
|
39
|
-
--gray-500: #
|
|
48
|
+
--gray-100: #131313;
|
|
49
|
+
--gray-200: #1a1a1a;
|
|
50
|
+
--gray-300: #212121;
|
|
51
|
+
--gray-400: #292929;
|
|
52
|
+
--gray-500: #383838;
|
|
40
53
|
--gray-600: #525252;
|
|
41
|
-
--gray-700: #
|
|
42
|
-
--gray-800: #
|
|
43
|
-
--gray-900: #
|
|
44
|
-
--gray-1000: #
|
|
45
|
-
--gray-1100: #
|
|
46
|
-
--gray-1200: #
|
|
54
|
+
--gray-700: #767676;
|
|
55
|
+
--gray-800: #b3b3b3;
|
|
56
|
+
--gray-900: #c4c4c4;
|
|
57
|
+
--gray-1000: #d2d2d2;
|
|
58
|
+
--gray-1100: #e6e6e6;
|
|
59
|
+
--gray-1200: #f5f5f5;
|
|
60
|
+
|
|
61
|
+
--blue-100: #101d29;
|
|
62
|
+
--blue-200: #142739;
|
|
63
|
+
--blue-300: #173249;
|
|
64
|
+
--blue-400: #193d5a;
|
|
65
|
+
--blue-500: #235278;
|
|
66
|
+
--blue-600: #2d6898;
|
|
67
|
+
--blue-700: #377fb9;
|
|
68
|
+
--blue-800: #4297dc;
|
|
69
|
+
--blue-900: #4dafff;
|
|
70
|
+
--blue-1000: #84c8ff;
|
|
71
|
+
--blue-1100: #b6dfff;
|
|
72
|
+
--blue-1200: #e8f5ff;
|
|
73
|
+
|
|
74
|
+
--accent: var(--blue-800);
|
|
47
75
|
}
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "Minimal",
|
|
3
|
-
"description": "
|
|
3
|
+
"description": "Docs and a blog with a minimal theme.",
|
|
4
4
|
"files": [
|
|
5
5
|
"publish.os.config.json",
|
|
6
|
+
"tsconfig.json",
|
|
6
7
|
"theme.css",
|
|
7
8
|
"assets/logo/publish-dev-logo.dark.png",
|
|
8
9
|
"assets/logo/publish-dev-logo.png",
|
|
10
|
+
"assets/favicon.svg",
|
|
11
|
+
"assets/favicon.dark.svg",
|
|
12
|
+
"assets/blog/hello-world.svg",
|
|
9
13
|
"docs/content/get-started.mdx",
|
|
10
14
|
"docs/content/groups.mdx",
|
|
11
|
-
"docs/content/
|
|
15
|
+
"docs/content/themes.mdx",
|
|
16
|
+
"blog/index.tsx",
|
|
17
|
+
"blog/layout.tsx",
|
|
18
|
+
"blog/page.tsx",
|
|
19
|
+
"components/blog/copy-link.tsx",
|
|
20
|
+
"blog/content/hello-world.mdx",
|
|
21
|
+
"blog/content/series-a.mdx"
|
|
12
22
|
]
|
|
13
23
|
}
|