1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-27 17:00:54 +01:00

Fixed versioning not working with anchors

This commit is contained in:
squidfunk 2022-09-07 19:46:26 +02:00
parent 4bd89f9fc3
commit d0f73018f5
4 changed files with 6 additions and 6 deletions

View File

@ -235,7 +235,7 @@
</script>
{% endblock %}
{% block scripts %}
<script src="{{ 'assets/javascripts/bundle.9c69f0bc.min.js' | url }}"></script>
<script src="{{ 'assets/javascripts/bundle.2ab50757.min.js' | url }}"></script>
{% for path in config["extra_javascript"] %}
<script src="{{ path | url }}"></script>
{% endfor %}

View File

@ -134,7 +134,7 @@ export function setupVersionSelector(
map(sitemap => {
const location = getLocation()
const path = location.href.replace(config.base, "")
return sitemap.includes(path)
return sitemap.includes(path.split("#")[0])
? new URL(`../${version}/${path}`, config.base)
: new URL(url)
})