npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@docubook/plugin-og-image

v0.1.2

Published

Social preview cards for DocuBook Flame: a 1200×630 OpenGraph image for every page, rendered at build time from its frontmatter with Takumi.

Readme

@docubook/plugin-og-image

Social preview cards for DocuBook Flame. Every page gets a 1200×630 OpenGraph image built from its frontmatter, with your logo, site name and theme colours. Authors write nothing extra: title and description are enough.

Cards are rendered at build time with Takumi, a native renderer that needs no browser. A card takes a few milliseconds, and a build only renders the cards whose text or branding changed.

Install

npm install -D @docubook/plugin-og-image
{
  "meta": {
    "baseURL": "https://docs.example.com"
  },
  "plugins": ["@docubook/plugin-og-image"]
}

Set meta.baseURL: social sites only read absolute image URLs.

What it does

  • Sets each docs page's image to its card, so Flame writes the og:image tag as it does for an image you set yourself.
  • Adds og:image:width, og:image:height, og:image:type and og:image:alt.
  • Gives the landing page a card too, taking priority over meta.ogImage for OpenGraph and Twitter previews. Set pages.home to false to use meta.ogImage on home instead.
  • Writes the cards to <docs prefix>/assets/og/, e.g. /docs/assets/og/guides/setup.1a2b3c4d.png. The hash in the name changes with the card's text, so social sites fetch the new card instead of a cached one.
  • Serves the same cards from flame dev.

A page keeps its own image when its frontmatter sets image. og: false turns the card off for one page; og.title and og.description change the card's text without touching the page.

---
title: Configuration reference for docu.json
description: Every option in docu.json.
og:
  title: Configuration
---

Options

| Option | Type | Default | Description | | ---------- | ----------------------------- | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- | | layout | "card" | "minimal" | "card" | card adds the section name, a page-kind chip, a logo tile and a brand bar. minimal shows logo, title, description and domain on a plain background. | | logo | string | false | navbar.logo.src | Logo file: a project path (brand/logo.svg) or a site path (/docs/assets/logo.svg). SVG, PNG, JPEG or WebP, at most 1 MB. false renders no logo. | | siteName | string | navbar.logoText, then meta.title | Name in the card's top row. | | pages | { docs?, index?, home? } | all true | Which pages get a card. | | fonts | { path, weight?, style? }[] | none | Fonts tried before the built-in Geist, which covers Latin-1 only. Add one for titles in other scripts. |

The build warns when a title has characters no loaded font can draw, and names the pages.

How it works

transformFrontmatter sets image: ./assets/og/<slug>.<hash>.png, which Flame resolves against meta.baseURL and the docs prefix. Cards take their text from the frontmatter in the source file, so a title another plugin changes at build time (in onLoad or transformFrontmatter) does not reach the card; the file name the page links to and the file onEnd writes always match. onEnd reads every page's frontmatter, renders the cards that are missing or out of date, deletes cards of removed pages, and records what it wrote in .docu/og-image.json. Takumi's render() never touches the network: the logo and fonts are read from disk.

Development

pnpm --filter @docubook/plugin-og-image build
pnpm --filter @docubook/plugin-og-image test
UPDATE_GOLDEN=1 pnpm --filter @docubook/plugin-og-image test   # after an intended layout change

The golden-image tests compare against src/__tests__/__golden__/ on Linux x64 only, where CI runs.