Skip to content

Commit f4bb5bc

Browse files
committed
Merge #64 - fix: loop over forward slashes for relative dir, replace after urlencode
Pull-request: #64 Fixes: #63 Signed-off-by: William Desportes <williamdes@wdes.fr>
2 parents 272a026 + 120ef45 commit f4bb5bc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/Resources/themes/default/layout/layout.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
</a>
4040
<ul class="dropdown-menu">
4141
{% for version in project.versions -%}
42-
<li {{ version == project.version ? 'class="active"' : ''}}><a href="{{ path('../' ~ version|url_encode ~ '/index.html') }}" data-version="{{ version }}">{{ version.longname }}</a></li>
42+
<li {{ version == project.version ? 'class="active"' : ''}}><a href="{{ project.getBaseUrl()|replace({'%version%': version}) ~ '/index.html' }}" data-version="{{ version }}">{{ version.longname }}</a></li>
4343
{% endfor -%}
4444
</ul>
4545
</li>
@@ -69,7 +69,7 @@
6969
<select class="form-control" id="version-switcher" name="version">
7070
{% for version in project.versions %}
7171
<option
72-
value="{{ path('../' ~ version|url_encode ~ '/index.html') }}"
72+
value="{{ project.getBaseUrl()|replace({'%version%': version}) ~ '/index.html' }}"
7373
data-version="{{ version }}" {{ version == project.version ? 'selected' : ''}}>{{ version.longname }}</option>
7474
{% endfor %}
7575
</select>

0 commit comments

Comments
 (0)