Skip to content

Listing page canonical urls - #459

Open
jhancock532 wants to merge 33 commits into
migration-2026from
feature/listing-page-canonical-urls
Open

jhancock532 wants to merge 33 commits into
migration-2026from
feature/listing-page-canonical-urls

Conversation

@jhancock532

@jhancock532 jhancock532 commented Sep 14, 2026

Copy link
Copy Markdown

Description

Listing pages now include a selected filter in their canonical URL when the visitor is looking at a page with one distinct filter value is selected. If none or multiple filter values are selected, the canonical points to the unfiltered listing page.

When pagination is present, the canonical contains only the current page parameter. This is because pagination is mainly used by Google's crawler to index the site & we don't need a page 2 of a filtered view in search results / Search Console.

This applies to BlogIndex, Work, and Events. Team page is ignored as the canonical URL is fine as is, confirmed with Beth.

How to Test

Run the branch locally at http://localhost:8000, then open the links below & look at the canonical URL in <head>.

Each page should contain exactly one canonical tag with the expected URL.

Scenario Reviewer link Expected canonical
No filters News http://localhost:8000/news/
One valid filter, plus tracking News: Charity & non-profit http://localhost:8000/news/?sector=charity-non-profit
Two valid filters News: sector and service http://localhost:8000/news/
Only pagination shown on page 2 News: filtered page 2 http://localhost:8000/news/?page=2
Work filter Work: Design http://localhost:8000/our-work/?service=design
Events filter Events: Webinar http://localhost:8000/events/?type=webinar
Two Events filters go back to the parent Events: past webinars http://localhost:8000/events/

Screenshots

Expand to see more image

MR Checklist

  • Add a description of your pull request and instructions for the reviewer to verify your work.
  • If your pull request is for a specific ticket, link to it in the description.
  • Stay on point and keep it small so the merge request can be easily reviewed.
  • Tests and linting passes.

Unit tests

  • Added
  • Not required

Documentation

Browser testing

  • Tested in Chromium with Playwright CLI on macOS
  • Not required

Data protection

  • Not relevant
  • This adds new sources of PII and documents it and modifies Birdbath processors accordingly

Light and dark mode

  • I have tested the changes in both light and dark mode
  • The change is not relevant to dark and light mode

Accessibility

  • Automated WCAG 2.1 tests pass
  • HTML validation passes
  • Manual WCAG 2.1 tests completed
  • I have tested in a screen reader
  • I have tested in high-contrast mode
  • Any animations removed for prefers-reduced-motion
  • Not required

Sustainability

  • Images are optimised and lazy-loading used where appropriate
  • SVGs have been optimised
  • Performance and transfer of data considered
  • If JavaScript is needed alternatives have been considered
  • Not required

Pattern library

  • The pattern library component for this template displays correctly, and does not break parent templates
  • The styleguide is updated if relevant
  • Changes are not relevant the pattern library

jhancock532 and others added 29 commits August 24, 2026 09:27
Reusable backend core for validating listing query params and building
the shared filter UI context, used by the blog, work and events listings.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Filter dropdowns, active-filter pills and the clear-all control shared by
the listing pages, plus the JS component and styles that drive them.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The slug is used as the value in event-filter URLs. Includes a factory
for test data.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Filters match both WorkPage and HistoricalWorkPage subtypes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Improve high contrast mode accessibility for submit button
- Remove excess comments
- Standardise use of SCSS styles for listing filters component
- Make focus styles for buttons consistent.
- Use data attribute instead of matching on details element
- Add comment reminder to update Jest markup
- Revert change moving minor duplicate code to shared component
@jhancock532
jhancock532 changed the base branch from main to migration-2026 September 14, 2026 14:34
@jhancock532 jhancock532 changed the title Draft: Llisting page canonical urls Listing page canonical urls Sep 16, 2026
@jhancock532
jhancock532 marked this pull request as ready for review September 16, 2026 15:04
@jhancock532

jhancock532 commented Sep 16, 2026

Copy link
Copy Markdown
Author

This MR is waiting on the listing filter MR to be merged to the migration branch; for review in the meantime, please see the following changes:

@jhancock532
jhancock532 force-pushed the feature/listing-page-canonical-urls branch from e4508a7 to ab9247c Compare September 16, 2026 15:07
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