gcg-website/layouts/partials/blog-sidebar.html

42 lines
1.7 KiB
HTML

<aside class="col-lg-4 order-4 order-lg-2" data-pagefind-ignore="all">
<div class="bg-white mb-4">
<h4 class="mb-4">{{ i18n "categories" }}</h4>
{{ $data := index .Site.Data .Site.Language.Lang }}
{{ $transliterations := $data.transliterations.transliterations }}
{{- if isset .Site.Taxonomies "categories" }}
{{- if not (eq (len .Site.Taxonomies.categories) 0) }}
<ul class="list-inline tag-list">
{{- range $name, $items := .Site.Taxonomies.categories }}
<li class="list-inline-item mb-2"><a href="{{ `categories/` | relLangURL }}{{ $name | urlize | lower }}">{{ if (index $transliterations $name) }}{{ index $transliterations $name }}{{ else }}{{ $name | title }}{{end}}</a></li>
{{- end }}
</ul>
{{- end }}
{{- end }}
</div>
<div class="bg-white mb-4">
<h4 class="mb-4">{{ i18n "tags" }}</h4>
{{- if isset .Site.Taxonomies "tags" }}
{{- if not (eq (len .Site.Taxonomies.tags) 0) }}
<ul class="list-inline tag-list">
{{- range $name, $items := .Site.Taxonomies.tags }}
<li class="list-inline-item mb-2"><a href="{{ `tags/` | relLangURL }}{{ $name | urlize | lower }}">{{ $name }}</a></li>
{{- end }}
</ul>
{{- end }}
{{- end }}
</div>
<div class="bg-white">
<h4 class="mb-4">{{ i18n "latest_article" }}</h4>
{{ range first 5 ( where .Site.Pages "Type" "post" )}}
<div class="d-flex border-bottom border-color pb-3 mb-3">
<a href="{{ .Permalink }}"><img class="me-3 post-thumb-sm" src="{{ .Params.Image | absURL }}"></a>
<div class="flex-grow-1">
<a href="{{ .Permalink }}">
<h5 class="mt-0">{{ .Title }}</h5>
</a>
{{ time.Format "02. Jan 2006" .PublishDate }}
</div>
</div>
{{ end }}
</div>
</aside>