Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable headings in body text on document collections to appear in contents section #3507

Conversation

unoduetre
Copy link
Contributor

@unoduetre unoduetre commented Jan 9, 2025

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

Follow these steps if you are doing a Rails upgrade.

What

Investigate whether we can enable headings in the body text to be included in the contents section, and if possible make it happen.

Why

The 'Contents' section of a document collection page is created automatically from the 'groups' of documents on the page. That works fine the majority of the time.

However, sometimes departments need to also link to documents or webpages that are relevant, but hosted off GOV.UK.

Because Whitehall doesn't let them add such links off the GOV.UK domain to 'groups', they have to add these to the body content of a page in the conventional way, under headings.

However, the H2s in the body content of a collection page are not made part of the 'Contents' list. This means that the contents list doesn't properly reflect the structure of the webpage.

Having the contents list reflect all of the page's H2s would make the collection page template consistent with detailed guides and publications.

Examples

Trello card

This is for document collection.
@govuk-ci govuk-ci temporarily deployed to government-frontend-pr-3507 January 9, 2025 11:04 Inactive
@unoduetre unoduetre marked this pull request as ready for review January 9, 2025 13:25
Copy link
Contributor

@hannako hannako left a comment

Choose a reason for hiding this comment

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

Nice!

@unoduetre unoduetre merged commit 449d130 into main Jan 9, 2025
12 checks passed
@unoduetre unoduetre deleted the 3148-enable-headings-in-body-text-on-document-collections-to-appear-in-contents-section-m branch January 9, 2025 13:38
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