Takumi

Fumapress

Generate Open Graph images and page metadata with the built-in Fumapress Takumi plugin.

Fumapress is a docs framework on Waku. It ships a Takumi plugin that renders an image for every docs page and adds the matching meta tags. See the Fumapress Takumi docs for the full plugin API.

Default setup

The plugin is part of Fumapress's recommended preset, which is on by default. With no setup, every docs page gets a 1200 × 630 WebP image and these tags:

Generated meta tags
<meta property="og:image" content="/docs/page.webp" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="twitter:card" content="summary_large_image" />

Set site.baseUrl so og:image is an absolute URL. Without it, the tag holds a relative path, which most crawlers cannot follow.

press.config.tsx
import { defineConfig } from "fumapress";

export default defineConfig({
  site: {
    baseUrl: "https://example.com", 
  },
});

Customize the image

Add takumiPlugin yourself to pass options. A plugin you list replaces the preset's copy.

press.config.tsx
import { defineConfig } from "fumapress";
import { takumiPlugin } from "fumapress/plugins/takumi"; 

export default defineConfig({
  // ...
}).plugins(takumiPlugin()); 

generate returns the image for one page. It runs with the app context as this, so this.siteConfig and the loaders are available. This example uses the docs card from fumadocs-ui/og/takumi with a Google font:

press.config.tsx
import { generate as generateOgNode } from "fumadocs-ui/og/takumi";
import { takumiPlugin } from "fumapress/plugins/takumi";
import { googleFonts } from "takumi-js/helpers";

takumiPlugin({
  generate(page) {
    return {
      node: generateOgNode({
        title: page.data.title,
        description: page.data.description,
        site: this.siteConfig.name,
      }),
      options: {
        fonts: googleFonts([{ name: "Noto Serif", weight: [600, 800] }]),
      },
    };
  },
});

generate returns:

FieldTypeRole
nodeReactNodeThe content Takumi renders
optionsImageResponseOptions, partialForwarded to ImageResponse, no format

Options

These come from TakumiOptions in fumapress/plugins/takumi:

OptionDefaultNotes
generateA built-in title and description card(page) => { node, options? }. this is the app context.
optionsNoneImageResponse options shared by every image. generate overrides them per page.
width1200Image width, also written to og:image:width
height630Image height, also written to og:image:height
basePath/ (static) or /_takumi (dynamic)Route prefix for image URLs

The plugin always encodes WebP, so format is not an option.

Image paths

Image paths follow page slugs. A page at /docs/styling gets /docs/styling.webp under basePath, and a section index gets index.webp. With i18n, the locale segment comes first.

Fonts

Takumi never reads system fonts. To cover characters outside the built-in Latin font, load families through options.fonts. Put fonts every page uses in the shared options, so they resolve once.

See Typography & Fonts.

Last updated on