Skip to content

Ship no personal media; upload page heroes from the page editor - #676

Merged
compscidr merged 2 commits into
mainfrom
chore/neutral-images
Oct 3, 2026
Merged

compscidr merged 2 commits into
mainfrom
chore/neutral-images

Conversation

@compscidr

Copy link
Copy Markdown
Collaborator

Closes #669.

Problem

  • goblog's Docker image carried the original author's photos (jason.jpg, two personal photos, hero_rigolet.jpg, aidecentralized.jpg, code.jpg) and two videos (mesh.mp4, redtree.mp4, 63 MB together).
  • The default landing image, /img/profile.png, was his photo, and a fresh install's Writing and About pages used redtree.mp4 and hero_rigolet.jpg as heroes.
  • Six templates in the default theme (about, archives, posts, presentations, projects, tags) and their Blog handlers were never routed. Three hardcoded his images, and about.html his biography.
  • A page's hero could only be set by typing a URL; there was no way to upload one from the editor.

Changes

  • www/img/profile.png is now a neutral placeholder (a grey silhouette, 2.8 KB). The path is unchanged, so sites whose landing image setting still points at it show the placeholder instead of a 404.
  • Removed the eight personal files, the six unrouted templates and their handlers (Posts, Tags, Speaking, Projects, About, Archives), and the heroes seeded on Writing and About. The theme guide's paragraph about those templates goes too.
  • Page editor: an "Upload a file…" button under the hero field (images and videos). It posts to /api/v1/upload, as the settings page and post editor do, then fills in the URL and sets the hero type from the file's type. The page is saved with the existing Save button.

⚠️ Existing sites

A site whose pages use one of the removed files as a hero loses that hero on upgrade (the URL 404s and the page shows a broken image or empty video). jasonernst.com does: About uses /img/hero_rigolet.jpg, Research /img/aidecentralized.jpg, Writing /vid/redtree.mp4. Before deploying, upload those files to the site and point the pages at the new URLs. The files are in git history at main.

Testing

  • go test ./... passes; the install smoke test passes on SQLite (fresh install, pages seeded without heroes).
  • The upload button is not browser-tested. The endpoint and its response ({"filename": "/uploads/…"}) are the ones the settings page already uses.

🤖 Generated with Claude Code

goblog's image carried the original author's photos and two videos, the
default landing image was his photo, and a fresh install's Writing and
About pages used his video and photo as heroes. Six old page templates
(about, archives, posts, presentations, projects, tags) and their
handlers were never routed; three of them hardcoded his images and
about.html his biography.

- The default landing image is a neutral placeholder.
- Removed the photos and videos, the six templates and their handlers,
  and the seeded heroes.
- The page editor's hero field gets an upload button: it uploads through
  /api/v1/upload and fills in the URL and the type, so a hero no longer
  has to be a file someone put on the server by hand.

Closes #669.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 3, 2026 17:26
@codecov

codecov Bot commented Oct 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The new hero upload control hides its file input with display:none behind a non-focusable <label>, making it unreachable for keyboard-only users, unlike the codebase's existing visible file inputs.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

This PR removes the original author's personal media and dead templates/handlers from GoBlog, and adds a file-upload control for page heroes in the page editor. It closes #669 (follow-up to #657/#660), making a fresh install ship neutral, non-personal defaults and giving editors a way to set a hero by uploading a file instead of hand-typing a URL.

Changes:

  • Deleted eight personal media files plus six unrouted default-theme templates (about, archives, posts, presentations, projects, tags) and their never-registered Blog handlers; stopped seeding personal heroes on the Writing/About pages; and swapped www/img/profile.png for a neutral placeholder.
  • Added an "Upload a file…" control under the page editor's hero field that POSTs to /api/v1/upload and fills in the hero URL/type from the uploaded file.
  • Updated the theme-authoring doc to drop the paragraph describing the removed templates.
File Description
blog/​blog.go Removes the six unrouted handlers; shared helpers they used remain in use by page-type rendering.
tools/​migrate.go Stops seeding redtree.mp4/hero_rigolet.jpg heroes on the Writing/About default pages.
themes/​default/​templates/​admin_edit_page.html Adds the hero file-upload button, status text, and upload JS.
themes/​default/​templates/​{about,archives,posts,presentations,projects,tags}.html Deletes the unrouted templates carrying personal images/biography.
plugins/​docs/​content/​writing-a-theme.md Removes the now-obsolete paragraph about the deleted templates.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread themes/default/templates/admin_edit_page.html Outdated
The input was hidden behind a label, which keyboard users cannot reach.
It is now a normal file input like the settings page's, and the upload
status is announced to screen readers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@compscidr
compscidr merged commit a218287 into main Oct 3, 2026
5 checks passed
@compscidr
compscidr deleted the chore/neutral-images branch October 3, 2026 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bundled images are the author's own; about.html still holds the author's biography

2 participants