default

The hibana library re-exports various Lume helper plugins and utility functions designed to enhance Lume static site generation projects.

Examples

Add hibana to your Lume project's deno.json import map:

...
"imports": {
  "lume/": "https://deno.land/x/lume@v3.0.3/",
  "lume/cms/": "https://cdn.jsdelivr.net/gh/lumeland/cms@0.12.0/",
  "lume/jsx-runtime": "https://deno.land/x/ssx@v0.1.10/jsx-runtime.ts",
  "hibana/": "https://deno.land/x/hibana@v1.3.0/"
},...

Or you can import hibana directly from GitHub:

"hibana/": "https://raw.githubusercontent.com/RickCogley/hibana/v1.3.0/"

Then import hibana into your Lume _config.ts:

import {
  cssBanner,
  shuffle,
  deferPagefind,
  externalLinksIcon,
  ventoHeadingAnchors,
  ventoTOC,
  ventoTOCInject,
  temporalDate,
  markdownMetadata,
  breadcrumbSchema,
  languageAlternatesSchema,
  fixFontPaths,
  injectDoctype,
} from "hibana/mod.ts";

Functions

f
addOSClass(): void

Adds OS detection class to document body. Convenience function that automatically adds 'os-{platform}' class.

f
cssBanner(options: CssBannerOptions)

A Lume plugin that prepends a CSS comment banner to all .css files.

f
deferPagefind()

Lume plugin to defer the loading of Pagefind CSS and JS.

f
detectOS(): OS

Detects the user's operating system from the user agent string. Useful for platform-specific styling or functionality.

f
externalLinksIcon(siteUrlInput?: string | URL)

Adds an external link icon to <a> anchor elements that point to external sites. Skips links inside elements with the class .no-external-icon.

f
fixFontPaths(options: FixFontPathsOptions): string

Generates a shell command to fix font paths

f
generateDoctypeCommand(options?: InjectDoctypeOptions): string

Generates a shell command string for DOCTYPE injection

f
injectDoctype(options?: InjectDoctypeOptions): () => Promise<void>

Creates an event listener function that injects DOCTYPE into all HTML files

f
prefersReducedMotion(): boolean

Checks if the user prefers reduced motion based on their system settings. Important for accessibility - animations should be disabled when this returns true.

f
shuffle(userOptions?: Options)

A Lume plugin to register the filter "shuffle" that shuffles an array.

f
trapFocus(container: HTMLElement): void

Traps focus within a given container element. Useful for modal dialogs to prevent users from tabbing outside the modal.

f
ventoHeadingAnchors(userOptions?: HeadingAnchorsOptions): (pages: Page[]) => void

Adds ID and anchor links to heading elements in Vento-rendered pages.

f
ventoTOC(userOptions?: TOCGeneratorOptions): (pages: Page[]) => void

Generates a table of contents (TOC) from headings in Vento-rendered pages.

f
ventoTOCInject(): (pages: Page[]) => void

Injects TOC HTML into pages at the injection marker

Interfaces

I
BreadcrumbSchemaOptions

Configuration options for breadcrumb schema generation

I
FixFontPathsOptions

Configuration options for font path fixing

I
HeadingAnchorsOptions

Options for the heading anchors processor.

I
HomeNames

Home page names for different languages

I
InjectDoctypeOptions

Configuration options for DOCTYPE injection

I
LanguageAlternatesSchemaOptions

Configuration options for language alternate schema linking

I
MarkdownMetadataOptions

Configuration options for markdown metadata extraction

I
TemporalDateOptions

Configuration options for the temporal date filter

I
TOCGeneratorOptions

Options for the TOC generator processor.

I
TOCNode

A single node in the table of contents tree.

Type Aliases