Browse Source

head: Enable scrollspy support for fixed table of contents

George Cushen 7 năm trước cách đây
mục cha
commit
71feb4ed7e
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      layouts/partials/header.html

+ 1 - 1
layouts/partials/header.html

@@ -122,4 +122,4 @@
   <title>{{ if not .IsHome }}{{ .Title }} | {{ end }}{{ .Site.Title }}</title>
 
 </head>
-<body id="top" data-spy="scroll" data-target="#navbar-main" data-offset="71" {{ if not ($scr.Get "light") }}class="dark"{{ end }}>
+<body id="top" data-spy="scroll" data-target="{{ if or .IsHome .Params.widgets }}#navbar-main{{ else }}#toc{{ end }}" data-offset="71" {{ if not ($scr.Get "light") }}class="dark"{{ end }}>