Skip to content

Remove reader mode and hardcoded /go/ link stripping#24

Merged
arivictor merged 1 commit into
mainfrom
remove-reader-mode
Jun 10, 2026
Merged

Remove reader mode and hardcoded /go/ link stripping#24
arivictor merged 1 commit into
mainfrom
remove-reader-mode

Conversation

@arivictor

Copy link
Copy Markdown
Owner

What changed

Two cleanups of legacy, no-longer-needed behavior:

  1. Remove reader/focus mode feature (existing commit) — drops the reader/focus mode UI and supporting code.
  2. Remove hardcoded /go/ link prefix strippingnormalizeLinkTarget previously rewrote any markdown link starting with /go/ to /, a leftover from when the framework served a site rooted at /go/<topic>.

Why

The /go/ rewrite was a brittle, hardcoded special case. That site layout is no longer used, and the prefix silently broke any legitimate link to a top-level /go/... path. Absolute links are now passed through as-is.

Reviewer notes

  • The misleading comment on buildRoutePath in site_url.go was corrected (it never actually stripped go).
  • Tests updated accordingly; full suite passes.

🤖 Generated with Claude Code

The framework originally served a site rooted at /go/<topic>, so markdown
link normalization special-cased "/go/" by rewriting it to "/". That site
layout is no longer used, and the hardcoded prefix silently broke any
legitimate links to a top-level /go/ path. Treat absolute links as-is.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 10, 2026 01:04

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.

Pull request overview

This PR removes legacy URL-rewriting behavior and updates related documentation/tests so that absolute markdown links (including /go/...) are preserved as-is, reflecting the current site layout.

Changes:

  • Updated buildRoutePath comment and its unit test cases to match actual behavior (slug → absolute route, no special /go handling implied).
  • Removed the hardcoded /go/ prefix stripping from normalizeLinkTarget.
  • Adjusted markdown renderer tests to align with the new absolute-link preservation behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
site_url.go Corrects buildRoutePath comment to accurately describe slug→route behavior.
site_url_test.go Updates TestBuildRoutePath cases to match the function’s actual trimming/normalization behavior.
site_markdown.go Removes the special-case rewrite that stripped /go/ from absolute link targets.
site_markdown_test.go Updates renderer emphasis tests to use non-/go/ absolute links consistent with new normalization rules.
site_markdown_inline_test.go Updates normalizeLinkTarget expectations to ensure absolute /go/... paths are preserved.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@arivictor arivictor merged commit c1082c3 into main Jun 10, 2026
5 checks passed
@arivictor arivictor deleted the remove-reader-mode branch June 10, 2026 01:05
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.

2 participants