fix: derive public home link from request origin #220

Merged
erik merged 1 commit from fix/task-2aff6d58-settings-home-origin into main 2026-06-28 01:19:03 -05:00
Owner

Summary

  • Resolve the public site title/home link from the incoming request origin when the configured site URL is still the localhost template default.
  • Preserve localhost links for actual localhost development requests.
  • Apply the same request-aware site URL to RSS feed rendering and 404 pages.
  • Add regression coverage for production-style https://slugkit.com requests and localhost development behavior.

Verification

  • npm exec --workspace @slugkit/template-site -- vitest run --config ./vitest.config.ts src/routes/tests/public.test.ts
  • npm run typecheck --workspace @slugkit/template-site
  • npm run lint
  • ./scripts/pre-pr.sh

Task: #task-2aff6d58

## Summary - Resolve the public site title/home link from the incoming request origin when the configured site URL is still the localhost template default. - Preserve localhost links for actual localhost development requests. - Apply the same request-aware site URL to RSS feed rendering and 404 pages. - Add regression coverage for production-style `https://slugkit.com` requests and localhost development behavior. ## Verification - npm exec --workspace @slugkit/template-site -- vitest run --config ./vitest.config.ts src/routes/__tests__/public.test.ts - npm run typecheck --workspace @slugkit/template-site - npm run lint - ./scripts/pre-pr.sh Task: #task-2aff6d58
fix: derive public home link from request origin
All checks were successful
CI / build-lint-test (pull_request) Successful in 16m51s
9a54167bc3
Task: #task-2aff6d58
Author
Owner

Review summary

Approved.

Acceptance criteria

  • No settings/public navigation link in production points to http://localhost:3000 unless the actual request origin is localhost. Evidence: request-aware site URL resolution replaces the default localhost URL with the request origin for non-localhost requests, and tests assert https://slugkit.com output does not include href="http://localhost:3000".
  • slugkit.com settings menu title links to https://slugkit.com or the correct configured public origin. Evidence: the production-style test requests https://slugkit.com/ and asserts the site title link uses href="https://slugkit.com".
  • Tests cover production/public-origin behavior and local development behavior where practical. Evidence: public route tests cover both https://slugkit.com/ and http://localhost:3000/ behavior.

Blocking issues

  • None.

Warnings

  • None.

Verification reviewed

  • ./scripts/pre-pr.sh passed locally.
  • Forgejo CI run #304 passed.

Final verdict

Approved. Ready for human merge approval.

### Review summary Approved. ### Acceptance criteria - [x] No settings/public navigation link in production points to `http://localhost:3000` unless the actual request origin is localhost. Evidence: request-aware site URL resolution replaces the default localhost URL with the request origin for non-localhost requests, and tests assert `https://slugkit.com` output does not include `href="http://localhost:3000"`. - [x] slugkit.com settings menu title links to `https://slugkit.com` or the correct configured public origin. Evidence: the production-style test requests `https://slugkit.com/` and asserts the site title link uses `href="https://slugkit.com"`. - [x] Tests cover production/public-origin behavior and local development behavior where practical. Evidence: public route tests cover both `https://slugkit.com/` and `http://localhost:3000/` behavior. ### Blocking issues - None. ### Warnings - None. ### Verification reviewed - `./scripts/pre-pr.sh` passed locally. - Forgejo CI run #304 passed. ### Final verdict Approved. Ready for human merge approval.
erik merged commit caa4471d01 into main 2026-06-28 01:19:03 -05:00
erik deleted branch fix/task-2aff6d58-settings-home-origin 2026-06-28 01:19:03 -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!220
No description provided.