From 66376bbe8c2a3567fc7b1e8dda1b4bab081c88a5 Mon Sep 17 00:00:00 2001 From: squidfunk Date: Wed, 4 Mar 2020 21:44:22 +0100 Subject: [PATCH] Added skip link component --- src/assets/javascripts/components/_/index.ts | 2 ++ src/base.html | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/assets/javascripts/components/_/index.ts b/src/assets/javascripts/components/_/index.ts index 3893b653c..31c3b9fda 100644 --- a/src/assets/javascripts/components/_/index.ts +++ b/src/assets/javascripts/components/_/index.ts @@ -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] diff --git a/src/base.html b/src/base.html index d27fd4dbc..789d7d05d 100644 --- a/src/base.html +++ b/src/base.html @@ -205,7 +205,8 @@ {% if page.toc | first is defined %} - + {% set skip = page.toc | first %} + {{ lang.t('skip.link.title') }} {% endif %}