From de322af49c5551c7cf8db52f400d6aa148021bf7 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Tue, 2 Aug 2022 14:14:44 +0100 Subject: [PATCH] Render HTML anchors for definition blocks It's handy to be able to link to these. --- assets/scss/custom.scss | 14 ++++---------- layouts/shortcodes/definition.html | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/assets/scss/custom.scss b/assets/scss/custom.scss index c1696f18..d3b014f1 100644 --- a/assets/scss/custom.scss +++ b/assets/scss/custom.scss @@ -165,16 +165,10 @@ footer { } -/* Adjust heading anchors for site header */ -.td-content { - &> h2, - &> h3, - &> h4, - &> h5, - &> h6, - .rendered-data h1 { - scroll-margin-top: 5rem; - } +/* Adjust the scroll margin for everything in the main content, so that + * it doesn't disappear behind the header bar */ +.td-content * { + scroll-margin-top: 5.5rem; } /* Styles for the table of contents */ diff --git a/layouts/shortcodes/definition.html b/layouts/shortcodes/definition.html index fdb307f7..02f2c6b0 100644 --- a/layouts/shortcodes/definition.html +++ b/layouts/shortcodes/definition.html @@ -30,7 +30,7 @@ {{ $definition = partial "json-schema/resolve-refs" (dict "schema" $definition "path" $path) }} {{ $definition = partial "json-schema/resolve-allof" $definition }} -
+