Developer builds expiry-aware static site system to auto-hide outdated deals
A developer managing multiple deal-listing websites built a data-driven system to handle time-limited content such as Kindle manga sales and grocery offers. Each article stores a deadline field in its JSON data, and a build script calculates days remaining at site-generation time rather than relying on manual removal. A key design choice was using the article's last verification date as the reference point, not the current date, to avoid asserting facts that were never re-checked. The system labels content as 'may have ended' once past its deadline, and filters rather than deletes expired entries to preserve existing URLs. The approach also accounts for timezone parsing issues in JavaScript, pinning dates to JST to prevent off-by-one errors.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in