Преглед на файлове

fix: navbar active link highlighting and scrolling

Fixes edge case caused due to responsive navbar height. More
specifically, a possible race condition between Scrollspy init and
updating its offset.

Fix #1199
George Cushen преди 6 години
родител
ревизия
64cceae099
променени са 1 файла, в които са добавени 1 реда и са изтрити 2 реда
  1. 1 2
      layouts/_default/baseof.html

+ 1 - 2
layouts/_default/baseof.html

@@ -2,8 +2,7 @@
 <html lang="{{ site.LanguageCode | default "en-us" }}">
 
 {{ partial "site_head.html" . }}
-
-<body id="top" data-spy="scroll" data-target="{{ if or .IsHome (eq .Type "widget_page") }}#navbar-main{{else}}#TableOfContents{{end}}" {{ if not (.Scratch.Get "light") }}class="dark"{{end}}>
+<body id="top" data-spy="scroll" data-offset="70" data-target="{{ if or .IsHome (eq .Type "widget_page") }}#navbar-main{{else}}#TableOfContents{{end}}" {{ if not (.Scratch.Get "light") }}class="dark"{{end}}>
 
   {{ partial "search" . }}