Skip to content

Fix relative links#52

Merged
samdark merged 1 commit into
masterfrom
fix-inline-tag-link-roots
Jun 7, 2026
Merged

Fix relative links#52
samdark merged 1 commit into
masterfrom
fix-inline-tag-link-roots

Conversation

@samdark

@samdark samdark commented Jun 7, 2026

Copy link
Copy Markdown
Member

Summary

  • pass the current page root path into root-path-aware content processors during entry rendering
  • make inline hashtag links use the rendered page depth instead of always linking from domain root
  • include permalink in entry render cache context so cached HTML respects page-relative links

Tests

  • make test
  • make test tests/Unit/Build/EntryRendererTest.php tests/Unit/Processor/TagLinkProcessorTest.php
  • make psalm
  • make composer-dependency-analyser

Copilot AI review requested due to automatic review settings June 7, 2026 07:56
@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@samdark, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 11 minutes and 36 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4e311869-2483-4805-960a-e150bd57790e

📥 Commits

Reviewing files that changed from the base of the PR and between f190acc and 1ca336c.

📒 Files selected for processing (39)
  • config/common/di/content-pipeline.php
  • docs/deployment.md
  • docs/templates.md
  • psalm-baseline.xml
  • src/Build/Asset.php
  • src/Build/AuthorPageWriter.php
  • src/Build/CollectionListingWriter.php
  • src/Build/DateArchiveWriter.php
  • src/Build/EntryRenderer.php
  • src/Build/FeedGenerator.php
  • src/Build/MetaTagsBuilder.php
  • src/Build/NotFoundPageWriter.php
  • src/Build/PageActionUrlFormatter.php
  • src/Build/PublicUrlResolver.php
  • src/Build/RedirectPageWriter.php
  • src/Build/RelativePathHelper.php
  • src/Build/RobotsTxtGenerator.php
  • src/Build/SitemapGenerator.php
  • src/Build/TaxonomyPageWriter.php
  • src/Build/TemplateHelpers.php
  • src/Build/UrlResolver.php
  • src/Content/CrossReferenceResolver.php
  • src/Processor/ContentProcessorPipeline.php
  • src/Processor/RootPathAwareProcessorInterface.php
  • src/Processor/TagLinkProcessor.php
  • src/Render/NavigationRenderer.php
  • tests/Unit/Build/EntryRendererTest.php
  • tests/Unit/Build/FeedGeneratorTest.php
  • tests/Unit/Build/PublicUrlResolverTest.php
  • tests/Unit/Console/BuildCommandTest.php
  • themes/minimal/archive_index.php
  • themes/minimal/archive_monthly.php
  • themes/minimal/archive_yearly.php
  • themes/minimal/collection_listing.php
  • themes/minimal/entry.php
  • themes/minimal/errors/404.php
  • themes/minimal/partials/head.php
  • themes/minimal/partials/header.php
  • themes/minimal/taxonomy_index.php
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-inline-tag-link-roots

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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 pull request fixes incorrect inline hashtag (#tag) links when rendering entries under nested permalinks by making tag-link generation root-path-aware and ensuring rendered HTML cache keys vary by permalink.

Changes:

  • Pass a computed page rootPath (based on the rendered permalink depth) into the content processing pipeline during entry rendering.
  • Make TagLinkProcessor root-path-aware so inline hashtag links become page-relative (e.g., ../../tags/php/) instead of always /tags/php/.
  • Include permalink in the entry render cache context to prevent cached HTML from containing incorrect page-relative links.

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
tests/Unit/Build/EntryRendererTest.php Adds coverage ensuring inline tag links use the current page’s computed root path for nested permalinks.
src/Processor/TagLinkProcessor.php Implements root-path awareness so generated tag URLs respect the current rendered page depth.
src/Processor/RootPathAwareProcessorInterface.php Introduces an interface for processors that need a per-render root path context.
src/Processor/ContentProcessorPipeline.php Extends the pipeline to optionally apply a root path to root-path-aware processors before processing.
src/Build/EntryRenderer.php Computes rootPath from permalink, passes it into processing, and adds permalink to cache context.

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

@samdark samdark force-pushed the fix-inline-tag-link-roots branch from 554a9eb to 25c8bc8 Compare June 7, 2026 08:15
@samdark samdark changed the title Fix inline tag links for nested pages Fix relative links Jun 7, 2026
@samdark samdark force-pushed the fix-inline-tag-link-roots branch from 25c8bc8 to 1ca336c Compare June 7, 2026 08:39
@samdark samdark merged commit d9635fc into master Jun 7, 2026
7 checks passed
@samdark samdark deleted the fix-inline-tag-link-roots branch June 7, 2026 08:48
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