From 0f80eeae07f8583795523937cef535718b339cec Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Thu, 10 Oct 2024 12:28:21 +0200 Subject: [PATCH] site: automatically scroll down the sidebar to reveal the current page Some pages are nested quite deep in the sidebar, which means they aren't automatically visible on pageload unless the sidebar is scrolled. This commit adds a scrolldown function to the sidebar to check if the element representing the current page is in view. If it isn't, the sidebar is scrolled down to a position where the current page comes into view. Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com> --- layouts/_default/baseof.html | 17 ++++++++++++++++- layouts/partials/sidebar/sections.html | 5 +++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 1629ee6933..f75c74e73b 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -10,7 +10,22 @@ {{ partial "header.html" . }}
-