mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-12 01:50:52 +01:00
Added skip link component
This commit is contained in:
parent
dbb5b2e8c3
commit
66376bbe8c
@ -49,6 +49,7 @@ export type Component =
|
||||
| "search-query" /* Search input */
|
||||
| "search-reset" /* Search reset */
|
||||
| "search-result" /* Search results */
|
||||
| "skip" /* Skip link */
|
||||
| "tabs" /* Tabs */
|
||||
| "toc" /* Table of contents */
|
||||
|
||||
@ -115,6 +116,7 @@ export function setupComponents(
|
||||
/* Top-level components: update */
|
||||
case "header-title":
|
||||
case "container":
|
||||
case "skip":
|
||||
if (name in prev && typeof prev[name] !== "undefined") {
|
||||
prev[name]!.replaceWith(next[name]!)
|
||||
prev[name] = next[name]
|
||||
|
@ -205,7 +205,8 @@
|
||||
|
||||
<!-- Link to skip to content -->
|
||||
{% if page.toc | first is defined %}
|
||||
<a href="{{ (page.toc | first).url }}" class="md-skip">
|
||||
{% set skip = page.toc | first %}
|
||||
<a href="{{ skip.url | url }}" class="md-skip" data-md-component="skip">
|
||||
{{ lang.t('skip.link.title') }}
|
||||
</a>
|
||||
{% endif %}
|
||||
|
Loading…
Reference in New Issue
Block a user