Skip to main content

flexweg-archives

The flexweg-archives plugin generates static archive pages grouped by year — and optionally by month or ISO week — under /archives/. It's the static-friendly alternative to pagination: instead of ?page=2, visitors browse by time period.

It also injects a "See full archives" link on home and category listings so the entry point is discoverable without manual menu work.

What it generates

PagePath on FlexwegContents
Index/archives/index.htmlEvery period (year, optionally month/week) with post counts
Year/archives/2026/index.htmlAll online posts created in 2026
Month/archives/2026/03/index.htmlAll online posts created in March 2026
Week/archives/2026/W12/index.htmlAll online posts created in ISO week 12 of 2026

Each page renders through the active theme's category template (via archive if the theme provides one — fallback to category), so look + feel matches the rest of the site without per-theme work.

Settings

/settings/plugin/flexweg-archives exposes:

  • Drill-downyear, year + month, or year + month + week. Default year.
  • Show month grid on year pages — small table of months on each year page (default on).
  • Show counts — appends (N) to each period link in the index (default on).
  • Inject "See full archives" link — on home / category templates (default on). Position is theme-controlled (typically below the post list).
  • Force regenerate — wipes /archives/ on Flexweg and rebuilds every period page + the index from scratch.

How it hooks in

Three lifecycle actions:

api.addAction("publish.complete", regenerate);
api.addAction("post.unpublished", regenerate);
api.addAction("post.deleted", regenerate);

Each handler:

  1. Computes the affected periods from post.createdAt (year, month, week as configured).
  2. Rebuilds those periods' pages — or deletes them if they emptied out (empty year sitemap = empty archive year, file goes away).
  3. Rebuilds /archives/index.html.

It also registers a Regeneration target for Themes → Regenerate site → Archives.

When changes apply

ActionFiles updatedLatency
Publish a postTouched periods + /archives/index.htmlWithin seconds
Unpublish / deleteSame (empty periods get deleted)Within seconds
Toggle drill-down (e.g. year → year+month)None automaticallyRun Force regenerate
Settings save (other)None automaticallyRun Force regenerate

Drill-down changes don't auto-regenerate because going from year to year + month would create dozens of new files but leave the old ones in place — Force regenerate is the correct one-click escape hatch.

When Inject "See full archives" link is on, the plugin filters post.template.props for home / category renders and adds an archivesLinkUrl field. The active theme's templates include this field by convention — the default and magazine themes both render it as a footer link below the post grid.

Themes that don't render the field (e.g. minimal custom themes) silently ignore it. To add support in your own theme:

{props.archivesLinkUrl && (
<a href={props.archivesLinkUrl} className="archives-link">
See full archives →
</a>
)}

Toggle

Plugins → Plugins tab → flexweg-archives card → Enable / Disable.

Disabling does not delete files already on Flexweg. To clean up after a disable, delete /archives/ via Flexweg's file manager.

Internal details

  • Source: src/plugins/flexweg-archives/
  • External in production builds: yes
  • Hooks used: publish.complete, post.unpublished, post.deleted actions; post.template.props filter; registerRegenerationTarget
  • Storage path: /archives/
  • Translations: 7 locales

Continue