浏览代码

principles data

Heydon Pickering 8 年之前
父节点
当前提交
af3f0e8229
共有 3 个文件被更改,包括 41 次插入0 次删除
  1. 1 0
      config.toml
  2. 38 0
      themes/inclusive-docs/layouts/partials/header.html
  3. 2 0
      themes/inclusive-docs/theme.toml

+ 1 - 0
config.toml

@@ -2,3 +2,4 @@ languageCode = "en-us"
 title = "Inclusive Docs Demo"
 baseURL = "/"
 theme = "inclusive-docs"
+SectionPagesMenu = "main"

+ 38 - 0
themes/inclusive-docs/layouts/partials/header.html

@@ -15,3 +15,41 @@
     <title>{{ .Title }} | {{ .Site.Title }}</title>
   </head>
   <body>
+    <nav aria-label="library">
+      <div id="sidebar" class="nav-collapse">
+              <!-- sidebar menu start-->
+              <ul class="sidebar-menu">
+                {{ $currentNode := . }}
+                {{ range .Site.Menus.main }}
+                    {{ if .HasChildren }}
+
+                  <li class="sub-menu{{if $currentNode.HasMenuCurrent "main" . }} active{{end}}">
+                  <a href="javascript:;" class="">
+                      {{ .Pre }}
+                      <!--<i class="icon_desktop"></i>-->
+                      <span>{{ .Name }}</span>
+                      <span class="menu-arrow fa {{if $currentNode.HasMenuCurrent "main" . }}fa-angle-down{{else}}fa-angle-right{{end}}"></span>
+                  </a>
+                      <ul class="sub{{if $currentNode.HasMenuCurrent "main" . }} open{{end}}">
+                          {{ range .Children }}
+                          <li{{if $currentNode.IsMenuCurrent "main" . }} class="active"{{end}}><a href="{{.URL}}">{{ .Name }}</a> </li>
+                          {{ end }}
+                      </ul>
+                    {{else}}
+                      <li>
+                      <a class="" href="{{.URL}}">
+                          {{ .Pre }}
+                          <!--<i class="icon_house_alt"></i>-->
+                          <span>{{ .Name }}</span>
+                      </a>
+                    {{end}}
+                    </li>
+                {{end}}
+                  <li> <a href="https://github.com/spf13/hugo/issues" target="blank"><i class='fa fa-life-ring'></i> <span>Issues & Help</span></a> </li>
+                  {{ if .IsPage }}
+                  {{ $File := .File }}  {{with $File.Path }}<li><a href="https://github.com/spf13/hugo/edit/master/docs/content/{{ $File.Dir }}{{ $File.LogicalName }}" target="blank"><i class='fa fa-edit'></i> Refine this Page</a> </li>{{end}}
+                  {{ end }}
+              </ul>
+              <!-- sidebar menu end-->
+          </div>
+    </nav>

+ 2 - 0
themes/inclusive-docs/theme.toml

@@ -7,6 +7,8 @@ homepage = "https://www.paciellogroup.com/"
 tags = ["inclusive design", "accessibility"]
 min_version = 0.1
 
+SectionPagesMenu = "main"
+
 [author]
   name = "Heydon Pickering"
   homepage = "https://inclusive-components.design"