My site 14FreeTools is a plain static site. A Python script reads HTML files from a posts/ folder, writes everything into site/, and a GitHub Action uploads it over FTP. No CMS, no database.
That raised a question early on: how do you schedule a post for next Tuesday when there's no server to flip a switch at the right time?
The answer turned out to be about ten lines of code and one cron line.
The post header
Each post starts with a small comment block that the build script parses:
<!-- title: Compress Image to 200KB Without Losing Quality description: Shrink a photo to just under 200 KB ... date: 2026-12-14 tools: image-compressor, compress-image-to-200kb --> <p>The post body starts here...</p> The date field does double duty. It's the date shown on the page, and it's the go-live date.
Skip the future in the build
import datetime from zoneinfo import ZoneInfo today = datetime.datetime.now(ZoneInfo("Asia/Karachi")).date().isoformat() for path in sorted(glob.glob("posts/*.html")): meta, body = parse(path) if meta["date"] > today or meta.get("status") == "draft": continue # not live yet POSTS.append({...}) Two details matter here:
- Pin the time zone. GitHub runners are on UTC. My readers are in Pakistan, five hours ahead. Without
ZoneInfo, "today" is the UTC date, so around midnight the build can disagree with my calendar by a day. - ISO dates compare as strings.
"2026-12-14" > "2026-11-30"works without parsing, as long as every date is zero-paddedYYYY-MM-DD.
Because skipped posts are never written, they also stay out of the sitemap, the blog index and the "related posts" boxes. Nothing leaks early.
One cron line to publish
The deploy workflow already runs on every push to main. Adding a schedule makes it rebuild once a day even when nobody pushes:
on: push: branches: [main] schedule: - cron: "35 9 * * *" # 09:35 UTC = 2:35 PM in Pakistan workflow_dispatch: Every afternoon the build runs, today's post passes the date check, and it goes live. Pick an odd minute like :35. Scheduled workflows at :00 queue behind everyone else's and can start late.
Don't link to the future
The one trap: a post published today must not link to a post dated next week, or readers hit a 404. I keep the rule simple. Internal links may only point to tools or to posts whose date is on or before the linking post's date. Before merging, I build the site with the post's date set to today and check that every internal link points to a file that exists in site/.
Re-dating 78 posts in one go
This week I looked at Google Search Console and realised a problem I'd created myself. I had 78 finished posts queued on a Monday/Wednesday/Friday rhythm stretching into mid-2027, while only 7 were live. Google was judging a site with dozens of tool pages and almost no articles.
Since the date is just a header field, fixing that was a short script: keep the order, assign one post per day starting tomorrow.
import re, glob, datetime rows = [] for f in glob.glob("posts/*.html"): s = open(f).read() d = re.search(r"date:\s*(\S+)", s[:800]).group(1) if d > "2026-11-27": rows.append((d, f)) rows.sort() # keep the original order start = datetime.date(2026, 11, 28) for i, (old, f) in enumerate(rows): new = (start + datetime.timedelta(days=i)).isoformat() s = open(f).read() s = re.sub(r"(date:\s*)" + re.escape(old), r"\g<1>" + new, s, count=1) open(f, "w").write(s) Keeping the order is what makes this safe. If post B linked to post A before, A is still earlier than B afterwards, so the "no links to the future" rule still holds without checking anything by hand.
The diff was exactly 78 one-line changes, which is easy to review in a pull request.
Why not just use a CMS?
For a small site, this setup is hard to beat:
- Posts are files, so they're reviewed in pull requests like code.
- Scheduling costs nothing: no plugin, no server process.
- Rolling back a post is a revert.
- The whole site is static HTML, which loads fast on slow mobile data.
The only thing you give up is publishing at an exact minute. For a blog, "sometime after 2:35 PM" is good enough.
If you run a static site and want scheduled posts, try the date check plus a daily cron before reaching for anything heavier.