Skip to content

Set data-pagefind-ignore on heading anchor accessibility text #3675

Merged
delucis merged 5 commits intowithastro:mainfrom
controversial:luke/pagefind-ignore-heading-anchors
Jan 29, 2026
Merged

Set data-pagefind-ignore on heading anchor accessibility text #3675
delucis merged 5 commits intowithastro:mainfrom
controversial:luke/pagefind-ignore-heading-anchors

Conversation

@controversial
Copy link
Copy Markdown
Contributor

@controversial controversial commented Jan 28, 2026

Description

Closes #3676

Heading anchors include sr-only text like ‘Section titled “x”‘ as an affordance for screen readers to interact with the anchor links.

Since this content is visible to pagefind, this causes a lot of strange search results, especially when your search matches text in a heading:

Screenshot 2026-01-28 at 5 25 19 PM

In this PR, we add data-pagefind-ignore to the screen-reader-only text, which makes search results read as normal.

Before and after:

Screenshot 2026-01-28 at 5 19 27 PM Screenshot 2026-01-28 at 5 19 37 PM

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jan 28, 2026

🦋 Changeset detected

Latest commit: e64bcb3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@astrojs/starlight Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify
Copy link
Copy Markdown

netlify bot commented Jan 28, 2026

Deploy Preview for astro-starlight ready!

Name Link
🔨 Latest commit e64bcb3
🔍 Latest deploy log https://app.netlify.com/projects/astro-starlight/deploys/697b60b698363f000824928f
😎 Deploy Preview https://deploy-preview-3675--astro-starlight.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: 100 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

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

@github-actions github-actions bot added the 🌟 core Changes to Starlight’s main package label Jan 28, 2026
@delucis delucis added the 🌟 patch Change that triggers a patch release label Jan 29, 2026
Copy link
Copy Markdown
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

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

Great catch! Thanks for the fix @controversial 🚀

@delucis delucis merged commit 0ba556d into withastro:main Jan 29, 2026
17 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Jan 29, 2026
dadezzz pushed a commit to dadezzz/ice-notes that referenced this pull request Feb 7, 2026
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [@astrojs/starlight](https://starlight.astro.build) ([source](https://github.com/withastro/starlight/tree/HEAD/packages/starlight)) | [`0.37.4` → `0.37.6`](https://renovatebot.com/diffs/npm/@astrojs%2fstarlight/0.37.4/0.37.6) | ![age](https://developer.mend.io/api/mc/badges/age/npm/@astrojs%2fstarlight/0.37.6?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@astrojs%2fstarlight/0.37.4/0.37.6?slim=true) |

---

### Release Notes

<details>
<summary>withastro/starlight (@&#8203;astrojs/starlight)</summary>

### [`v0.37.6`](https://github.com/withastro/starlight/blob/HEAD/packages/starlight/CHANGELOG.md#0376)

[Compare Source](https://github.com/withastro/starlight/compare/@astrojs/starlight@0.37.5...@astrojs/starlight@0.37.6)

##### Patch Changes

- [#&#8203;3645](withastro/starlight#3645) [`a562096`](withastro/starlight@a562096) Thanks [@&#8203;mschoeffmann](https://github.com/mschoeffmann)! - Adds icons for Chrome, Edge, Firefox, and Safari

### [`v0.37.5`](https://github.com/withastro/starlight/blob/HEAD/packages/starlight/CHANGELOG.md#0375)

[Compare Source](https://github.com/withastro/starlight/compare/@astrojs/starlight@0.37.4...@astrojs/starlight@0.37.5)

##### Patch Changes

- [#&#8203;3675](withastro/starlight#3675) [`0ba556d`](withastro/starlight@0ba556d) Thanks [@&#8203;controversial](https://github.com/controversial)! - Excludes the accessible labels for heading anchor links from Pagefind results

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi45Mi4xMiIsInVwZGF0ZWRJblZlciI6IjQyLjkyLjEyIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: Renovate Bot <renovate@zarantonello.dev>
Co-committed-by: Renovate Bot <renovate@zarantonello.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🌟 core Changes to Starlight’s main package 🌟 patch Change that triggers a patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pagefind results include invisible duplicated “section titled ____” text

2 participants