From 7dc0c7d01f3719dc40ca1f7ebdd4cc9f16ca83e8 Mon Sep 17 00:00:00 2001 From: JeffJiang Date: Fri, 10 Apr 2026 20:24:52 +0800 Subject: [PATCH] feat(blog): implement blog structure with post listing, tagging, and layout enhancements (#1962) * feat(blog): implement blog structure with post listing and tagging functionality * feat(blog): enhance blog layout and post metadata display with new components * fix(blog): address PR #1962 review feedback and fix lint issues (#14) * fix: format --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> --- frontend/src/app/[lang]/docs/layout.tsx | 14 +- frontend/src/app/blog/[[...mdxPath]]/page.tsx | 178 +++++++++ frontend/src/app/blog/layout.tsx | 22 ++ frontend/src/app/blog/posts/page.tsx | 24 ++ frontend/src/app/blog/tags/[tag]/page.tsx | 51 +++ frontend/src/components/landing/header.tsx | 7 +- frontend/src/components/landing/post-list.tsx | 163 ++++++++ frontend/src/content/en/_meta.ts | 3 + frontend/src/content/en/posts/_meta.ts | 9 + .../content/en/posts/weekly/2026-04-06.mdx | 11 + frontend/src/content/zh/_meta.ts | 3 + frontend/src/content/zh/posts/_meta.ts | 9 + .../src/content/zh/posts/releases/2_0_rc.mdx | 9 + .../content/zh/posts/weekly/2026-04-06.mdx | 11 + frontend/src/core/blog/index.ts | 357 ++++++++++++++++++ frontend/src/core/i18n/locale.ts | 8 + 16 files changed, 868 insertions(+), 11 deletions(-) create mode 100644 frontend/src/app/blog/[[...mdxPath]]/page.tsx create mode 100644 frontend/src/app/blog/layout.tsx create mode 100644 frontend/src/app/blog/posts/page.tsx create mode 100644 frontend/src/app/blog/tags/[tag]/page.tsx create mode 100644 frontend/src/components/landing/post-list.tsx create mode 100644 frontend/src/content/en/posts/_meta.ts create mode 100644 frontend/src/content/en/posts/weekly/2026-04-06.mdx create mode 100644 frontend/src/content/zh/posts/_meta.ts create mode 100644 frontend/src/content/zh/posts/releases/2_0_rc.mdx create mode 100644 frontend/src/content/zh/posts/weekly/2026-04-06.mdx create mode 100644 frontend/src/core/blog/index.ts diff --git a/frontend/src/app/[lang]/docs/layout.tsx b/frontend/src/app/[lang]/docs/layout.tsx index 988d1ff71..f63d6ae7b 100644 --- a/frontend/src/app/[lang]/docs/layout.tsx +++ b/frontend/src/app/[lang]/docs/layout.tsx @@ -1,13 +1,12 @@ import type { PageMapItem } from "nextra"; import { getPageMap } from "nextra/page-map"; -import { Footer, Layout } from "nextra-theme-docs"; +import { Layout } from "nextra-theme-docs"; +import { Footer } from "@/components/landing/footer"; import { Header } from "@/components/landing/header"; import { getLocaleByLang } from "@/core/i18n/locale"; import "nextra-theme-docs/style.css"; -const footer = ; - const i18n = [ { locale: "en", name: "English" }, { locale: "zh", name: "中文" }, @@ -15,7 +14,7 @@ const i18n = [ function formatPageRoute(base: string, items: PageMapItem[]): PageMapItem[] { return items.map((item) => { - if ("route" in item) { + if ("route" in item && !item.route.startsWith(base)) { item.route = `${base}${item.route}`; } if ("children" in item && item.children) { @@ -29,6 +28,7 @@ export default async function DocLayout({ children, params }) { const { lang } = await params; const locale = getLocaleByLang(lang); const pages = await getPageMap(`/${lang}`); + const pageMap = formatPageRoute(`/${lang}/docs`, pages); return ( } - pageMap={formatPageRoute(`/${lang}/docs`, pages)} - docsRepositoryBase="https://github.com/bytedance/deerflow/tree/main/frontend/src/app/content" - footer={footer} + pageMap={pageMap} + docsRepositoryBase="https://github.com/bytedance/deerflow/tree/main/frontend/src/content" + footer={