mirror of
https://github.com/imfing/hextra.git
synced 2025-08-23 11:56:48 -04:00
feat(toc): add Table of Contents scroll highlighting (#738)
* feat(toc): add Table of Contents scroll highlighting - Introduced a new toc.css file for styling the Table of Contents with active link highlighting. - Implemented toc-scroll.js to manage scroll behavior and link activation based on viewport visibility. - Updated core.html to include the new JavaScript file and ensure proper loading of the Table of Contents functionality. * chore: lower root heading font weight for TOC * chore: run `task css` * chore: update dependencies in package.json and package-lock.json to version 4.1.11 for @tailwindcss/postcss and tailwindcss, and update @jridgewell packages to latest versions
This commit is contained in:
@@ -7,9 +7,10 @@
|
||||
{{- $jsFileTree := resources.Get "js/filetree.js" -}}
|
||||
{{- $jsSidebar := resources.Get "js/sidebar.js" -}}
|
||||
{{- $jsBackToTop := resources.Get "js/back-to-top.js" -}}
|
||||
{{- $jsTocScroll := resources.Get "js/toc-scroll.js" -}}
|
||||
{{- $jsFavicon := resources.Get "js/favicon.js" | resources.ExecuteAsTemplate "favicon.js" . -}}
|
||||
|
||||
{{- $scripts := slice $jsTheme $jsMenu $jsCodeCopy $jsTabs $jsLang $jsNavMenu $jsFileTree $jsSidebar $jsBackToTop $jsFavicon | resources.Concat "js/main.js" -}}
|
||||
{{- $scripts := slice $jsTheme $jsMenu $jsCodeCopy $jsTabs $jsLang $jsNavMenu $jsFileTree $jsSidebar $jsBackToTop $jsTocScroll $jsFavicon | resources.Concat "js/main.js" -}}
|
||||
{{- if hugo.IsProduction -}}
|
||||
{{- $scripts = $scripts | minify | fingerprint -}}
|
||||
{{- end -}}
|
||||
|
@@ -72,7 +72,7 @@
|
||||
{{- end -}}
|
||||
|
||||
{{- $padding := (mul $level 4) -}}
|
||||
{{- $class := cond (eq $level 0) "hx:font-semibold" (printf "hx:ltr:pl-%d hx:rtl:pr-%d" $padding $padding) -}}
|
||||
{{- $class := cond (eq $level 0) "hx:font-medium" (printf "hx:ltr:pl-%d hx:rtl:pr-%d" $padding $padding) -}}
|
||||
|
||||
{{- range $headings }}
|
||||
{{- if .Title }}
|
||||
|
Reference in New Issue
Block a user