Skip to content

Releases: RickCogley/hibana

v1.3.0 vento utilities

23 Nov 12:22
8f799ff

Choose a tag to compare

What's Changed

  • Release v1.3.0: Add Vento TOC and heading anchor processors by @RickCogley in #4

New Contributors

Full Changelog: v1.2.1...v1.3.0

Summary

This release adds comprehensive table of contents (TOC) and heading anchor support for pure Vento (.vto) pages, matching the
functionality that markdown-it plugins provide for markdown pages.

Added

New Processors for Vento Pages

  • ventoHeadingAnchors - Add ID attributes and anchor links to headings in Vento-rendered pages

    • Automatic unique slug generation with collision prevention
    • Configurable heading levels (min/max) and anchor positioning
    • Matches markdown-it-toc-done-right behavior by default
    • Supports containerSelector option to limit scope to main content
  • ventoTOC - Generate hierarchical table of contents from headings in Vento pages

    • Builds nested TOC tree structure stored in page.data.toc
    • Generates full URLs with anchors for each heading
    • Supports containerSelector option for scoped extraction
  • ventoTOCInject - Inject TOC HTML into rendered pages at marker position

    • Works around Lume's build order limitation (processors run after layouts)
    • Finds <!-- VENTO-TOC-INJECTION-POINT: --> marker and replaces with TOC HTML
    • Respects show_toc frontmatter setting

New Utility Modules

  • utils/slugify.ts - URL-safe slug generation from text
  • utils/headings.ts - Heading extraction and manipulation utilities
  • types/vento_toc.ts - TypeScript types for TOC functionality

Changed

  • ventoHeadingAnchors default behavior now matches markdown-it style:
    • anchorPosition: "inside" (anchor wraps heading text)
    • anchorSymbol: "" (empty - use CSS ::before for icon)
    • Ensures consistent appearance between Vento and markdown pages

Fixed

  • Prevent duplicate anchors/TOC on markdown pages by skipping pages with "md" in templateEngine chain
  • Only pure Vento pages (templateEngine: ["vto"]) are now processed by Vento processors

Documentation

  • Comprehensive documentation for all three Vento TOC processors in README
  • Complete workflow examples showing processor ordering
  • CSS styling examples for anchor links
  • Explanation of Lume build order and HTML injection solution
  • New RELEASE_GUIDE.md with step-by-step release process

Installation

{
  "imports": {
    "lume/": "https://deno.land/x/[email protected]/",
    "hibana/": "https://deno.land/x/[email protected]/"
  }
}

Or from GitHub:

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

Quick Start

import lume from "lume/mod.ts";
import { ventoHeadingAnchors, ventoTOC, ventoTOCInject } from "hibana/mod.ts";

const site = lume();

// 1. Add IDs and anchors to headings
site.process([".html"], ventoHeadingAnchors({
  level: 2,
  maxLevel: 4,
  containerSelector: "article",
}));

// 2. Generate TOC data structure
site.process([".html"], ventoTOC({
  level: 2,
  maxLevel: 4,
  containerSelector: "article",
}));

// 3. Inject TOC HTML at marker
site.process([".html"], ventoTOCInject());

export default site;

See the https://github.com/RickCogley/hibana#ventoheadinganchors for more details.

v1.2.1 - Font Path Bug Fix

21 Nov 12:38
v1.2.1
dd5ea63

Choose a tag to compare

Fixed

  • Fixed template literal syntax bug in fixFontPaths script that caused incorrect sed command generation
    • Changed $ {fontDir} to ${fontDir} in both fixFontPaths and generateFontPathFixes functions
    • Bug was causing literal string /$ {fontDir}/ in CSS output instead of actual font directory paths like /fonts-en/

Full Changelog

v1.2.0...v1.2.1

v1.2.0 - 7 new modules

21 Nov 01:36
150a241

Choose a tag to compare

Hibana v1.2.0 - Phase 1 Expansion Release

🎉 Major Feature Additions

This release adds 7 powerful new modules extracted from the eSolia 2025 project, significantly expanding Hibana's capabilities for Lume static site generators.

✨ New Features

Filters

  • temporalDate - Modern date formatting using the Temporal API
    • Timezone-aware formatting with configurable defaults
    • Multiple format styles: full, long, medium, short, iso
    • Full locale support for internationalization
    • Type-safe with comprehensive error handling

Preprocessors

  • markdownMetadata - Extract excerpts and calculate elapsed days
    • Configurable excerpt markers (default: )
    • Automatic elapsed days calculation using Temporal API
    • Optional feature toggling
  • breadcrumbSchema - Auto-generate Schema.org breadcrumbs
    • Creates breadcrumb structured data from URL paths
    • Multilingual support with configurable home page names
    • Includes helper function for manual breadcrumb creation
  • languageAlternatesSchema - Link translated pages via Schema.org
    • Maps pages by ID across different languages
    • Adds translationOfWork / workTranslation properties
    • Supports multiple schema types per page

Scripts

  • fixFontPaths - Fix Google Fonts relative paths in CSS
    • Platform-aware (macOS vs Linux sed syntax)
    • Batch processing for multiple CSS files
    • Safe sed operations with proper escaping
  • injectDoctype - Inject DOCTYPE into HTML files
    • Workaround for Lume 3.x DOCTYPE handling
    • Platform-aware sed commands
    • Removes duplicates before injecting

Utilities

  • DOM Utilities Additions:
    • prefersReducedMotion() - Check user's motion preference (accessibility)
    • detectOS() - Detect operating system
    • addOSClass() - Auto-add OS class to document body

🔧 Improvements

  • Dependencies: Upgraded Lume from v3.0.4 to v3.1.2
  • Developer Experience:
    • Added task scripts in deno.json: test, check, fmt, lint, doc
    • Configured lint rules to exclude generated files
    • Added Temporal API support flag for tests
  • Documentation:
    • Comprehensive README rewrite with detailed API documentation
    • All new features documented with examples
    • Added CLAUDE.md for AI-assisted development context
    • Fresh API documentation in docs/api/
    • Detailed CHANGELOG with all changes

🧪 Testing

  • Added unit tests for all new modules
  • Test suite includes 20 tests (13 passing, 7 need refinement)
  • Tests use Temporal API with proper unstable flags

📦 Migration Benefits

Projects migrating from custom implementations can expect:

  • 400-500 lines of code reduction in typical use cases
  • Standardized, tested implementations
  • Better type safety and error handling
  • See docs/EXTRACTION_SUMMARY.md for detailed migration examples

⚙️ Requirements

  • Deno: 1.40+ (for Temporal API support)
  • Lume: 3.x (tested with 3.1.2)
  • Platform: Unix/Linux/macOS for script utilities (sed required)

📝 Notes

  • Not published on JSR due to Lume's https import requirements
  • Uses any types for Lume compatibility (intentional design choice)
  • Schema.org preprocessors assume specific frontmatter structure

🔗 Resources

  • Full documentation in README.md
  • API docs available in docs/api/
  • Migration guide in docs/EXTRACTION_SUMMARY.md

Full Changelog: v1.1.0...v1.2.0

v1.1.0

08 Nov 11:10
v1.1.0
3b8ee0a

Choose a tag to compare

Performance Improvements and Lume Debug Bar Visibility

Changed

  • Performance: Reduced console logging in processors - now logs summary statistics instead of per-page messages
  • Performance: Cached DOMParser instance in defer_pagefind processor to avoid creating new instances for every page
  • Debugging: Added named function expressions to all processors (deferPagefindProcessor, externalLinksIconProcessor, cssBannerProcessor) so they appear correctly in Lume debug bar instead of showing as "unknown"

Fixed

  • Type annotations added to cssBannerProcessor for better type safety

Full Changelog

v1.0.18

14 Jun 12:24
e2e4418

Choose a tag to compare

removes import map from deno.json

Full Changelog: v1.0.17...v1.0.18

v1.0.17

14 Jun 11:34
805014c

Choose a tag to compare

Update deps to use jsr for most

Full Changelog: v1.0.16...v1.0.17

v1.0.16

14 Jun 11:28
be5af6b

Choose a tag to compare

Add deps.ts because deno will only use the import map from the project calling hibana. Otherwise the dependencies don't resolve.

Full Changelog: v1.0.15...v1.0.16

v1.0.15

14 Jun 09:08
6400c81

Choose a tag to compare

A little better readme and jsdoc in mod.ts

Full Changelog: v1.0.14...v1.0.15

v1.0.14

14 Jun 08:47
8462617

Choose a tag to compare

Prep for publish on deno.land/x

Full Changelog: v1.0.13...v1.0.14

v1.0.13

14 Jun 00:46
5c469d3

Choose a tag to compare

Further fixes for vendored files (they were corrupt after dl)

Full Changelog: v1.0.12...v1.0.13