@gurupanguji

My Web This Week Design

Goal

Automatically generate a Sunday roundup post titled 🔗 My web this week - W<weeknumber> from that week’s existing 🔗 posts in _posts/, and publish it on Sunday at 05:00 PT.

Problem

Issue #99 asks for a weekly summary post that compiles the week’s quotes into one Sunday artifact.

The repository already has:

What is missing is a content-generation step that creates the weekly roundup before the Sunday publish window.

Design

1. Add a dedicated weekly roundup generator

Add a small generator script, likely scripts/generate_my_web_this_week.py.

Responsibilities:

The script should be deterministic and safe to rerun for the same Sunday.

2. Keep source extraction narrow in v1

Supported source shapes in v1:

Unsupported in v1:

That older markup cleanup should stay separate as follow-up issue #100.

This keeps the generator simple and aligned with the repository’s native-markup direction.

3. Define the roundup window explicitly

For a given target Sunday:

The workflow’s normal scheduled run should happen before Sunday morning publish, so in practice it composes the week that just ended.

The generator should work from the target Sunday date instead of “today” so manual reruns stay predictable.

4. Generate a scheduled Sunday post

Write or refresh a post at:

Required front matter:

The date must follow the repository’s scheduled-post rule so it will publish at 05:00 PT.

The body should use native markdown and stay minimal.

For each included source post:

The roundup should not invent new commentary.

5. Generate or refresh the companion snippet

Write or refresh:

This repo already treats snippets as mandatory for future-dated posts, so the weekly generator should create both artifacts in the same pass.

The snippet should match the generated post’s front matter and canonical URL conventions.

6. Add a scheduled workflow that opens a PR

Add a workflow that runs before the Sunday morning publish window.

Responsibilities:

This should follow the repository’s PR-only automation policy.

Operational constraints:

7. Make reruns update in place

If the weekly post or snippet already exists for that Sunday:

This makes the job idempotent in a useful way. Reruns should rebuild the roundup instead of treating an existing file as an error.

8. Fail only on empty or broken generation

Failure conditions:

Partial success behavior:

File Changes

New

Modify

Testing

Add unit coverage for:

Risks

Source formats are inconsistent

Some older link posts still use legacy wp:quote markup. Deferring that extraction keeps v1 smaller, but it means the first version may skip some otherwise relevant posts.

Workflow write permissions may block automation

If GitHub Actions cannot create or update branches and PRs, the weekly generation workflow will not complete. The workflow should fail loudly with a clear message about the required repository setting or token permission.

Generated content can drift if reruns are manual and late

Because reruns refresh the target Sunday artifact in place, the generator must use an explicit target Sunday window so manual reruns stay deterministic.

Acceptance Criteria

  1. A scheduled run before Sunday morning creates or refreshes _posts/YYYY-MM-DD-my-web-this-week.md for the target Sunday.
  2. The generated post title matches đź”— My web this week - W<weeknumber>.
  3. The generated post uses YYYY-MM-DD 12:00:00 +0000 front matter for the target Sunday.
  4. Each included roundup item contains either the extracted markdown quote or the embed-led artifact line, plus a link back to the original gurupanguji.com daily post.
  5. Posts that only rely on legacy wp:quote extraction are skipped in v1 and logged as skipped.
  6. The companion snippet is created or refreshed in _snippets/ during the same run.
  7. Rerunning the generator for the same Sunday updates existing weekly artifacts in place.
  8. If no qualifying source posts exist, the generator exits non-zero and creates no weekly artifacts.
  9. The automation opens a PR instead of writing directly to main.