mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-03 09:58:30 +02:00
56 lines
1.9 KiB
HTML
56 lines
1.9 KiB
HTML
<section class="qdrant-blog-posts">
|
|
<div class="container">
|
|
<div class="qdrant-blog-posts__articles row gx-5">
|
|
{{ $all := ($.Site.GetPage "blog" .Section).Pages.ByPublishDate.Reverse }}
|
|
|
|
<!-- Remove first 4 featured posts from $all -->
|
|
{{ $featured := where $all ".Params.featured" true }}
|
|
{{ $notFeatured := where $all ".Params.featured" false }}
|
|
|
|
<!-- All but first 4 featured posts -->
|
|
{{ $oldFeatured := after 4 $featured }}
|
|
|
|
<!-- Concatenate old featured post with all non-featured -->
|
|
{{ $allBut4Featured := $oldFeatured | append $notFeatured }}
|
|
|
|
<!-- Sort by publish date again -->
|
|
{{ $allBut4Featured := $allBut4Featured.ByPublishDate.Reverse }}
|
|
|
|
{{ $paginator := .Paginate $allBut4Featured 9 }}
|
|
{{ range $paginator.Pages }}
|
|
{{ .Scratch.Set "scope" "list" }}
|
|
|
|
{{ $link := .Permalink }}
|
|
{{ if .Params.external_link }}
|
|
{{ $link = .Params.external_link }}
|
|
{{ end }}
|
|
|
|
<article class="qdrant-blog-posts__article post col-12 col-lg-4">
|
|
<a class="post-link" href="{{ .RelPermalink }}">
|
|
{{ if .Params.preview_image }}
|
|
<div class="post-preview">
|
|
{{ partial "preview-image" (dict "context" . "default_file_name" "preview.jpg" "preview_file" .Params.small_preview_image) }}
|
|
</div>
|
|
{{ end }}
|
|
<h6 class="post-title">{{ .Params.title }}</h6>
|
|
<p class="post-description">{{ .Params.description }}</p>
|
|
<div class="post-about">
|
|
<p>{{ .Params.author }}</p>
|
|
<p>{{ time.Format "January 02, 2006" .Date }}</p>
|
|
</div>
|
|
</a>
|
|
</article>
|
|
|
|
{{ end }}
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="qdrant-blog-posts__pagination col-12">
|
|
{{ if gt $paginator.TotalPages 1 }}
|
|
{{ partial "pagination" $paginator }}
|
|
{{ end }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|