Skip to content

Commit e031a4b

Browse files
committed
Replace loop over all documentation with lookup
We should know the key to look up from the version Signed-off-by: Robert Young <[email protected]>
1 parent 3192590 commit e031a4b

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

_layouts/released-documentation.html

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
{%- else -%}
88
{%- assign version = page.url | split: "/" | slice: -1 | first -%}
99
{%- endif -%}
10+
{%- assign underscored_version = version | replace: '.', '_' -%}
1011
<div class="row align-items-start justify-content-center my-5">
1112
<div class="col-lg-3 mb-5" role="complementary" aria-labelledby="page-title">
1213
<div class="card shadow px-2 mx-2">
@@ -35,17 +36,15 @@ <h1 id="page-title" class="fs-3">{{ version }} Documentation</h1>
3536
</div>
3637
<div class="col-lg-6" role="main">
3738
<div class="row row-cols-1 row-cols-md-2 g-4">
38-
{%- for docSet in site.data.documentation | sort: "rank" -%}
39-
{%- assign docSetVersion = docSet[0] | replace: '_', '.' -%}
40-
{%- if docSetVersion == version -%}
41-
{%- for doc in docSet[1].docs -%}
39+
{%- assign docs_for_release = site.data.documentation[underscored_version].docs | sort: "rank" -%}
40+
{%- for doc in docs_for_release -%}
4241
{%- assign first1 = doc.path | slice: 0, 1 -%}
4342
{%- assign first7 = doc.path | slice: 0, 7 -%}
4443
{%- assign first8 = doc.path | slice: 0, 8 -%}
4544
{%- if first7 == 'http://' or first8 == 'https://' or first1 == '/' -%}
4645
{%- assign pathPrefix = "" -%}
4746
{%- else -%}
48-
{%- assign pathPrefix = "/documentation/" | append: {{version}} | append: "/" -%}
47+
{%- assign pathPrefix = "/documentation/" | append: version | append: "/" -%}
4948
{%- endif -%}
5049
<div class="col">
5150
<div class="card shadow mb-2 h-100 mx-2 {%- for tag in doc.tags %} doctag-{{tag}}{%- endfor -%}">
@@ -57,8 +56,6 @@ <h2 class="card-title fs-4"><a href='{{ pathPrefix }}{{ doc.path | replace: "$(V
5756
</div>
5857
</div>
5958
</div>
60-
{%- endfor -%}
61-
{%- endif -%}
6259
{%- endfor -%}
6360
</div>
6461
</div>

0 commit comments

Comments
 (0)