pages/assets
Julian Wiest 729f136fb0
Add offset option to scrollspy initialization (#3354)
## Fix ToC Scroll-Spy Highlighting Issue

### Problem
When clicking on a ToC link in the sidebar, the page scrolls to the
correct section, but the ToC highlights the *previous* section instead
of the current one. The correct section only gets highlighted after
scrolling down a few pixels.

### Root Cause
The `scrollspy` in `assets/js/common.js` was initialized without an
offset parameter, so it didn't account for the fixed navigation header
height (~56px).

### Solution
Added `offset: 100` parameter to the scrollspy initialization to
properly detect when a section becomes visible, accounting for the
header and some buffer space.

### Changes
- Modified `assets/js/common.js`: Added offset parameter to scrollspy
configuration

### Testing
- [x] ToC correctly highlights the current section immediately after
clicking
- [x] Headings remain visible (not hidden under header)
- [x] Smooth scrolling works as expected

---------

Co-authored-by: Maruan <alshedivat@users.noreply.github.com>
2025-11-07 12:15:08 -08:00
..
audio Audio and Video support (#1367) 2023-05-15 12:31:27 -03:00
bibliography Issue 183 (#192) 2021-03-29 11:49:42 -04:00
css Moved socials config to _data/socials.yml (#2885) 2024-12-12 12:44:43 -03:00
fonts Moved socials config to _data/socials.yml (#2885) 2024-12-12 12:44:43 -03:00
html Add option for local HTML files (#2245) 2024-03-04 14:04:52 -03:00
img Add sidenote examples, related posts and giscus to distill posts (#3103) 2025-07-16 15:07:42 -03:00
js Add offset option to scrollspy initialization (#3354) 2025-11-07 12:15:08 -08:00
json Update work.liquid to show the location of work experience under cv … (#2349) 2024-04-17 15:17:43 -03:00
jupyter Added support for jupyter notebooks #417 (#1511) 2023-07-05 12:43:59 -03:00
pdf Include link and pdf in bib 2019-08-06 14:02:16 -04:00
plotly Add interactive plotly example to distill post (#1027) 2022-12-20 18:09:32 -05:00
video Added video tutorial to install instructions (#2653) 2024-08-22 13:49:05 -03:00
webfonts Update Font Awesome and Tabler Icons (#2884) 2024-12-11 15:19:38 -03:00