# Fumadocs (Framework Mode, Waku): Blog
URL: /docs/waku/integrations/blog
Source: https://raw.githubusercontent.com/fuma-nama/fumadocs/refs/heads/main/apps/docs/content/docs/(framework)/[framework]/integrations/blog.mdx

Add a blog with authors, tags and post navigation.

## Installation [#installation]

```npm
npx @fumadocs/cli@latest add blog
```

Define a collection with `blogPageSchema`, and register your authors:

```ts title="lib/source.ts"
import { defineCollections } from 'fumadocs-mdx/macro';
import { loader } from 'fumadocs-core/source';
import { type BlogAuthor, blogPageSchema } from './blog';

export const blog = defineCollections({
  type: 'doc',
  dir: 'content/blog',
  schema: blogPageSchema,
});

export const blogSource = loader({
  baseUrl: '/blog',
  source: blog.toFumadocsSource(),
});

export const blogAuthors: Record<string, BlogAuthor> = {
  fuma: {
    name: 'Fuma Nama',
    title: 'Maintainer',
    url: 'https://fuma-nama.dev',
    image: 'https://avatars.githubusercontent.com/u/76240755',
  },
};
```

## Writing Posts [#writing-posts]

Each file under `content/blog` is a post:

```mdx title="content/blog/hello-world.mdx"
---
title: Hello World
description: My first post.
date: 2026-10-12 # posts are sorted by date, newest first
tags: [Announcement] # each tag has a page under /blog/tags
authors: [fuma] # keys of blogAuthors, other values show as names
image: /blog/hello-world.png # cover image on the post card
---
```

Posts have no draft field, so keep unfinished posts outside `content/blog`.

## Routes [#routes]

Add the blog routes under your [Home Layout](/docs/ui/layouts/home-layout). `getPosts()` turns blog pages into posts with their authors and tags. For a feed of your posts, see [RSS Feed](/docs/waku/guides/rss).

### Post List [#post-list]

```tsx title="src/pages/(home)/blog/index.tsx"
import { blogAuthors, blogSource } from '@/lib/source';
import { getPosts } from '@/lib/blog';
import { BlogCards } from '@/components/blog';

export default function Page() {
  return (
    <div className="mx-auto w-full max-w-(--fd-layout-width) px-4 py-12">
      <BlogCards posts={getPosts(blogSource.getPages(), blogAuthors)} />
    </div>
  );
}

export const getConfig = async () => ({ render: 'static' }) as const;
```

### Post Page [#post-page]

`findPost()` returns a post with its newer and older posts. The `toc` prop of `BlogPage` adds a floating table of contents with a share button.

```tsx title="src/pages/(home)/blog/[slug].tsx"
import type { PageProps } from 'waku/router';
import { unstable_notFound } from 'waku/router/server';
import { blogAuthors, blogSource } from '@/lib/source';
import { findPost, getPosts } from '@/lib/blog';
import { getMDXComponents } from '@/components/mdx';
import {
  BlogAuthors,
  BlogBackLink,
  BlogBody,
  BlogDate,
  BlogDescription,
  BlogHeader,
  BlogPage,
  BlogPostNav,
  BlogTags,
  BlogTitle,
} from '@/components/blog';

export default function Page({ slug }: PageProps<'/blog/[slug]'>) {
  const page = blogSource.getPage([slug]);
  const found = page && findPost(getPosts(blogSource.getPages(), blogAuthors), page.url);
  if (!page || !found) unstable_notFound();

  const { post, newer, older } = found;
  const MDX = page.data.body;

  return (
    <BlogPage toc={page.data.toc}>
      <BlogHeader>
        <BlogBackLink href="/blog" />
        <BlogTitle>{post.title}</BlogTitle>
        <BlogDescription>{post.description}</BlogDescription>
        <BlogAuthors authors={post.authors} />
        <BlogTags tags={post.tags} />
        {post.date && <BlogDate date={post.date} />}
      </BlogHeader>
      <BlogBody>
        <MDX components={getMDXComponents()} />
      </BlogBody>
      <BlogPostNav newer={newer} older={older} />
    </BlogPage>
  );
}

export async function getConfig() {
  return {
    render: 'static',
    staticPaths: blogSource.getPages().map((page) => page.slugs),
  } as const;
}
```

### Tag Pages [#tag-pages]

`getTags()` lists every tag:

```tsx title="src/pages/(home)/blog/tags/index.tsx"
import { blogSource } from '@/lib/source';
import { getPosts, getTags } from '@/lib/blog';
import { BlogHeader, BlogTagCards, BlogTitle } from '@/components/blog';

export default function Page() {
  const tags = getTags(getPosts(blogSource.getPages()));

  return (
    <div className="mx-auto flex w-full max-w-(--fd-layout-width) flex-col gap-4 px-4 py-12">
      <BlogHeader>
        <BlogTitle>All Tags</BlogTitle>
      </BlogHeader>
      <BlogTagCards tags={tags} />
    </div>
  );
}

export const getConfig = async () => ({ render: 'static' }) as const;
```

`getTagPosts()` lists the posts of a tag:

```tsx title="src/pages/(home)/blog/tags/[tag].tsx"
import type { PageProps } from 'waku/router';
import { unstable_notFound } from 'waku/router/server';
import { blogAuthors, blogSource } from '@/lib/source';
import { getPosts, getTagPosts, getTags } from '@/lib/blog';
import { BlogCards, BlogHeader, BlogTitle } from '@/components/blog';

export default function Page({ tag }: PageProps<'/blog/tags/[tag]'>) {
  const result = getTagPosts(getPosts(blogSource.getPages(), blogAuthors), tag);
  if (!result) unstable_notFound();

  return (
    <div className="mx-auto flex w-full max-w-(--fd-layout-width) flex-col gap-4 px-4 py-12">
      <BlogHeader>
        <BlogTitle>{result.tag.name}</BlogTitle>
      </BlogHeader>
      <BlogCards posts={result.posts} />
    </div>
  );
}

export async function getConfig() {
  return {
    render: 'static',
    staticPaths: getTags(getPosts(blogSource.getPages())).map((tag) => tag.slug),
  } as const;
}
```

## Internationalization [#internationalization]

Pass your i18n config to `getBlogUrl`, which creates the URLs of tags:

```ts title="lib/blog.ts"
import { i18n } from '@/lib/i18n';

// keep in sync with the `baseUrl` of `blogSource`
export const getBlogUrl = createGetUrl('/blog', i18n);
```

In routes, pass the pages of a locale to `getPosts()`:

```ts
const posts = getPosts(blogSource.getPages(lang), blogAuthors);
```