mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fixed prev/next page keyboard navigation when footer is not present
This commit is contained in:
parent
26c08f1f38
commit
763423d30b
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -16,5 +16,5 @@
|
||||
{% endblock %}
|
||||
{% block scripts %}
|
||||
{{ super() }}
|
||||
<script src="{{ 'assets/javascripts/custom.0099a353.min.js' | url }}"></script>
|
||||
<script src="{{ 'assets/javascripts/custom.794c1817.min.js' | url }}"></script>
|
||||
{% endblock %}
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
8
material/assets/javascripts/bundle.94c06c99.min.js.map
Normal file
8
material/assets/javascripts/bundle.94c06c99.min.js.map
Normal file
File diff suppressed because one or more lines are too long
1
material/assets/stylesheets/extra.e437594a.min.css
vendored
Normal file
1
material/assets/stylesheets/extra.e437594a.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
material/assets/stylesheets/extra.e437594a.min.css.map
Normal file
1
material/assets/stylesheets/extra.e437594a.min.css.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -21,6 +21,12 @@
|
||||
{% if page.canonical_url %}
|
||||
<link rel="canonical" href="{{ page.canonical_url }}">
|
||||
{% endif %}
|
||||
{% if page.previous_page %}
|
||||
<link rel="prev" href="{{ page.previous_page.url | url }}">
|
||||
{% endif %}
|
||||
{% if page.next_page %}
|
||||
<link rel="next" href="{{ page.next_page.url | url }}">
|
||||
{% endif %}
|
||||
<link rel="icon" href="{{ config.theme.favicon | url }}">
|
||||
<meta name="generator" content="mkdocs-{{ mkdocs_version }}, mkdocs-material-9.0.0b4">
|
||||
{% endblock %}
|
||||
@ -234,13 +240,13 @@
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% block scripts %}
|
||||
<script src="{{ 'assets/javascripts/bundle.6d7e1051.min.js' | url }}"></script>
|
||||
<script src="{{ 'assets/javascripts/bundle.94c06c99.min.js' | url }}"></script>
|
||||
{% for path in config.extra_javascript %}
|
||||
<script src="{{ path | url }}"></script>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
{% if page.meta and page.meta.ᴴₒᴴₒᴴₒ %}
|
||||
<link rel="stylesheet" href="{{ 'assets/stylesheets/extra.e916454c.min.css' | url }}">
|
||||
<link rel="stylesheet" href="{{ 'assets/stylesheets/extra.e437594a.min.css' | url }}">
|
||||
<script src="{{ 'assets/javascripts/extra/bundle.cfb3feee.min.js' | url }}" defer></script>
|
||||
{% endif %}
|
||||
</body>
|
||||
|
@ -45,7 +45,7 @@ export function getLocation(): URL {
|
||||
*
|
||||
* @param url - URL to change to
|
||||
*/
|
||||
export function setLocation(url: URL): void {
|
||||
export function setLocation(url: URL | HTMLLinkElement): void {
|
||||
location.href = url.href
|
||||
}
|
||||
|
||||
|
@ -45,6 +45,7 @@ import {
|
||||
at,
|
||||
getOptionalElement,
|
||||
requestJSON,
|
||||
setLocation,
|
||||
setToggle,
|
||||
watchDocument,
|
||||
watchKeyboard,
|
||||
@ -173,17 +174,17 @@ keyboard$
|
||||
/* Go to previous page */
|
||||
case "p":
|
||||
case ",":
|
||||
const prev = getOptionalElement("[href][rel=prev]")
|
||||
const prev = getOptionalElement<HTMLLinkElement>("link[rel=prev]")
|
||||
if (typeof prev !== "undefined")
|
||||
prev.click()
|
||||
setLocation(prev)
|
||||
break
|
||||
|
||||
/* Go to next page */
|
||||
case "n":
|
||||
case ".":
|
||||
const next = getOptionalElement("[href][rel=next]")
|
||||
const next = getOptionalElement<HTMLLinkElement>("link[rel=next]")
|
||||
if (typeof next !== "undefined")
|
||||
next.click()
|
||||
setLocation(next)
|
||||
break
|
||||
}
|
||||
})
|
||||
|
@ -50,6 +50,16 @@
|
||||
<link rel="canonical" href="{{ page.canonical_url }}" />
|
||||
{% endif %}
|
||||
|
||||
<!-- Previous page -->
|
||||
{% if page.previous_page %}
|
||||
<link rel="prev" href="{{ page.previous_page.url | url }}" />
|
||||
{% endif %}
|
||||
|
||||
<!-- Next page -->
|
||||
{% if page.next_page %}
|
||||
<link rel="next" href="{{ page.next_page.url | url }}" />
|
||||
{% endif %}
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="icon" href="{{ config.theme.favicon | url }}" />
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user