Skip to content

v2.4.0

Choose a tag to compare

@stamat stamat released this 10 Aug 18:13
· 15 commits to main since this release

A "last updated" line under a post had two ways to get its date and both were
bad. Keep updated current by hand and it is one more thing to forget in every
edit. Read the file's modification time instead and git clone erases it — CI
checks out every file at once, so the whole site reads as edited today.

Added

  • markup.options.lastUpdated gives every page an updated date, without
    shelling out to git.
    Set it to true and Poops keeps an index of content
    hashes at .poops-updates.json (a string names a different file). A page's date
    moves only when its body actually changes — front matter is outside the hash,
    so retitling or retagging a post is not editing it — and every build after
    that reads the same date back. Templates get page.updated like any other
    front-matter field; it also feeds dateModified, article:modified_time and
    the sitemap. A page carrying its own updated keeps it and stays out of the
    index. The index file has to be committed, and a build has to run before
    the commit — it is the only memory of when a page was edited, so a build says
    Updated dates changed for 3 pages — commit .poops-updates.json whenever it moves.

Fixed

  • The sitemap's <lastmod> now means last modified. It read front matter
    date — a publication date — so a post revised for a year still advertised
    itself to crawlers as untouched since the day it went up. updated wins where
    a page has one, with date as the fallback.
  • A date front matter cannot fail the build. A date (or updated) that
    is not a date reached toISOString() on an Invalid Date while the sitemap was
    being written, and took the whole build down with a RangeError that named no
    page. The entry now goes out without a <lastmod>.

Full Changelog: v2.3.0...v2.4.0