Archive
Monthly archive listing pages for Riebeckite. The plugin builds its listings with
the Core collection engine (buildContentCollections), so links, ordering, and
pagination reuse the same query pipeline as the rest of the site.
Installation
pnpm add @riebeckite/plugin-archive
Usage
import { archive } from "@riebeckite/plugin-archive";
export default {
plugins: [archive()],
};
Page types
The plugin registers a single Page Type, archive, and only while the plugin is
enabled. Routes are generated by the plugin, not by application code.
-
archive: one listing page per month at<basePath>/<yyyy>/<mm>, with additional pages at<basePath>/<yyyy>/<mm>/page/<n>when pagination applies.
Entries are grouped by the first available date among published, date, and
created, at month granularity. Months are ordered newest first, and every link
uses the entry's resolved permalink.
Publication and localization
Listings are built from manifest.discoverableEntries, so unlisted, draft, and
scheduled notes never appear. The period title and the previous/next pagination
labels follow site.locale; set locale on the plugin to override it. Japanese
and English labels are provided, and the period is formatted through
Intl.DateTimeFormat for any locale.
Options
| Option | Type | Default | Description |
|---|---|---|---|
basePath |
string |
"/archive" |
Path prefix for the generated pages. An empty string disables them. |
pageSize |
number |
10 |
Entries per page. 0 keeps a single page. |
locale |
string |
site.locale |
Locale used for the period and pagination labels. |
className |
string |
"rb-archive" |
Root CSS class for the rendered fragment. |
Exports
archive/archivePlugin— the plugin factory.resolveArchiveOptions— resolves options with defaults.buildArchiveCollections— builds the monthly collections for entries.archiveDefinitions— the Core collection definitions used by the plugin.renderArchivePage— renders one archive listing page to HTML.formatArchivePeriod,archivePaginationLabels— locale helpers.-
DEFAULT_ARCHIVE_BASE_PATH,DEFAULT_ARCHIVE_PAGE_SIZE,DEFAULT_ARCHIVE_CLASS_NAME,ARCHIVE_COLLECTION_KIND.
Notes
The plugin ships no stylesheet; the rendered fragment carries rb-archive
classes so a site can style it directly. Set basePath to a different prefix if
/archive clashes with existing content, and set it to "" to turn the
generated pages off without removing the plugin.