Repository navigation
feat: publish blog posts on their date - #64
Merged
Merged
Conversation
A post's `date` is now its publish date. A build leaves out the posts dated after its publish day, the UTC day it runs on, as it leaves out drafts, so a post can merge before its date. PUBLISH_DAY builds the site as it is on another day, and INCLUDE_FUTURE_POSTS=true includes the posts of every date. The dev server still shows every post.
In a build, the scheduled-posts integration fixes the build's publish day and adds a step to the Markdown pipeline that renders a link to a post the build leaves out, `/blog/<slug>` with or without an anchor, as its plain text. The feeds render posts through the same pipeline. The build that publishes the post links to it again. It reads each post's slug, date and draft flag with Astro's own frontmatter parser, before the content layer loads them.
The checks and the weekly external link check build with INCLUDE_FUTURE_POSTS=true, so a post is checked before it goes out and the links to it resolve.
Publish scheduled posts runs daily at 06:17 UTC. It checks out main, asks `npm run posts-due` for the posts dated that day, and when there are any, starts Deploy to GitHub Pages on main. Scheduled workflows run on the default branch, develop, so it dispatches the deploy rather than deploy.yaml having a schedule of its own.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A Blog post's
dateis its publish date. A post merged intomainbefore its date stays out of the site until a daily deploy on that date publishes it.checks.yamlandexternal-links.yamlbuild withINCLUDE_FUTURE_POSTS=true, so a post is checked before it goes out and the links to it resolve.PUBLISH_DAY=<YYYY-MM-DD>builds the site as it is on that day. The dev server shows every post.Evidence
Builds of this branch with the six November posts from
updates-and-blogsadded (2026-11-23 to 2026-11-28):After, today (2026-11-24):
dist/: pages, Open Graph images, sitemap, RSS and Atom, tag pages, related Content, Learn data. The series box reads "Part 2 of 2".That has <a href="/blog/extension-packages-as-image-volumes">a post of its own</a>.(a dead link)After:
That has a post of its own.PUBLISH_DAY=2026-11-26: the 11-25 post links to 11-26 again,#upgrading-from-a-single-clusterincluded. 11-27 and 11-28 stay out. 711 links, 0 dead.INCLUDE_FUTURE_POSTS=true: all four future posts build with their links. 766 links, 0 dead.npm run posts-due -- <day>: 2026-11-23 printsinstalling-educates-4-with-helm, 2026-11-28 printsextension-packages-as-image-volumes, and 2026-11-29 prints nothing.post-schedule,post-dates,unlink-posts).astro checkreports 0 errors and Prettier is clean.Merge Danger
Door: two-way
Reverting restores today's behavior. Nothing is migrated or deleted.
Blast Radius: publishing
mainbefore or together withupdates-and-blogs. Otherwise the 11-25 to 11-28 posts go live on that branch's first deploy.developbut runsmain'sposts-due, so it fails each day until this is onmain.readinglist, is not unlinked. A Featured Content id naming a held-back post fails the build. The README says to add either only once the post is out.