Skip to content

Commit

Permalink
Fixed stay on same page for version selector (9.5.5 regression)
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed May 12, 2024
1 parent 937d7cc commit ceacfe5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion material/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
</script>
{% endblock %}
{% 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 %}
{{ script | script_tag }}
{% endfor %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,13 @@ export function setupVersionSelector(
return EMPTY
}),
switchMap(url => {
const { version } = urls.get(url)!
return fetchSitemap(new URL(url))
.pipe(
map(sitemap => {
const location = getLocation()
const path = location.href.replace(config.base, "")
const path = location.href.replace(config.base, url)
return sitemap.has(path.split("#")[0])
? new URL(`../${version}/${path}`, config.base)
? new URL(path)
: new URL(url)
})
)
Expand Down

0 comments on commit ceacfe5

Please sign in to comment.