feat: add scroll spy to toc pages as an option (experimental)

This commit is contained in:
Henk Verlinde
2022-06-23 20:15:51 +02:00
parent 75d250b240
commit 8d833bd931
7 changed files with 37 additions and 16 deletions

View File

@ -12,7 +12,7 @@
{{ .Scratch.Set "class" .Type -}}
{{ .Scratch.Add "class" " list" -}}
{{ end -}}
<body class="{{ .Scratch.Get "class" }}">
<body class="{{ .Scratch.Get "class" }}"{{ if eq .Site.Params.options.scrollSpy true }} data-bs-spy="scroll" data-bs-target="#toc" data-bs-root-margin="0px 0px -90%" data-bs-smooth-scroll="true" tabindex="0"{{ end }}>
{{ partial "header/header.html" . }}
<div class="wrap container-{{ if .Site.Params.options.fullWidth }}fluid{{ else }}xxl{{ end }}" role="document">
<div class="content">