Skip to content

feat: Switch to pagefind component UI #837

Merged
therobrob merged 30 commits intomainfrom
feat/new-pagefind
Apr 14, 2026
Merged

feat: Switch to pagefind component UI #837
therobrob merged 30 commits intomainfrom
feat/new-pagefind

Conversation

@MoritzWeber0
Copy link
Copy Markdown
Member

@MoritzWeber0 MoritzWeber0 commented Apr 11, 2026

In pagefind v1.5.0, a completely new component UI library was added. While the old default UI remains supported, the recommendation is to switch to the new UI. It provides better accessibility, customization and has a modern touch. This is the implementation for the FIP Guide. It makes many things simpler, so I could remove a lot of custom code that was needed before for the same behavior.

It does also resolve #538: LKA is now listed as result and Schweiz is ranked as first result in the German search.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 11, 2026

Deploy Preview for fipguide ready!

Name Link
🔨 Latest commit cc1ba82
🔍 Latest deploy log https://app.netlify.com/projects/fipguide/deploys/69dde17179795a00089f0c6d
😎 Deploy Preview https://deploy-preview-837--fipguide.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@github-actions
Copy link
Copy Markdown

Hi there! 👋

Thank you for your contribution to the FIP Guide! 🚀
We appreciate your effort in making rail staff travel information more accessible. 🚄

Checklist before merging:

  • Added a description to the Pull Request
  • Checked the License of new pictures (non-commercial use without attribution)
  • Modified content in English
  • Modified content in German
  • Modified content in French

@MoritzWeber0 MoritzWeber0 marked this pull request as ready for review April 12, 2026 10:19
@MoritzWeber0 MoritzWeber0 requested a review from therobrob April 12, 2026 10:19
@therobrob therobrob added the technical Technical issues, e.g. related to Hugo, HTML, CSS, deployment, etc. label Apr 12, 2026
Copy link
Copy Markdown
Member

@therobrob therobrob left a comment

Choose a reason for hiding this comment

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

This pagefind-update is really cool! So we're getting rid of some custom code :)
I’ve left some thoughts in the comments. Further more:

  • the aria-label of the input element isn’t fitting: "Suche diese Seite" => "durchsuche diese Seite. We should overwrite it, what do you think?
  • the screenreader read out the # from the .pf-heading-chip elements (for example "Nummernzeichen Wissenswertes“). Could we hide it fore screenreaders?
  • does the pagefind version support an aria-live feature? I think we should announce the search results after typing in the search term.

Comment thread layouts/partials/head.html
Comment thread layouts/_default/home.html Outdated
Comment thread assets/sass/search.scss
Comment thread assets/sass/search.scss
Comment thread assets/sass/search.scss
@MoritzWeber0
Copy link
Copy Markdown
Member Author

This pagefind-update is really cool! So we're getting rid of some custom code :) I’ve left some thoughts in the comments. Further more:

  • the aria-label of the input element isn’t fitting: "Suche diese Seite" => "durchsuche diese Seite. We should overwrite it, what do you think?

There is already an open PR for it, I would just wait until it's merged: Pagefind/pagefind#1096

  • the screenreader read out the # from the .pf-heading-chip elements (for example "Nummernzeichen Wissenswertes“). Could we hide it fore screenreaders?

There was a way by overwriting the content of the ::before element, so it should be hidden now.

  • does the pagefind version support an aria-live feature? I think we should announce the search results after typing in the search term.

Looks like they don't want to implement it, at least that's the only comment I could find regarding to it: Pagefind/pagefind#162 (comment)

@MoritzWeber0
Copy link
Copy Markdown
Member Author

The comments should be addressed now :)

Copy link
Copy Markdown
Member

@therobrob therobrob left a comment

Choose a reason for hiding this comment

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

There are two little this left, i’d like to address.

Do you think the localization-issue on behalf of pagefind is solved soon? Otherwise we can merge this PR before and update pagefind later on :)

Regarding aria-live: my idea is to announce, that the search results changed, not what exactly changed in the search results. I understood the pagefind-MR to mean that aria live should announce all changed results. But we can leave this unaddressed for now, i think there is no serious violation. :)

Comment thread assets/js/search.js Outdated
Comment thread assets/sass/search.scss
@MoritzWeber0
Copy link
Copy Markdown
Member Author

Do you think the localization-issue on behalf of pagefind is solved soon? Otherwise we can merge this PR before and update pagefind later on :)

They are usually fast in merging PRs, so I would do it the way proposed: Merge this PR and then update pagefind once the new version is released.

Regarding aria-live: my idea is to announce, that the search results changed, not what exactly changed in the search results. I understood the pagefind-MR to mean that aria live should announce all changed results. But we can leave this unaddressed for now, i think there is no serious violation. :)

Makes sense to me, but sounds like a bit of effort, so feel free to track it as issue if you want :)

@MoritzWeber0
Copy link
Copy Markdown
Member Author

MoritzWeber0 commented Apr 13, 2026

Done, I also replaced the border with outline (like we do it for the teasers), otherwise there were cases with two borders / outlines.

EDIT: Now the border is gone, I'll fix it tomorrow morning.

@MoritzWeber0 MoritzWeber0 requested a review from therobrob April 14, 2026 07:27
Copy link
Copy Markdown
Member

@therobrob therobrob left a comment

Choose a reason for hiding this comment

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

Everything looks great now, thanks a lot! 🫶

@therobrob therobrob merged commit 20ebf36 into main Apr 14, 2026
7 checks passed
@therobrob therobrob deleted the feat/new-pagefind branch April 14, 2026 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

technical Technical issues, e.g. related to Hugo, HTML, CSS, deployment, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optimize search

2 participants