mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-02 01:18:30 +02:00
Updated Articles Pages (#1329)
* Updated Articles Pages * fixes * Links removed * Fixed url * light theme fix * toc fix * new article categories * categorize articles * fix article preview images * rename categories --------- Co-authored-by: trean <trean.mi@gmail.com> Co-authored-by: generall <andrey@vasnetsov.com>
This commit is contained in:
co-authored by
trean
generall
parent
481b359860
commit
5baacc44ec
+94
-71
@@ -1,4 +1,5 @@
|
||||
{{ $partition := .partition }}
|
||||
{{ $section := .Section }}
|
||||
|
||||
{{ $currentNode := .context }}
|
||||
<div class="docs-menu">
|
||||
@@ -18,93 +19,115 @@
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{{ $subject := site.GetPage "documentation" }}
|
||||
{{ if eq $currentNode.Section "documentation" }}
|
||||
{{ $subject := site.GetPage "documentation" }}
|
||||
|
||||
|
||||
<nav class="docs-menu__links">
|
||||
{{ range $subject.Pages }}
|
||||
{{ if and (eq .Params.partition $partition) (not .Params.hideInSidebar) }}
|
||||
{{ if (eq .Params.type "delimiter") }}
|
||||
<h3 class="docs-menu__links-title">{{ .Title }}</h3>
|
||||
{{ else }}
|
||||
{{ if and (.IsPage) (not .Params.hideInSidebar) }}
|
||||
<div
|
||||
class="docs-menu__links-group {{ if eq .File.UniqueID $currentNode.File.UniqueID }}active{{ end }}
|
||||
{{- if (eq .Params.type "external-link") }}external-link{{ end -}} "
|
||||
>
|
||||
<div class="docs-menu__links-group-heading">
|
||||
<a
|
||||
href="{{ if (eq .Params.type "external-link") }}
|
||||
{{ .Params.external_url }}
|
||||
{{ else }}
|
||||
{{ .Permalink }}
|
||||
{{ end }}"
|
||||
{{ if (eq .Params.type "external-link") }}target="_blank"{{ end }}
|
||||
>
|
||||
{{ .Title }}
|
||||
</a>
|
||||
<nav class="docs-menu__links">
|
||||
{{ range $subject.Pages }}
|
||||
{{ if and (eq .Params.partition $partition) (not .Params.hideInSidebar) }}
|
||||
{{ if (eq .Params.type "delimiter") }}
|
||||
<h3 class="docs-menu__links-title">{{ .Title }}</h3>
|
||||
{{ else }}
|
||||
{{ if and (.IsPage) (not .Params.hideInSidebar) }}
|
||||
<div
|
||||
class="docs-menu__links-group {{ if eq .File.UniqueID $currentNode.File.UniqueID }}active{{ end }}
|
||||
{{- if (eq .Params.type "external-link") }}external-link{{ end -}} "
|
||||
>
|
||||
<div class="docs-menu__links-group-heading">
|
||||
<a
|
||||
href="{{ if (eq .Params.type "external-link") }}
|
||||
{{ .Params.external_url }}
|
||||
{{ else }}
|
||||
{{ .Permalink }}
|
||||
{{ end }}"
|
||||
{{ if (eq .Params.type "external-link") }}target="_blank"{{ end }}
|
||||
>
|
||||
{{ .Title }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if and (.IsSection) (not .Params.hideInSidebar) }}
|
||||
{{ if and (.IsSection) (not .Params.hideInSidebar) }}
|
||||
|
||||
<!-- 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 }}
|
||||
|
||||
<!-- 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 }}
|
||||
|
||||
{{ $sectionLink := .Permalink }}
|
||||
|
||||
{{ if .Params.is_empty }}
|
||||
{{ $sectionLink = (index (.RegularPages) 0).Permalink }}
|
||||
{{ end }}
|
||||
{{ if .Params.is_empty }}
|
||||
{{ $sectionLink = (index (.RegularPages) 0).Permalink }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
<details
|
||||
class="docs-menu__links-group link-group {{ if $isActive }}active{{ end }}"
|
||||
{{ if $isActive }}open{{ end }}
|
||||
>
|
||||
<summary class="docs-menu__links-group-heading">
|
||||
<a href="{{ $sectionLink }}">
|
||||
{{ .Title }}
|
||||
</a>
|
||||
</summary>
|
||||
<details
|
||||
class="docs-menu__links-group link-group {{ if $isActive }}active{{ end }}"
|
||||
{{ if $isActive }}open{{ end }}
|
||||
>
|
||||
<summary class="docs-menu__links-group-heading">
|
||||
<a href="{{ $sectionLink }}">
|
||||
{{ .Title }}
|
||||
</a>
|
||||
</summary>
|
||||
|
||||
<nav>
|
||||
<ul class="docs-menu__links-submenu">
|
||||
{{ range .RegularPages }}
|
||||
{{ if (eq .Params.type "external-link") }}
|
||||
<li class="docs-menu__links-submenu-item">
|
||||
<a href="{{ .Params.external_url }}" target="_blank">
|
||||
{{ .Title }}
|
||||
{{ partial "svg" "external-link.svg" }}
|
||||
</a>
|
||||
</li>
|
||||
{{ else if not .Params.hideInSidebar }}
|
||||
<li
|
||||
class="docs-menu__links-submenu-item{{ if eq .File.UniqueID $currentNode.File.UniqueID }}
|
||||
active
|
||||
{{ end }}"
|
||||
>
|
||||
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
</li>
|
||||
<nav>
|
||||
<ul class="docs-menu__links-submenu">
|
||||
{{ range .RegularPages }}
|
||||
{{ if (eq .Params.type "external-link") }}
|
||||
<li class="docs-menu__links-submenu-item">
|
||||
<a href="{{ .Params.external_url }}" target="_blank">
|
||||
{{ .Title }}
|
||||
{{ partial "svg" "external-link.svg" }}
|
||||
</a>
|
||||
</li>
|
||||
{{ else if not .Params.hideInSidebar }}
|
||||
<li
|
||||
class="docs-menu__links-submenu-item{{ if eq .File.UniqueID $currentNode.File.UniqueID }}
|
||||
active
|
||||
{{ end }}"
|
||||
>
|
||||
<a href="{{ .Permalink }}">{{ .Title }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</nav>
|
||||
</details>
|
||||
</ul>
|
||||
</nav>
|
||||
</details>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</nav>
|
||||
</nav>
|
||||
{{ end }}
|
||||
|
||||
{{ if eq $currentNode.Section "articles" }}
|
||||
<h3 class="docs-menu__links-title">Learn</h3>
|
||||
<nav>
|
||||
<div class="docs-menu__links-group">
|
||||
{{ $subject := site.GetPage "articles" }}
|
||||
|
||||
{{ range $subject.Pages }}
|
||||
{{ if .Params.isCategoryPage }}
|
||||
<div
|
||||
class="docs-menu__articles-link docs-menu__links-group-heading
|
||||
{{ if eq .File.UniqueID $currentNode.File.UniqueID }} active{{ end }}"
|
||||
>
|
||||
<a href="{{ .Params.url }}">{{ .Params.title }}</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</nav>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user