Vanilla Breeze

popularity-index

Aggregated most-visited lens. Fetches from an analytics endpoint and degrades gracefully when the endpoint is unavailable, returns 5xx, or returns an empty list.

Overview

The aggregated counterpart to <recently-visited>. Where that surface is local-only, this one consumes site-wide aggregate data from an analytics endpoint and shows the most-visited pages.

The default endpoint /api/analytics/popular is not yet implemented in the VB site — the component degrades to a friendly explanatory message when the endpoint is unavailable, returns 5xx, or returns an empty list. Sites that don't run analytics can hide it via display: none or simply not place the element.

Attributes

AttributeTypeDefaultDescription
data-lens-srcstring"/api/analytics/popular"Endpoint URL that returns popularity data
data-meta-srcstringOptional pages.json URL used to enrich each entry with title/topic/provenance metadata when the endpoint returns sparse data
limitnumber10Max entries shown
windowstringOptional time-window query forwarded as ?window=24h (or 7d, 30d)

Endpoint contract

The component expects the endpoint to respond with JSON in either of these shapes:

or simply an array. Each entry must carry url; title and views are optional but improve the rendered list. If data-meta-src is set, missing titles fall back to the matching pages.json record.