Skip to content

Commit

Permalink
Take into account new indexes in guide's version selector
Browse files Browse the repository at this point in the history
  • Loading branch information
gsmet committed Sep 6, 2023
1 parent a7e7d97 commit 7b60fe9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions _layouts/guides.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,23 @@
<div class="guidepulldown version">
<select id="guide-version-dropdown">
{% for version in site.data.versions.documentation -%}
{% assign data_source = "guides-" | append: version | replace: '.', '-' %}
{% assign legacy_data_source = "guides-" | append: version | replace: '.', '-' %}
{% assign guide_present_in_version = false %}
{% for item in site.data[data_source].categories -%}
{% for item in site.data[legacy_data_source].categories -%}
{% for guide in item.guides -%}
{% if guide.url == guide_url -%}
{% assign guide_present_in_version = true %}
{% endif -%}
{% endfor -%}
{% endfor -%}
{% assign data_source = version | replace: '.', '-' %}
{% for type in site.data.versioned[data_source].index.quarkus.types -%}
{% for guide in type[1] -%}
{% if guide.url == guide_url -%}
{% assign guide_present_in_version = true %}
{% endif -%}
{% endfor -%}
{% endfor -%}
{% if guide_present_in_version or docversion == version -%}
<option value="{{ version }}" {% if docversion == version %}selected{% endif %}>{% if version == 'latest' %}{{ site.data.versions.quarkus.version | replace_regex: "\.[0-9+]\.Final", "" }} - {% endif %}{{ version | capitalize }}{% if version == 'main' %} - SNAPSHOT{% endif %}</option>
{% endif -%}
Expand Down

0 comments on commit 7b60fe9

Please sign in to comment.