Files
astro-website/openspec/specs/homepage-content-modules/spec.md
2026-02-10 01:20:58 -05:00

46 lines
2.4 KiB
Markdown

## ADDED Requirements
### Requirement: Homepage modules and ordering
The homepage MUST render distinct content modules that include:
- newest content
- high-performing videos
- channel/podcast highlights
- prominent conversion CTAs
The homepage MUST render modules in a deterministic order configured by the site (not dependent on network timing).
#### Scenario: Homepage render with available data
- **WHEN** content data is available in the cache
- **THEN** the homepage renders the newest module and the high-performing videos module in the configured order
### Requirement: Newest content module
The system MUST compute a "newest" feed across sources by sorting normalized items by `publishedAt` descending.
The system MUST support filtering and limiting the number of items displayed for the newest module.
#### Scenario: Mixed-source newest list
- **WHEN** the cached dataset contains YouTube, Instagram, and podcast items with different publish dates
- **THEN** the newest module lists items ordered by `publishedAt` descending regardless of source
### Requirement: High-performing YouTube videos module
When `metrics.views` is available for YouTube items, the system MUST compute "high-performing" videos by ranking videos by `metrics.views` (descending) with an optional manual override list.
When `metrics.views` is not available, the system MUST render the high-performing module using a manual curated list and MUST NOT fail the page render.
#### Scenario: Views-based ranking available
- **WHEN** YouTube items include `metrics.views`
- **THEN** the high-performing module shows videos ranked by views, unless a manual override list is configured
#### Scenario: Views-based ranking unavailable
- **WHEN** YouTube items do not include `metrics.views`
- **THEN** the high-performing module renders using a manual curated list and the page still loads successfully
### Requirement: Graceful empty and error states
If a module has no content to display, the homepage MUST render a non-broken empty state for that module and MUST still render the rest of the page.
The Instagram module is an exception: if there are no Instagram items to display, the homepage MUST omit the Instagram module entirely (no empty state block) and MUST still render the rest of the page.
#### Scenario: No Instagram items available
- **WHEN** the cached dataset contains no Instagram items
- **THEN** the Instagram-related module is not rendered and the homepage still renders other modules