diff --git a/lib/govuk_tech_docs/table_of_contents/helpers.rb b/lib/govuk_tech_docs/table_of_contents/helpers.rb index d05e8ed1..3605312c 100644 --- a/lib/govuk_tech_docs/table_of_contents/helpers.rb +++ b/lib/govuk_tech_docs/table_of_contents/helpers.rb @@ -55,22 +55,18 @@ def render_page_tree(resources, current_page, config, current_page_html) # prefix in to consideration when checking for the root index.html. # The prefix may be set with or without a trailing slash: make sure # it has one for this comparison check. - home_url = - if config[:http_prefix].end_with?("/") - config[:http_prefix] - else - config[:http_prefix] + "/" - end + home_url = config[:http_prefix].end_with?("/") ? config[:http_prefix] : config[:http_prefix] + "/" + resource_url = config[:tech_docs][:path_prefix] ? config[:tech_docs][:path_prefix] + resource.url : resource.url - if resource.children.any? && resource.url != home_url - output += %{