Vanilla Breeze v0.7.4

Vanilla Breeze v0.7.4 released

0.7.4 gives the Ambient pack weather. A page names one feed URL on its own site, and the pack sets data-weather from it, uses its sunrise and sunset for dawn and dusk, and never shows a stale observation. Helpers for producing the feed from Open-Meteo are included. Ambient p…

Read the release notes

site-index

Interactive site keyword index with an A-Z jump strip, one filter box, term counts, display limits, and optional JSON data loading.

Overview

The <site-index> component enhances a static keyword index with an A-Z jump strip, one filter box, a term count per letter, and display limits with expand/collapse.

Without JavaScript, the static markup is a fully functional keyword index with CSS multi-column layout at wider viewports.

The index is hand-authored: you write the terms and their page references (or serve them as src JSON). Nothing is derived from page front matter or <meta name="concept"> tags; the site’s own keyword index is maintained by hand.

Attributes

AttributeTypeDefaultDescription
placeholder string "Filter index…" Placeholder text for the search input
letters string "entries" Jump nav mode: "entries" (only letters with entries), "all" (full A-Z strip, empty letters disabled), or "none" (hidden).
filter string "all" What the filter box matches: "all" (terms and the titles of the pages they point to) or "topic" (terms only)
limit number — Max topics per letter section before a "Show N more" toggle appears.
src string — URL to load index data from as JSON
data-label-* string English UI string overrides: controls, jump, terms and terms-one ({count} replaced), more ({count} replaced), less, matches, matches-one, no-matches

Features

A-Z Jump Navigation

By default, the jump nav shows only letters that have entries. Set letters="all" to show A–Z plus any other letters your sections use (id="index-é" adds É, sorted with the page language), with disabled states for empty ones. Letters come from the section ids, not a fixed alphabet. Scroll-spy highlights the current letter as the user scrolls, and hovering a letter shows how many terms it holds.

Filter

One filter box sits above the index. It matches a term (.index-term) and the titles of the pages listed under it (.index-refs a), so “button” finds a topic with a “Button element” reference even when the word is not in the topic name. Set filter="topic" to match terms only.

While a filter is active every match shows (the display limit and its “Show N more” buttons step aside), a live status reports “N terms match” or “No matches”, and letters whose sections are filtered out become aria-disabled. Clearing the filter restores the display limit.

Term Counts

Each letter heading shows how many terms it holds (“4 terms”). The pages for a term are listed right under it, so terms carry no count of their own.

Display Limit

When limit is set, letter sections with more topics than the limit show a "Show N more" toggle button. Clicking expands to show all entries; clicking again collapses back.

HTML Structure

The static markup uses semantic HTML with specific classes that the component recognizes. The index is the <nav> that is a direct child of <site-index> and holds the letter sections (or any <nav data-index>), so its aria-label can be translated freely.

Class / ElementPurpose
.index-term Topic heading text within a <span>
.index-refs Nested <ul> of page reference links
<small> Optional content-type pill (e.g., "blog", "tutorial")
id="index-X" Section ID for jump nav anchors (lowercase letter; the letter shown in the strip comes from it)
nav[data-index] Optional explicit marker for the index nav

JSON Data Loading

When src is set, the component fetches index data and renders dynamically. Static markup serves as fallback. Every string renders as text, and only http(s), relative and fragment hrefs become links (anything else, such as javascript:, renders as plain text).

Accessibility

  • Jump nav uses aria-label="Jump to letter"; letters with no entries are plain text (a <span data-empty>), not links, and carry no ARIA state
  • Scroll-spy sets aria-current="true" on the active letter link
  • The controls are a <search> landmark (not a navigation landmark); the input and dropdowns have aria-label attributes
  • A polite role="status" output announces the filter’s match count or “No matches”
  • Letters emptied by the filter get aria-disabled="true" and leave the Tab order
  • Expand/collapse buttons use aria-expanded
  • Filtered items use hidden to remove from the accessibility tree
  • Without JavaScript, the full index is visible and navigable

Related

↑