Skip to content

Fix select_top_level_html_files ignoring custom http_prefix#438

Open
inulty-dfe wants to merge 1 commit intoalphagov:mainfrom
inulty-dfe:main
Open

Fix select_top_level_html_files ignoring custom http_prefix#438
inulty-dfe wants to merge 1 commit intoalphagov:mainfrom
inulty-dfe:main

Conversation

@inulty-dfe
Copy link

@inulty-dfe inulty-dfe commented Feb 6, 2026

What’s changed

When we configure a custom http_prefix (e.g. /docs) to serve our tech docs site under a subpath, Middleman sets the parent URL of top-level pages to /docs/ rather than /.

select_top_level_html_files had the parent URL check hardcoded to "/", so it filtered out all our top-level pages — meaning the multi-page table of contents came back empty.

render_page_tree (in the same file) already handled this correctly by computing home_url from config[:http_prefix]. select_top_level_html_files just wasn't updated to match.

Here is where we've had to monkey patch the library

Identifying a user need

  The parent URL check was hardcoded to "/" so top-level pages were filtered out when http_prefix was set to a custom path.
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.

1 participant