Add explicit banner URLs to posts #268

Merged
erik merged 4 commits from feat/task-6617767a-post-banner-url into main 2026-07-24 10:33:41 -05:00
Owner

Summary

Add an explicit nullable banner URL to post persistence and API contracts, use it for template previews and article details, and map article/link import banner metadata without modifying Markdown content.

Task

Task: #task-6617767a

Changes

  • Add migration 026_post_banner_url.sql and preserve camelCase bannerUrl across post create, update, list, and detail API operations.
  • Validate and document nullable banner URLs in API and OpenAPI contracts.
  • Upload local article banner files to self-hosted media and store the resulting absolute bannerUrl without prepending Markdown images.
  • Replace deterministic media objects and metadata on re-import so article banner imports are idempotent.
  • Map link banner_url frontmatter directly to bannerUrl without uploading remote media.
  • Render article banners on detail pages and render cards and HTML og:image/Twitter metadata from explicit post banners.
  • Simplify link preview cards and render quoted link commentary as blockquotes.
  • Add migration, API, CLI, media, template, and visual coverage.

Testing

  • Unit tests added/updated
  • Visual tests pass
  • Manual link and article imports succeed

Checklist

  • ./scripts/pre-pr.sh passes
  • Documentation updated
  • No unrelated changes included
## Summary Add an explicit nullable banner URL to post persistence and API contracts, use it for template previews and article details, and map article/link import banner metadata without modifying Markdown content. ## Task Task: #task-6617767a ## Changes - Add migration `026_post_banner_url.sql` and preserve camelCase `bannerUrl` across post create, update, list, and detail API operations. - Validate and document nullable banner URLs in API and OpenAPI contracts. - Upload local article `banner` files to self-hosted media and store the resulting absolute `bannerUrl` without prepending Markdown images. - Replace deterministic media objects and metadata on re-import so article banner imports are idempotent. - Map link `banner_url` frontmatter directly to `bannerUrl` without uploading remote media. - Render article banners on detail pages and render cards and HTML `og:image`/Twitter metadata from explicit post banners. - Simplify link preview cards and render quoted link commentary as blockquotes. - Add migration, API, CLI, media, template, and visual coverage. ## Testing - [x] Unit tests added/updated - [x] Visual tests pass - [x] Manual link and article imports succeed ## Checklist - [x] `./scripts/pre-pr.sh` passes - [x] Documentation updated - [x] No unrelated changes included
feat: add explicit post banner URLs
All checks were successful
CI / build-lint-test (pull_request) Successful in 2m58s
bc649e2f30
Task: #task-6617767a
Author
Owner

Review summary

The PR adds nullable post banner persistence and exposes it as the API's camelCase bannerUrl field consistently with existing API naming conventions. Article imports upload banners without changing Markdown content, link imports map og_image_url, and templates no longer infer preview images from Markdown or source images. Migration, API, CLI, route, OpenAPI, and visual coverage is present. Local pre-PR checks, 27 visual tests, and Forgejo CI pass.

Acceptance criteria

  • Met: Post records and API/OpenAPI contracts expose nullable banner URLs.
  • Met: Article imports upload banners into bannerUrl without inserting Markdown images.
  • Met: Link og_image_url frontmatter maps to bannerUrl.
  • Met: Create, update, list, show, and CLI output preserve banner URLs.
  • Met: Templates use explicit banner URLs instead of parsing Markdown images.
  • Met: Existing and newly created posts without banners return null and continue to render.
  • Met: Automated tests cover article, link, null, migration, and update behavior.

Blocking issues

  • None.

Warnings

  • None.

Verdict

Approved.

### Review summary The PR adds nullable post banner persistence and exposes it as the API's camelCase `bannerUrl` field consistently with existing API naming conventions. Article imports upload banners without changing Markdown content, link imports map `og_image_url`, and templates no longer infer preview images from Markdown or source images. Migration, API, CLI, route, OpenAPI, and visual coverage is present. Local pre-PR checks, 27 visual tests, and Forgejo CI pass. ### Acceptance criteria - **Met:** Post records and API/OpenAPI contracts expose nullable banner URLs. - **Met:** Article imports upload banners into `bannerUrl` without inserting Markdown images. - **Met:** Link `og_image_url` frontmatter maps to `bannerUrl`. - **Met:** Create, update, list, show, and CLI output preserve banner URLs. - **Met:** Templates use explicit banner URLs instead of parsing Markdown images. - **Met:** Existing and newly created posts without banners return `null` and continue to render. - **Met:** Automated tests cover article, link, null, migration, and update behavior. ### Blocking issues - None. ### Warnings - None. ### Verdict **Approved.**
fix: use banner URL import frontmatter
All checks were successful
CI / build-lint-test (pull_request) Successful in 2m7s
c10d397be9
Task: #task-6617767a
Author
Owner

Review summary

The corrected PR uses the established naming boundaries consistently: banner_url for persistence and link-import frontmatter, camelCase bannerUrl for TypeScript/API objects, --banner-url for CLI flags, and standard og:image/Twitter tags only in generated HTML. Article imports upload local banners to self-hosted media; link imports preserve remote banner URLs without uploading. Local pre-PR checks, 27 visual tests, manual re-import, and Forgejo CI pass.

Acceptance criteria

  • Met: Nullable API bannerUrl is backed by the banner_url database column and documented in OpenAPI.
  • Met: Article banners upload to self-hosted media without changing Markdown content.
  • Met: Link banner_url frontmatter maps directly to API bannerUrl.
  • Met: Create, update, list, and show preserve banner URLs.
  • Met: Templates use explicit bannerUrl rather than Markdown-image inference.
  • Met: Posts without banners continue with null values.
  • Met: HTML previews emit stored banners through standard preview meta tags.
  • Met: Migration, API, CLI, template, null, and update behavior is tested.

Blocking issues

  • None.

Warnings

  • None.

Verdict

Approved.

### Review summary The corrected PR uses the established naming boundaries consistently: `banner_url` for persistence and link-import frontmatter, camelCase `bannerUrl` for TypeScript/API objects, `--banner-url` for CLI flags, and standard `og:image`/Twitter tags only in generated HTML. Article imports upload local banners to self-hosted media; link imports preserve remote banner URLs without uploading. Local pre-PR checks, 27 visual tests, manual re-import, and Forgejo CI pass. ### Acceptance criteria - **Met:** Nullable API `bannerUrl` is backed by the `banner_url` database column and documented in OpenAPI. - **Met:** Article banners upload to self-hosted media without changing Markdown content. - **Met:** Link `banner_url` frontmatter maps directly to API `bannerUrl`. - **Met:** Create, update, list, and show preserve banner URLs. - **Met:** Templates use explicit `bannerUrl` rather than Markdown-image inference. - **Met:** Posts without banners continue with `null` values. - **Met:** HTML previews emit stored banners through standard preview meta tags. - **Met:** Migration, API, CLI, template, null, and update behavior is tested. ### Blocking issues - None. ### Warnings - None. ### Verdict **Approved.**
fix: make banner imports reusable
Some checks failed
CI / build-lint-test (pull_request) Has been cancelled
8f02a5710d
Resolve self-hosted media paths to absolute post banner URLs, replace deterministic media objects on re-import, and render article banners on detail pages. Also simplify link previews and support quoted link commentary discovered during manual import testing.\n\nTask: #task-6617767a
style: apply media test formatting
All checks were successful
CI / build-lint-test (pull_request) Successful in 2m6s
1a97eb0be2
Task: #task-6617767a
Author
Owner

Review summary

The final PR implements explicit post banners consistently across persistence, camelCase API contracts, CLI imports, and public templates. Follow-up import testing is addressed: self-hosted relative media paths become absolute post bannerUrl values, deterministic article banner uploads replace existing media records safely, article detail pages render explicit banners, and link previews no longer include redundant CTA copy. The separate comprehensive Markdown-parser replacement remains tracked in task-9ce89ffa rather than expanding this PR.

Acceptance criteria

  • Met: Nullable API bannerUrl is backed by the banner_url database column and documented in OpenAPI.
  • Met: Article banners upload to self-hosted media without changing Markdown content.
  • Met: Link banner_url frontmatter maps directly to API bannerUrl.
  • Met: Create, update, list, and show preserve banner URLs.
  • Met: Templates use explicit bannerUrl rather than Markdown-image inference.
  • Met: Posts without banners continue with null values.
  • Met: HTML previews emit stored banners through standard preview meta tags.
  • Met: Migration, API, CLI, media, template, null, update, and visual behavior is tested.

Verification

  • ./scripts/pre-pr.sh: passed
  • Visual tests: 27 passed
  • Forgejo CI: passed
  • Manual link and article imports: passed

Blocking issues

  • None.

Warnings

  • None.

Verdict

Approved.

### Review summary The final PR implements explicit post banners consistently across persistence, camelCase API contracts, CLI imports, and public templates. Follow-up import testing is addressed: self-hosted relative media paths become absolute post `bannerUrl` values, deterministic article banner uploads replace existing media records safely, article detail pages render explicit banners, and link previews no longer include redundant CTA copy. The separate comprehensive Markdown-parser replacement remains tracked in `task-9ce89ffa` rather than expanding this PR. ### Acceptance criteria - **Met:** Nullable API `bannerUrl` is backed by the `banner_url` database column and documented in OpenAPI. - **Met:** Article banners upload to self-hosted media without changing Markdown content. - **Met:** Link `banner_url` frontmatter maps directly to API `bannerUrl`. - **Met:** Create, update, list, and show preserve banner URLs. - **Met:** Templates use explicit `bannerUrl` rather than Markdown-image inference. - **Met:** Posts without banners continue with `null` values. - **Met:** HTML previews emit stored banners through standard preview meta tags. - **Met:** Migration, API, CLI, media, template, null, update, and visual behavior is tested. ### Verification - `./scripts/pre-pr.sh`: passed - Visual tests: 27 passed - Forgejo CI: passed - Manual link and article imports: passed ### Blocking issues - None. ### Warnings - None. ### Verdict **Approved.**
erik merged commit df0e59abc6 into main 2026-07-24 10:33:41 -05:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
erik/slugkit!268
No description provided.