Fixed stay on same page for version selector (9.5.5 regression)

This commit is contained in:
squidfunk 2024-05-12 14:20:39 +02:00
parent 937d7ccff1
commit ceacfe5a2c
No known key found for this signature in database
GPG Key ID: 5ED40BC4F9C436DF
4 changed files with 7 additions and 8 deletions

View File

@ -249,7 +249,7 @@
</script> </script>
{% endblock %} {% endblock %}
{% block scripts %} {% block scripts %}
<script src="{{ 'assets/javascripts/bundle.e2f4ecc1.min.js' | url }}"></script> <script src="{{ 'assets/javascripts/bundle.5cfa9459.min.js' | url }}"></script>
{% for script in config.extra_javascript %} {% for script in config.extra_javascript %}
{{ script | script_tag }} {{ script | script_tag }}
{% endfor %} {% endfor %}

View File

@ -128,14 +128,13 @@ export function setupVersionSelector(
return EMPTY return EMPTY
}), }),
switchMap(url => { switchMap(url => {
const { version } = urls.get(url)!
return fetchSitemap(new URL(url)) return fetchSitemap(new URL(url))
.pipe( .pipe(
map(sitemap => { map(sitemap => {
const location = getLocation() const location = getLocation()
const path = location.href.replace(config.base, "") const path = location.href.replace(config.base, url)
return sitemap.has(path.split("#")[0]) return sitemap.has(path.split("#")[0])
? new URL(`../${version}/${path}`, config.base) ? new URL(path)
: new URL(url) : new URL(url)
}) })
) )