hugo-theme-cybercards/layouts/partials/sidebar.html
2020-03-08 16:38:47 +01:00

38 lines
No EOL
1.1 KiB
HTML

<div class="col-md-4 mt20">
<div class="post-img">
{{ if .Params.img }}
<img width="600" src="{{ .Site.BaseURL}}images/{{ .Params.img }}" alt="{{ .Params.title }}">
{{ else }}
<img width="600" src="{{ .Site.BaseURL }}images/{{ .Site.Params.defaultImage }}" alt="matrix">
{{ end }}
</div>
{{ $taxo := "categories" }}
{{ if .Param $taxo }}
<div class="mt10 sb-box">
<h3>{{i18n "categories"}}</h3>
<ul id="{{ $taxo }}">
{{ range .Param $taxo }}
{{ $name := . }}
{{ with $.Site.GetPage (printf "/%s/%s" $taxo ($name | urlize)) }}
<li><a href="{{ .Permalink }}">{{ $name }}</a></li>
{{ end }}
{{ end }}
</ul>
</div>
{{ end }}
<div class="mt10 sb-box">
<h3>{{i18n "recentArticles"}}</h3>
<ul>
{{ range first 3 (where .Site.RegularPages "Section" "posts") }}
<li>
<a href="{{ .Permalink }}">{{ .Title }}</a><small>&nbsp;&nbsp;{{ .Date.Format (i18n "dateFormat") }}</small>
</li>
{{ end }}
</ul>
</div>
</div>