Files
landing_page/qdrant-landing/themes/qdrant-2024/layouts/partials/table-of-contents.html
T
nastyapashandgenerall d758ddcb81 Add Course page (#1844)
* Add Course page

* Added shortcodes and buttons to navigate to the next page

* move course images from layout

* decouple documentation and course layout

* decouple course sidebar

* move accordion js handlers into global unconditional js

* enable search on courses

* allow nested courses

* disable links for now

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-08-14 22:42:19 +02:00

63 lines
2.3 KiB
HTML

{{ if not .Params.hideTOC }}
{{ if gt (.TableOfContents | len) 34 }}
<div class="table-of-contents">
<p class="table-of-contents__head">On this page:</p>
{{ $tocStartLevel := .Params.toc_start_level }}
{{ if not $tocStartLevel }}
{{ $tocStartLevel = default 1 $.Parent.Params.toc_start_level }}
{{ end }}
{{ $tocEndLevel := default 3 .Params.toc_end_level }}
{{ $tocOrdered := false }}
{{ .Fragments.ToHTML $tocStartLevel $tocEndLevel $tocOrdered | safeHTML }}
{{ if eq .Section "course" }}
{{ $subject := . }}
{{ if and $subject.Params $subject.Params.content $subject.Params.content.getStarted }}
<a
href="{{ $subject.Params.content.getStarted.url }}"
class="table-of-contents__button button button_contained button_sm"
>
{{ $subject.Params.content.getStarted.text }}
</a>
{{ end }}
{{ else }}
<ul class="table-of-contents__external-links">
{{ if or (eq .Section "documentation") (eq .Section "articles") }}
<li class="table-of-contents__link">
<a href="{{ .Site.Params.githubDocPrefix }}{{ path.Clean .File.Path }}" target="_blank">
{{ partial "svg" "github.svg" }}
Edit on Github
</a>
</li>
<li class="table-of-contents__link">
<a href="{{ .Site.Params.githubIssueLink }}" target="_blank">
{{ partial "svg" "bug.svg" }}
Create an issue
</a>
</li>
{{ end }}
{{ if eq .Section "blog" }}
{{ $link := urlquery .Permalink }}
{{ $title := .Title }}
{{ with (.Site.GetPage "/headless/share-buttons") }}
{{ range .Params.buttons }}
{{ $url := .url | replaceRE "\\{\\{\\s*\\$link\\s*\\}\\}" $link | replaceRE "\\{\\{\\s*\\$title\\s*\\}\\}" $title }}
<li class="table-of-contents__link">
<a href="{{ $url }}" target="_blank" rel="noopener noreferrer" title="{{ .title }}">
{{ .icon | safeHTML }}
{{ .subtitle }}
</a>
</li>
{{ end }}
{{ end }}
{{ end }}
</ul>
{{ end }}
</div>
{{ end }}
{{ end }}