mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-24 07:30:12 +01:00
Fixed stay on same page for version selector (9.5.5 regression)
This commit is contained in:
parent
937d7ccff1
commit
ceacfe5a2c
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -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 %}
|
||||||
|
@ -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)
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user