v2.4.0
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.lastUpdatedgives every page anupdateddate, without
shelling out to git. Set it totrueand 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 getpage.updatedlike any other
front-matter field; it also feedsdateModified,article:modified_timeand
the sitemap. A page carrying its ownupdatedkeeps 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.jsonwhenever 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.updatedwins where
a page has one, withdateas the fallback. - A date front matter cannot fail the build. A
date(orupdated) that
is not a date reachedtoISOString()on an Invalid Date while the sitemap was
being written, and took the whole build down with aRangeErrorthat named no
page. The entry now goes out without a<lastmod>.
Full Changelog: v2.3.0...v2.4.0