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

Finding Content

Search, indexes, maps and switchable views that help a reader find a page on a large site, and the data each one needs.

Several ways in

Readers look for a page in different ways. One knows a word in it. One knows the subject. One knows who wrote it, or that it was new last week, or that they had it open yesterday. A site with many pages should offer more than one of these routes.

Each route is one component. They fall into three groups by where their data comes from, and that decides what you have to build.

Reader knowsComponentData source
A word or phrase <site-search> A Pagefind index, built after your pages
A term, alphabetically <site-index> An index you write as links, or a JSON file
Where it sits in the site <site-map> A nested list of links you write, or a JSON file
When it was released <time-index> A changelog you write
The subject <topic-map> The site index, plus a vocabulary file
The author <author-index> The site index
How it was made or reviewed <trust-filter> The site index
That they read it before <recently-visited> History kept in the reader's own browser
That it is widely read <popularity-index> An analytics endpoint you run

The site index is one JSON file with a record per page. Page Metadata describes its shape. The library reads it and does not write it.

One list, several views

<content-lens> holds several of these components and shows one at a time, with a row of buttons to switch. Give it the address of the site index once in data-lens-src and it passes that to each child that has no source of its own.

  • Each child needs data-lens-name. data-lens-label sets the button text. Without it the name is used.
  • data-lens-default names the view shown first. The reader's last choice is kept for the browser session and wins on a return visit.
  • data-heading-level="0" removes a child's own heading where the button already names it. <topic-map>, <recently-visited> and <popularity-index> accept it.
  • Every child also works alone, outside <content-lens>, with its own data-lens-src.

Indexes you write

Three components improve a list that is already in the page. The list is plain links, so it works without script and search engines can follow it. The component adds the controls.

ComponentYou writeIt adds
<site-index> An alphabetical list of terms, each with links to the pages that cover it A filter box, a row of letters to jump by, and an optional limit per letter with a show more control
<site-map> A nested list of the site's pages A mark on the current page (current takes its path), with its branch opened, and controls to expand or collapse every branch. A second mode, mode="ia-tree", turns the list into a tree or chart with page-type and status badges, for planning a site's structure.
<time-index> A changelog: a list of dated entries Relative dates, a newest-first or oldest-first control, and with versions a filter by version

<site-index> and <site-map> can also take their content from a JSON file through src, which replaces the list in the page. <time-index> can add a recently updated pages list from a JSON file named in updates-src.

Views of the site index

These three fetch the site index and build their display from it.

  • <author-index> groups pages under each author, with a filter box. sort="count" puts the most prolific author first. If you write a list inside it, that list is shown when the fetch fails.
  • <topic-map> shows pages as a tree of subjects. It needs a second file, the vocabulary (/vocabulary.json unless you set data-vocabulary-src), which lists each concept's @id, its skos:prefLabel and its broader or narrower concepts. A page appears under every id in its concepts array.
  • <trust-filter> filters pages by how they were made, what review they had, their status and whether they carry a signature. Ticking two values in one group widens the list. Ticking values in two groups narrows it. Has signature means a signature is declared in the index. Only <page-info>, on the page itself, checks one.

Views of reader activity

<recently-visited> lists pages this reader has opened. The history is kept in the browser's local storage and is never sent anywhere. A page is recorded only if it has <meta name="vb:track-history" content="on"> or contains the component. The panel gives the reader controls to pause recording and to clear the list. data-vb-no-track on <html> turns recording off for the site.

<popularity-index> lists the most visited pages. It fetches /api/analytics/popular, or the address in analytics-src, and expects { "pages": [{ "url", "title", "views" }] }. You run that endpoint. When it does not answer, the component sets data-state="unavailable" on itself, so one rule can hide the panel.

↑