theme-blog-ewen/layouts/partials/sidebar.html

79 lines
2.5 KiB
HTML
Raw Permalink Normal View History

2023-12-15 16:26:57 +00:00
<div class="col-lg-4">
<div class="widgets">
{{ $currentPage := . }}
2022-03-31 04:22:55 +00:00
{{ $currentPageName := .Page.Name | urlize | lower }}
{{ if or (eq $currentPage.Type "blog") (eq $currentPage.Section "tags") }}
2023-12-15 16:26:57 +00:00
<!-- category
<div class="widget">
<h4 class="widget-title">Category</h4>
{{- if isset .Site.Taxonomies "categories" }}
{{- if not (eq (len .Site.Taxonomies.categories) 0) }}
<ul class="list-unstyled">
{{- range $name, $items := .Site.Taxonomies.categories }}
<li><a href="{{ `categories/` | relLangURL }}{{ $name | urlize | lower }}/">{{ $name | title | humanize }}</a>
</li>
{{- end }}
</ul>
{{- end }}
{{- end }}
</div>-->
<!-- Tags -->
<div class="widget">
2022-03-31 04:22:55 +00:00
<h4 class="widget-title">{{ i18n "tags" }} </h4>
2023-12-15 16:26:57 +00:00
{{- if isset .Site.Taxonomies "tags" }}
{{- if not (eq (len .Site.Taxonomies.tags) 0) }}
<ul class="list-inline">
{{- range $name, $items := .Site.Taxonomies.tags }}
2022-03-31 04:22:55 +00:00
<span class="tag d-inline-block my-2">
<a {{ if eq $currentPageName $name }}class="active"{{ end }}
href="{{ `tags/` | relLangURL }}{{ $name | urlize | lower }}/">{{ $name }}</a>
</span>&nbsp;
2023-12-15 16:26:57 +00:00
{{- end }}
</ul>
{{- end }}
{{- end }}
</div>
{{ end }}
<!-- about -->
<div class="widget">
{{ with .Site.GetPage "/about" }}
<h4 class="widget-title">{{ .Title | markdownify }}</h4>
{{ if .Params.Image }}
<img src="{{ .Params.Image | absURL }}" alt=""
class="img-fluid author-thumb-sm d-block mx-auto rounded-circle mb-4">
{{ end }}
<p>{{ .Summary }}</p>
2022-03-31 04:22:55 +00:00
<a href="{{ .Permalink }}" class="btn btn-outline-primary">{{ i18n "readMore" }}</a>
2023-12-15 16:26:57 +00:00
{{ end }}
</div>
<!-- social -->
<div class="widget">
2022-03-31 04:22:55 +00:00
<h4 class="widget-title">{{ i18n "social" }}</h4>
2023-12-15 16:26:57 +00:00
<ul class="list-inline social-links">
{{- range sort .Site.Params.social "weight" "asc" -}}
<li class="list-inline-item">
<a aria-label="{{ .title }}" target="_blank" rel="noopener" href="{{ .link | safeURL }}">
<i class="{{ .icon }}"></i>
</a>
</li>
{{- end -}}
<li class="list-inline-item">
<a aria-label="rss" target="_blank" rel="noopener" href="{{ "/index.xml" | absLangURL }}">
<i class="fa-solid fa-rss"></i>
</a>
</li>
</ul>
</div>
</div>
</div>