mirror of
https://github.com/qdrant/landing_page.git
synced 2026-09-30 00:18:32 +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
@@ -6,7 +6,7 @@
|
||||
<link href="{{ $splideCss.RelPermalink }}" rel="stylesheet" integrity="{{ $splideCss.Data.Integrity }}" />
|
||||
{{ end }}
|
||||
|
||||
{{ if in (slice "blog" "docs" "documentation") .Section }}
|
||||
{{ if in (slice "blog" "docs" "documentation" "articles") .Section }}
|
||||
{{ $pageSearchCss := resources.Get "css/search/search.scss" | toCSS $opts | minify | resources.Fingerprint "sha512" }}
|
||||
<link href="{{ $pageSearchCss.RelPermalink }}" rel="stylesheet" integrity="{{ $pageSearchCss.Data.Integrity }}" />
|
||||
{{ end }}
|
||||
@@ -21,7 +21,7 @@
|
||||
/>
|
||||
{{ end }}
|
||||
|
||||
{{ if in (slice "docs" "documentation") .Section }}
|
||||
{{ if in (slice "docs" "documentation" "articles") .Section }}
|
||||
{{ $documentationCss := resources.Get "css/documentation.scss" | toCSS $opts | minify | resources.Fingerprint "sha512" }}
|
||||
<link
|
||||
href="{{ $documentationCss.RelPermalink }}"
|
||||
|
||||
+162
-15
@@ -10,25 +10,172 @@
|
||||
<div class="documentation__content">
|
||||
<!-- todo: update this and styles to support both types of content on the same page-->
|
||||
<div class="documentation__content-wrapper">
|
||||
{{ if .Params.content }}
|
||||
<div class="documentation__article-wrapper">
|
||||
<div class="docs-core documentation-article">
|
||||
{{ partial "documentation/custom-content.html" . }}
|
||||
{{ if eq .Section "documentation" }}
|
||||
{{ if .Params.content }}
|
||||
<div class="documentation__article-wrapper">
|
||||
<div class="docs-core documentation-article">
|
||||
{{ partial "documentation/custom-content.html" . }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ else }}
|
||||
{{ else }}
|
||||
|
||||
<div class="documentation__article-wrapper">
|
||||
{{ if not (eq .Params.breadcrumb false) }}
|
||||
<div class="documentation__article-wrapper">
|
||||
{{ if not (eq .Params.breadcrumb false) }}
|
||||
{{ partial "documentation/breadcrumbs" . }}
|
||||
{{ end }}
|
||||
|
||||
<article class="documentation-article">
|
||||
{{ partial "article-content.html" . }}
|
||||
</article>
|
||||
{{ partial "documentation/feedback.html" . }}
|
||||
</div>
|
||||
{{ partial "table-of-contents" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if eq .Section "articles" }}
|
||||
{{ $subject := site.GetPage "articles" }}
|
||||
{{ $currentNode := .Params }}
|
||||
|
||||
{{ if .Params.isMainPage }}
|
||||
<div class="docs-articles docs-articles__blocks">
|
||||
{{ range $subject.Pages }}
|
||||
{{ if .Params.isCategoryPage }}
|
||||
<div class="docs-articles__block">
|
||||
<div class="docs-articles__block-header">
|
||||
<div>
|
||||
<h4 class="docs-articles__title">{{ .Params.title }}</h4>
|
||||
<p class="docs-articles__description">{{ .Params.description }}</p>
|
||||
</div>
|
||||
<a href="{{ .Params.url }}" class="docs-articles__block-link button button_outlined button_sm">
|
||||
{{ $currentNode.learnButton }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{{ $category := .Params.category }}
|
||||
|
||||
<div class="docs-articles__posts">
|
||||
<div class="row gy-4">
|
||||
{{ $list := first 0 site.Pages }}
|
||||
|
||||
{{ range $subject.Pages }}
|
||||
{{ if and (eq .Params.category $category) (not .Params.isCategoryPage) }}
|
||||
{{ $list = $list | append . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $all := $list.ByPublishDate.Reverse }}
|
||||
{{ range first 3 $all }}
|
||||
<article class="col-12 col-lg-4 post post-sm">
|
||||
<a class="post-link" href="{{ .RelPermalink }}">
|
||||
<div class="post-preview">
|
||||
<img src="{{ .Params.preview_dir }}/preview.jpg" alt="Preview" />
|
||||
</div>
|
||||
<h6 class="post-title">{{ .Params.title }}</h6>
|
||||
<p class="post-description">{{ .Params.description }}</p>
|
||||
<div class="post-about">
|
||||
<p>{{ .Params.author }}</p>
|
||||
<span>·</span>
|
||||
<p>{{ time.Format "January 02, 2006" .Date }}</p>
|
||||
</div>
|
||||
</a>
|
||||
</article>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ else if .Params.isCategoryPage }}
|
||||
<div class="docs-articles docs-articles__list">
|
||||
{{ partial "documentation/breadcrumbs" . }}
|
||||
{{ end }}
|
||||
|
||||
<article class="documentation-article">
|
||||
{{ partial "article-content.html" . }}
|
||||
</article>
|
||||
{{ partial "documentation/feedback.html" . }}
|
||||
</div>
|
||||
{{ partial "table-of-contents" . }}
|
||||
<h4 class="docs-articles__title">{{ .Params.title }}</h4>
|
||||
<p class="docs-articles__description">{{ .Params.description }}</p>
|
||||
|
||||
{{ $category := .Params.category }}
|
||||
|
||||
<div class="docs-articles__posts">
|
||||
<div class="row gx-4 gy-5">
|
||||
{{ $list := first 0 site.Pages }}
|
||||
{{ range $subject.Pages }}
|
||||
{{ if and (eq .Params.category $category) (not .Params.isCategoryPage) }}
|
||||
{{ $list = $list | append . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $all := $list.ByPublishDate.Reverse }}
|
||||
{{ $paginator := .Paginate $all 14 }}
|
||||
|
||||
{{ range $paginator.Pages }}
|
||||
<article class="col-12 col-lg-6 post post-md">
|
||||
<a class="post-link" href="{{ .RelPermalink }}">
|
||||
<div class="post-preview">
|
||||
<img src="{{ .Params.preview_dir }}/preview.jpg" alt="Preview" />
|
||||
</div>
|
||||
<h6 class="post-title">{{ .Params.title }}</h6>
|
||||
<p class="post-description">{{ .Params.description }}</p>
|
||||
<div class="post-about">
|
||||
<p>{{ .Params.author }}</p>
|
||||
<span>·</span>
|
||||
<p>{{ time.Format "January 02, 2006" .Date }}</p>
|
||||
</div>
|
||||
</a>
|
||||
</article>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="docs-articles__pagination col-12">
|
||||
{{ if gt $paginator.TotalPages 1 }}
|
||||
{{ partial "pagination" $paginator }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ else }}
|
||||
<div class="documentation__article-wrapper">
|
||||
{{ partial "documentation/breadcrumbs" . }}
|
||||
|
||||
<article class="documentation-article">
|
||||
<div class="documentation-article__header">
|
||||
{{ $firstUrlElement := index (split .RelPermalink "/") 1 }}
|
||||
{{ $url := path.Join $firstUrlElement .Params.category }}
|
||||
|
||||
<a href="/{{ $url }}/" class="documentation-article__header-link">
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M14.6668 8.00004H1.3335M1.3335 8.00004L6.00016 12.6667M1.3335 8.00004L6.00016 3.33337" stroke="#8F98B3" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
{{ with (.Site.GetPage $url) }}
|
||||
Back to {{ .Params.Title }}
|
||||
{{ end }}
|
||||
</a>
|
||||
<h1 class="documentation-article__header-title">{{ .Params.title }}</h1>
|
||||
<div class="documentation-article__header-about">
|
||||
<p>{{ .Params.author }}</p>
|
||||
<span>·</span>
|
||||
<p>{{ time.Format "January 02, 2006" .Date }}</p>
|
||||
</div>
|
||||
{{ if .Params.preview_dir }}
|
||||
<picture class="documentation-article__header-preview">
|
||||
<source srcset="{{ .Params.preview_dir }}/title.webp" type="image/webp" />
|
||||
<img alt="{{ .Title }}" src="{{ .Params.preview_dir }}/title.jpg" />
|
||||
</picture>
|
||||
{{ else }}
|
||||
<picture class="documentation-article__preview">
|
||||
{{ partial "preview-image" (dict "context" . "default_file_name" "title.jpg" "preview_file" .Params.title_preview_image) }}
|
||||
</picture>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
{{ partial "article-content.html" . }}
|
||||
</article>
|
||||
{{ partial "documentation/feedback.html" . }}
|
||||
</div>
|
||||
{{ partial "table-of-contents" . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ partial "documentation/footer.html" . }}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<a
|
||||
class="menu-link {{- if eq (lower .name) $partition }}active{{- end -}}"
|
||||
href="{{ .url }}"
|
||||
{{ if (eq $index 3) }}target="_blank"{{ end }}
|
||||
{{ if (eq $index 4) }}target="_blank"{{ end }}
|
||||
>
|
||||
{{ .name }}
|
||||
</a>
|
||||
|
||||
+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>
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<script src="{{ $filterChartJs.RelPermalink }}"></script>
|
||||
{{ end }}
|
||||
|
||||
{{ if in (slice "docs" "documentation") .Section }}
|
||||
{{ if in (slice "docs" "documentation" "articles") .Section }}
|
||||
{{ $documentationJs := resources.Get "/js/documentation.js" | js.Build | minify | resources.Fingerprint "sha512" }}
|
||||
<script src="{{ $documentationJs.RelPermalink }}"></script>
|
||||
{{ end }}
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
</script>
|
||||
{{ end }}
|
||||
|
||||
{{ if or (in (slice "docs" "documentation") .Section) (and (not .IsPage) (eq .Section "blog")) }}
|
||||
{{ if or (in (slice "docs" "documentation" "articles") .Section) (and (not .IsPage) (eq .Section "blog")) }}
|
||||
{{ $pageSearchJs := resources.Get "/js/search/search.js" | js.Build | minify | resources.Fingerprint "sha512" }}
|
||||
<script src="{{ $pageSearchJs.RelPermalink }}" type="module"></script>
|
||||
{{ end }}
|
||||
@@ -115,7 +115,7 @@
|
||||
<script src="{{ $anchorJs.RelPermalink }}"></script>
|
||||
{{ end }}
|
||||
|
||||
{{ if or (eq .Section "blog") (eq .Section "docs") (eq .Section "documentation") }}
|
||||
{{ if or (eq .Section "blog") (eq .Section "docs") (eq .Section "documentation") (eq .Section "articles") }}
|
||||
<script>
|
||||
document.addEventListener('keydown', function (event) {
|
||||
if ((event.metaKey || event.ctrlKey) && event.key === 'k') {
|
||||
|
||||
@@ -2,12 +2,17 @@
|
||||
{{ if gt (.TableOfContents | len) 34 }}
|
||||
<div class="table-of-contents">
|
||||
<p class="table-of-contents__head">On this page:</p>
|
||||
|
||||
{{ .TableOfContents }}
|
||||
{{ $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 }}
|
||||
|
||||
|
||||
<ul class="table-of-contents__external-links">
|
||||
{{ if eq .Section "documentation" }}
|
||||
{{ 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" }}
|
||||
|
||||
Reference in New Issue
Block a user