Skip to content

Commit

Permalink
Merge pull request #2095 from marcelstoer/fix/page-filename
Browse files Browse the repository at this point in the history
Fix the definition of the page filename
  • Loading branch information
gsmet authored Aug 23, 2024
2 parents 612b7c7 + c6fb6ab commit e2d6356
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion _layouts/guides.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@
{% assign docversion = 'latest' %}
{% endif %}
{% assign docversion_index = docversion | replace: '.', '-' %}
{% assign page_filename = page.path | replace: '_guides/', '' %}
{% comment %}
'page.path' pattern is different depending on the version
- "Main - SNAPSHOT" -> _versions/main/guides/*.adoc
- "x.x.x - Latest" -> _guides/*.adoc
=> to extract the page filename you need two different replacement tokens
{% endcomment %}
{% assign page_filename = page.path | replace: '_guides/', '' | replace: '_versions/main/guides/', '' %}
{% assign relations = site.data.versioned[docversion_index].index.relations %}
{% assign guide_url = page.url | replace_regex: '^/version/[^/]+(/.*)', '\1' %}

Expand Down

0 comments on commit e2d6356

Please sign in to comment.