Skip to content

Social images

Docskit generates a static 1200 × 630 PNG at /og.png by default and uses it in Open Graph and Twitter metadata. It uses the site title, description, public host, and the local light logo when available. The light palette and bundled Hanken Grotesk font keep the image consistent and avoid font downloads during builds.

Customize the text in docskit.config.ts:

TypeScript
og: {
  title: "Your docs.",
  highlight: "One package.",
  description: "Build opinionated static documentation sites with Markdown, search, and versioning.",
  footer: "Markdown · Search · Static output",
},
imageAlt: "Docskit — Your docs. One package.",

highlight is an optional second headline line in the accent color. Keep headline lines short. og.logo can select a different local public asset, such as "/logos/social-logo.svg"; set it to false to omit the logo. SVG, PNG, JPEG, and WebP assets are supported. Remote navbar logos are omitted from generated cards.

The image is available during development and written to dist/og.png during build. Deployment base paths are added to its metadata URL automatically.

To provide your own image, put it in public/ and configure:

TypeScript
image: "/social-cover.png",
imageAlt: "My Project documentation",

A custom image overrides automatic generation. To disable generation without providing an image, set og: false. Metadata then uses Twitter’s summary card.

Check the image and metadata

Start development and open /og.png to inspect the generated card. After pnpm build, check dist/og.png and preview a documentation page. Its Open Graph and Twitter metadata use the configured public origin, deployment path, and image.

Snapshots use the shared site's configured image. The card is generated for the shared site rather than separately for every version.