iceberg-theme/layouts/partials/sidebar.html (35 lines of code) (raw):

<!-- - Licensed to the Apache Software Foundation (ASF) under one or more--> <!-- - contributor license agreements. See the NOTICE file distributed with--> <!-- - this work for additional information regarding copyright ownership.--> <!-- - The ASF licenses this file to You under the Apache License, Version 2.0--> <!-- - (the "License"); you may not use this file except in compliance with--> <!-- - the License. You may obtain a copy of the License at--> <!-- - --> <!-- - http://www.apache.org/licenses/LICENSE-2.0--> <!-- - --> <!-- - Unless required by applicable law or agreed to in writing, software--> <!-- - distributed under the License is distributed on an "AS IS" BASIS,--> <!-- - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.--> <!-- - See the License for the specific language governing permissions and--> <!-- - limitations under the License.--> {{ if not .Params.disableSidebar }} <div class="sidebar markdown-body"> <div id="full"> <ul> {{ $currentPage := . }} <!-- `main` Menu --> {{ range .Site.Menus.main }} {{ $menuContainsCurrentPage := eq (lower .Name) $currentPage.Section}} {{ if .HasChildren }} <li> <!-- Use this line below if you want the active section in the sidebar to be highlighted--> <!-- <a id="{{ if $currentPage.HasMenuCurrent "main" . }}active{{ end }}" href="#">--> <a class="chevron-toggle {{if not (or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .)) }} collapsed{{end}}" data-toggle="collapse" data-parent="full" href="#{{ .Name }}"> <span>{{ .Name }}{{ .Post }}</span> <i class="fa fa-chevron-right"></i> <i class="fa fa-chevron-down"></i> </a> </li> <div id="{{ .Name }}" class="{{if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }}collapse in{{ else }}collapse{{end}}"> <ul class="sub-menu"> {{ range .Children }} <li> <a id="{{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }}" href="{{ if isset .Page.Params "external" }}{{ .Page.Params.external }}{{ else if isset .Page.Params "relurl" }}{{ $.Site.BaseURL }}{{ .Page.Params.relurl }}{{ else }}{{ .URL }}{{ end }}" {{ if isset .Page.Params "external" }}target="_blank"{{ end }}>{{ .Name }}</a> </li> {{ end }} </ul> </div> {{ else }} <li> <a id="{{ if eq $currentPage.Title .Name }}active{{ end }}" {{ if hasPrefix .Identifier "_" }}target="_blank"{{ end }} href="{{ if eq .Pre "relative" }}{{ $.Site.BaseURL }}{{ .URL }}{{ else }}{{ .URL }}{{ end }}"> <span>{{ .Name }}{{ .Post }}</span> </a> </li> {{ end }} {{ end }} {{ end }} </div> </div>