function breadcrumbSchema
breadcrumbSchema(options: BreadcrumbSchemaOptions): (pages: any[]) => void

Creates a breadcrumb schema preprocessor

This preprocessor:

  1. Parses the URL path into breadcrumb segments
  2. Creates Schema.org BreadcrumbList with proper @id and positioning
  3. Skips pages that already have custom breadcrumb schema
  4. Skips root pages (/ and language roots like /en/)
  5. Properly formats segment names (capitalizes, replaces hyphens with spaces)

Examples

Example 1

const preprocessor = breadcrumbSchema({
  baseUrl: "https://example.com",
  homeNames: { en: "Home", ja: "ホーム" },
  languages: ["en", "ja"],
});
site.preprocess([".md"], preprocessor);

Parameters

Configuration options

Return Type

(pages: any[]) => void

Preprocessor function compatible with Lume's site.preprocess()

Usage

import { breadcrumbSchema } from ".";