Skip to content

Commit c6fb6ab

Browse files
committed
Fix the definition of the page filename
1 parent 612b7c7 commit c6fb6ab

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

_layouts/guides.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@
88
{% assign docversion = 'latest' %}
99
{% endif %}
1010
{% assign docversion_index = docversion | replace: '.', '-' %}
11-
{% assign page_filename = page.path | replace: '_guides/', '' %}
11+
{% comment %}
12+
'page.path' pattern is different depending on the version
13+
- "Main - SNAPSHOT" -> _versions/main/guides/*.adoc
14+
- "x.x.x - Latest" -> _guides/*.adoc
15+
=> to extract the page filename you need two different replacement tokens
16+
{% endcomment %}
17+
{% assign page_filename = page.path | replace: '_guides/', '' | replace: '_versions/main/guides/', '' %}
1218
{% assign relations = site.data.versioned[docversion_index].index.relations %}
1319
{% assign guide_url = page.url | replace_regex: '^/version/[^/]+(/.*)', '\1' %}
1420

0 commit comments

Comments
 (0)