Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions website/docs/en/_nav.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
"link": "/guide/quick-start",
"activeMatch": "/guide/"
},
{
"text": "Blog",
"link": "/blog/",
"activeMatch": "/blog/"
},
{
"text": "Changelog",
"link": "https://github.com/rstackjs/rstack-cli/releases"
Expand Down
1 change: 1 addition & 0 deletions website/docs/en/blog/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["index", "introducing-rstack-cli"]
9 changes: 9 additions & 0 deletions website/docs/en/blog/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Rstack CLI blogs
description: 'Blog posts about Rstack CLI.'
sidebar: false
---

import { BlogList } from '../../../theme/components/BlogList';

<BlogList />
16 changes: 16 additions & 0 deletions website/docs/en/blog/introducing-rstack-cli.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
date: 2026-11-17
sidebar: false
authors:
- name: chenjiahan
avatar: 'https://github.com/chenjiahan.png'
github: 'chenjiahan'
---

import { BlogAuthors } from '@rstackjs/doc-ui/blog-authors';

# Introducing Rstack CLI

_November 17, 2026_

<BlogAuthors />
5 changes: 5 additions & 0 deletions website/docs/zh/_nav.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
"link": "/guide/quick-start",
"activeMatch": "/guide/"
},
{
"text": "博客",
"link": "/blog/",
"activeMatch": "/blog/"
},
{
"text": "更新日志",
"link": "https://github.com/rstackjs/rstack-cli/releases"
Expand Down
1 change: 1 addition & 0 deletions website/docs/zh/blog/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["index", "introducing-rstack-cli"]
9 changes: 9 additions & 0 deletions website/docs/zh/blog/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Rstack CLI 博客
description: '与 Rstack CLI 相关的博客文章。'
sidebar: false
---

import { BlogList } from '../../../theme/components/BlogList';

<BlogList />
16 changes: 16 additions & 0 deletions website/docs/zh/blog/introducing-rstack-cli.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
date: 2026-11-17
sidebar: false
authors:
- name: chenjiahan
avatar: 'https://github.com/chenjiahan.png'
github: 'chenjiahan'
---

import { BlogAuthors } from '@rstackjs/doc-ui/blog-authors';

# Rstack CLI 介绍 \{#introducing-rstack-cli}

_2026 年 11 月 17 日_

<BlogAuthors />
55 changes: 55 additions & 0 deletions website/theme/components/BlogList.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { useLang, usePages } from '@rspress/core/runtime';
import { Link, renderInlineMarkdown } from '@rspress/core/theme';
import type { BlogAvatarAuthor } from '@rstackjs/doc-ui/blog-avatar';
import { BlogBackground } from '@rstackjs/doc-ui/blog-background';
import {
BlogList as BaseBlogList,
type BlogListItem,
} from '@rstackjs/doc-ui/blog-list';

type BlogFrontmatter = {
description?: string;
date?: string;
authors?: BlogAvatarAuthor[];
};

const getDateValue = (date?: BlogListItem['date']): number => {
const timestamp = date ? new Date(date).getTime() : 0;
return Number.isNaN(timestamp) ? 0 : timestamp;
};

export function BlogList() {
const { pages } = usePages();
const lang = useLang();
const posts = pages
.filter(
(page) =>
page.lang === lang &&
page.routePath.includes('/blog/') &&
!page.routePath.endsWith('/blog/'),
)
.map((page): BlogListItem => {
const frontmatter = (page.frontmatter ?? {}) as BlogFrontmatter;

return {
title: page.title,
description: frontmatter.description,
date: frontmatter.date,
href: page.routePath,
authors: frontmatter.authors,
};
})
.sort((a, b) => getDateValue(b.date) - getDateValue(a.date));

return (
<>
<BaseBlogList
posts={posts}
lang={lang}
LinkComp={Link}
renderInlineMarkdown={renderInlineMarkdown}
/>
<BlogBackground />
</>
);
}
32 changes: 30 additions & 2 deletions website/theme/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,39 @@
import { Layout as BaseLayout } from '@rspress/core/theme-original';
import { useLang, usePage } from '@rspress/core/runtime';
import {
Layout as BaseLayout,
DocLayout as BaseDocLayout,
Link,
type DocLayoutProps,
} from '@rspress/core/theme-original';
import { BlogBackButton } from '@rstackjs/doc-ui/blog-back-button';
import { NavIcon } from '@rstackjs/doc-ui/nav-icon';
import { HomeLayout } from './pages';
import '@rstackjs/doc-ui/theme.css';
import './index.scss';

const Layout = () => <BaseLayout beforeNavTitle={<NavIcon />} />;

export { HomeLayout, Layout };
const DocLayout = (props: DocLayoutProps) => {
const { page } = usePage();
const lang = useLang();

return (
<BaseDocLayout
{...props}
beforeDocContent={
<>
<BlogBackButton
pathname={page.routePath}
lang={lang}
LinkComp={Link}
/>
{props.beforeDocContent}
</>
}
/>
);
};

export { DocLayout, HomeLayout, Layout };

export * from '@rspress/core/theme-original';
Loading