Files
landing_page/qdrant-landing/themes/qdrant/layouts/partials/docs_sidebar.html
T
3215985d1d Improved Nested Docs and Link Grouping Support (#147)
* added a table of content

* wide layout for docs, styles for the table of content

* fixes for docs layout

* wide footer at the docs section

* added support for nested docs, added toggling groups of links, delimiters, external links

* external link icon

* added active state for nested links, styles for the external link icon

* styles fix

* remove doc sync

* update directory structure and doc titles

* fix outstanding links

* fix more links for merge

* Revert "fix more links for merge"

This reverts commit 46c9ccaf1b7765f2cda8dc85d625fa6b4e3f5436.

* Revert "fix outstanding links"

This reverts commit 28e6380b74f1ab74690c8184551f186656d6d4e9.

* fix remaining broken links

* move how-to tutorials in the different page

* split tutorials

* fix link

* upd github edit link

* skip empty index pages

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
Co-authored-by: David Sertic <62056091+davidmyriel@users.noreply.github.com>
2023-05-29 15:11:40 +02:00

101 lines
4.4 KiB
HTML

{{$currentNode := .}}
<nav class="documentation__sidebar-inner col-lg-2 col-md-3 col-12 pr-4 mb-4 position-relative">
{{ $subject := site.GetPage "documentation" }}
<div id="accordion" class="sticky-top documentation__sidebar-inner">
<!-- Button triggers search modal -->
<button type="button" class="qdr-search-input-btn w-100 mb-2 w-100" data-target="#searchModal">
<i class="fa fa-search mr-2"></i>Search...
</button>
<div class="documentation__sidebar-list">
{{ range $subject.Pages }}
{{ if (eq .Params.type "delimiter") }}
<h5 class="documentation__sidebar-delimiter">{{ .Title }}</h5>
{{ else }}
{{ if .IsPage }}
<div class="link-group {{ if eq .File.UniqueID $currentNode.File.UniqueID }}active {{ end }}">
<div class="link-group-heading">
<span class="mb-0">
<a class="btn btn-link text-left collapsed pl-0"
href="{{ if (eq .Params.type "external-link") }}{{ .Params.external_url }}{{ else }}{{ .Permalink }}{{ end }}"
{{ if (eq .Params.type "external-link") }}target="_blank"{{ end }}
>
{{ .Title }}
{{ if (eq .Params.type "external-link") }}
<i class="link-group__icon fas fa-external-link-alt"></i>
{{ end }}
</a>
</span>
</div>
</div>
{{ end }}
{{ if .IsSection }}
<!-- current page is active or any sub-page is active -->
{{ $isActive := false }}
{{ range .RegularPages }}
{{ if eq .File.UniqueID $currentNode.File.UniqueID }}
{{ $isActive = true }}
{{ end }}
{{ end }}
{{ if eq .File.UniqueID $currentNode.File.UniqueID }}
{{ $isActive = true }}
{{ end }}
{{ $sectionLink := .Permalink }}
{{ if .Params.is_empty }}
{{ $sectionLink = (index (.RegularPages) 0).Permalink }}
{{ end }}
<details class="documentation__sidebar-link-group link-group {{ if $isActive }}active {{ end }}"
{{ if $isActive }}open{{ end }}>
<summary class="link-group-heading">
<span class="mb-0">
<a class="btn btn-link text-left collapsed pl-0" href="{{ $sectionLink }}">
{{ .Title }}
</a>
</span>
</summary>
<div class="pl-4">
<nav id="TableOfContents">
<ul>
{{ range .RegularPages }}
{{ if (eq .Params.type "external-link") }}
<li>
<a href="{{ .Params.external_url }}" target="_blank">
{{ .Title }}
<i class="link-group__icon fas fa-external-link-alt"></i>
</a>
</li>
{{ else }}
<li class="{{ if eq .File.UniqueID $currentNode.File.UniqueID }}active {{ end }}"><a href="{{ .Permalink }}">{{ .Title }}</a></li>
{{ end }}
{{ end }}
</ul>
</nav>
</div>
</details>
{{ end }}
{{ end }}
{{ end }}
<br/>
<span class="d-inline-block mb-4">Docs version: {{ .Site.Params.docVersion }}</span>
</div>
</div>
</nav>