瀏覽代碼

head: Enable scrollspy support for fixed table of contents

George Cushen 7 年之前
父節點
當前提交
71feb4ed7e
共有 1 個文件被更改,包括 1 次插入1 次删除
  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 }}>