Skip to content

Conversation

@Gowiem
Copy link
Member

@Gowiem Gowiem commented Dec 12, 2025

what

  • Header anchor links now only apply to blog posts, case studies, and standalone root-level pages
  • Removed anchor link styling from homepage sections and service pages to fix layout conflicts

why

  • The heading render hook was previously applying to all pages universally, causing styling issues on marketing pages like the homepage and services pages
  • By restricting anchor links to content-focused pages (blog, case studies, referrals, etc.), we maintain the useful deep-linking feature where it matters while preserving proper styling on layout-heavy pages

references

  • Fixes layout conflicts on homepage and service pages

Summary by CodeRabbit

  • Bug Fixes
    • Heading anchor links now render conditionally based on page type. Links appear on blog, case study, and root-level pages; other pages display plain heading text.

✏️ Tip: You can customize this high-level summary in your review settings.

…ne pages

The heading render hook was applying anchor link styling to all pages,
causing layout issues on the homepage and service pages. Now anchor
links only apply to blog posts, case studies, and standalone root-level
pages (like /referrals) where deep-linking is useful.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Gowiem Gowiem requested a review from a team as a code owner December 12, 2025 21:02
@netlify
Copy link

netlify bot commented Dec 12, 2025

Deploy Preview for masterpoint ready!

Name Link
🔨 Latest commit 24c9ae5
🔍 Latest deploy log https://app.netlify.com/projects/masterpoint/deploys/693c8678da2a3b00080342c0
😎 Deploy Preview https://deploy-preview-94--masterpoint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 32
Accessibility: 86
Best Practices: 92
SEO: 79
PWA: 70
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 12, 2025

Walkthrough

Modified the Hugo heading render hook to conditionally output anchor links. Anchor links now appear only on blog, case-studies, and root-level pages. Other pages render plain heading text without anchor wrappers, changing from unconditional to guarded rendering logic.

Changes

Cohort / File(s) Summary
Conditional heading anchor rendering
layouts/_default/_markup/render-heading.html
Added conditional logic to enable anchor links and wrappers only on blog, case-studies, or root-level pages; other pages render plain heading text without anchor markup

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify the page-type condition correctly identifies blog, case-studies, and root pages
  • Confirm plain heading output renders correctly on non-target page types
  • Check for any CSS/JavaScript dependencies expecting the anchor wrapper structure on those pages

Possibly related PRs

Suggested reviewers

  • gberenice
  • oycyc

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: restrict header anchor links scope' directly and clearly describes the main change: limiting header anchor links to specific page types, which is the core objective of the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch conductor/fix-header-links-scope

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.

@Gowiem Gowiem changed the title Restrict header anchor links scope fix: restrict header anchor links scope Dec 12, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
layouts/_default/_markup/render-heading.html (1)

7-8: Update the comment to reflect the full scope of anchor link application.

The comment states anchor links apply to "blog posts and case studies," but the code also enables them for root-level pages (line 18 checks eq .Page.Section ""). Align the summary comment with the actual implementation and the more detailed comment on line 17.

Apply this diff to clarify the scope:

-  Only applies to blog posts and case studies to avoid styling conflicts
-  on marketing pages (home, services, etc.).
+  Only applies to blog posts, case studies, and standalone root-level pages
+  to avoid styling conflicts on marketing pages (home, services, etc.).
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0b6f0d6 and bb69218.

📒 Files selected for processing (1)
  • layouts/_default/_markup/render-heading.html (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Redirect rules - masterpoint
  • GitHub Check: Header rules - masterpoint
  • GitHub Check: Pages changed - masterpoint
🔇 Additional comments (2)
layouts/_default/_markup/render-heading.html (2)

15-20: LGTM. The enable logic correctly restricts anchor links to the target sections.

The conditional check properly gates anchor links: blog posts, case studies, and root-level pages. The safe default (false) and OR logic are sound. Note that eq .Page.Section "" will enable anchors for all root-level pages, not just specific ones—if this needs to be narrower (e.g., only /referrals), you would need to add additional checks on the page path or a front-matter flag.

Verify that enabling anchors on all root-level pages (not just specific ones like /referrals) aligns with your intent.


22-31: Conditional rendering logic is correct and accessible.

Both branches properly render headings:

  • Anchor-enabled branch preserves semantics, accessibility (aria-label), and styling hooks (classes).
  • Plain heading branch retains the id attribute, allowing external deep-links to still work even without visible anchor link styling.

The use of | safeHTML filter is consistent and prevents XSS.

@Gowiem Gowiem enabled auto-merge (squash) December 12, 2025 21:17
@Gowiem Gowiem merged commit 113f8ed into master Dec 12, 2025
8 of 9 checks passed
@Gowiem Gowiem deleted the conductor/fix-header-links-scope branch December 12, 2025 21:18
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.

3 participants