Module

cache.indexes.date_range_index

Date Range Index - Index pages by year and month.

Classes

DateRangeIndex
Index pages by publication date (year and month buckets). Creates index entries for both year and …
2

Index pages by publication date (year and month buckets).

Creates index entries for both year and year-month: '2024' → All pages from 2024 '2024-01' → All pages from January 2024 '2024-02' → All pages from February 2024

Provides O(1) lookup: site.indexes.date_range.get('2024') # All 2024 posts site.indexes.date_range.get('2024-01') # All January 2024 posts

Use cases:

  • Archive pages by year/month
  • "Recent posts" filtering
  • Date-based navigation
  • Publication timelines
Inherits from QueryIndex

Methods 1

extract_keys
Extract year and year-month from page date.
1 list[tuple[str, dic…
def extract_keys(self, page: Page) -> list[tuple[str, dict[str, Any]]]

Extract year and year-month from page date.

Parameters 1
page Page
Returns

list[tuple[str, dict[str, Any]]]

Internal Methods 1
__init__
1 None
def __init__(self, cache_path: Path)
Parameters 1
cache_path Path