govuk_tech_docs 6.6.0.1 → 6.6.0.2.rc

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b97846919bebddc9c222c552525fdf7286769036476e64077b43f7fee189aedd
4
- data.tar.gz: 427a3b22dc896b71d1d02e0c2491c0431d21fd17273b6b4f8f261c6ec96b0f8e
3
+ metadata.gz: d6e328084d2f13b8f8e68129ba49e81d665d6ec8f72ee36124744b3d59ee2746
4
+ data.tar.gz: 677f49e76228b855545387d892f598e99dab171faf26f4bb4b57fb334ad02d39
5
5
  SHA512:
6
- metadata.gz: f48fb912f823784fc1b9a965a61b2fe7b05ed4799c354f115fde41a49e3522457280a721d63918b8fdc3f2b9306a0e3b95c53b910f4cb12bd9eb8fbcfb6ca5cf
7
- data.tar.gz: 82eab075fa67f562a4654005d18eab35f2aa3223ea2e91b3b85415662fc941e7ea1836f1101d19106c730fae195a4d03f58db2d3d6bd09c0cfc40a5220ef0bfe
6
+ metadata.gz: 4e027b5f33816e9e0e892acb272bd70326d761fda26c3b3d92b7f56a085d5bebf81060e60d1bf31f12580c23dc5f1f87bb4c13ead563189f2c2650309c67f16c
7
+ data.tar.gz: 2df2a47ac7fc68b6231ff86abaef8c229c1ffac8bf9ef71980e6a1997f8d433492fa9ff6034f654f37288d04122c6c64a7b68596c5dcc7a25d7251acca262b12
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  ## Unreleased changes
2
2
 
3
+ ## 6.6.0.2.rc
4
+ - Fix missing top-level pages in multipage navigation when a custom `http_prefix` is configured ([issue 488](https://github.com/alphagov/tech-docs-gem/issues/488)).
5
+
3
6
  ## 6.6.0.1
4
7
 
5
8
  - Fix sticky TOC fighting page scroll: keep the active nav item visible by scrolling only the sidebar pane, not the window, so a long table of contents no longer blocks reaching the footer
@@ -30,14 +30,17 @@ module GovukTechDocs
30
30
  .to_a
31
31
  end
32
32
 
33
- def select_top_level_html_files(resources)
33
+ def select_top_level_html_files(resources, config = nil)
34
+ http_prefix = config&.[](:http_prefix).to_s
35
+ home_url = http_prefix.end_with?("/") ? http_prefix : "#{http_prefix}/"
36
+
34
37
  resources
35
- .select { |r| r.path.end_with?(".html") && (r.parent.nil? || r.parent.url == "/") }
38
+ .select { |r| r.path.end_with?(".html") && (r.parent.nil? || r.parent.url == home_url) }
36
39
  end
37
40
 
38
41
  def multi_page_table_of_contents(resources, current_page, config, current_page_html = nil, include_child_resources: true)
39
42
  resources = sort_resources_stably(
40
- select_top_level_html_files(resources),
43
+ select_top_level_html_files(resources, config),
41
44
  )
42
45
 
43
46
  render_page_tree(resources, current_page, config, current_page_html, include_child_resources:)
@@ -1,3 +1,3 @@
1
1
  module GovukTechDocs
2
- VERSION = "6.6.0.1".freeze
2
+ VERSION = "6.6.0.2.rc".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_tech_docs
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.6.0.1
4
+ version: 6.6.0.2.rc
5
5
  platform: ruby
6
6
  authors:
7
7
  - Government Digital Service