1
0
mirror of https://github.com/alanorth/hugo-theme-bootstrap4-blog.git synced 2024-12-19 09:02:18 +01:00
hugo-theme-bootstrap4-blog/layouts/partials/sidebar.html

36 lines
1.0 KiB
HTML
Raw Normal View History

<aside class="col-sm-3 offset-sm-1 blog-sidebar">
{{ if and (.Site.Params.sidebar) (isset .Site.Params.sidebar "about") }}
<section class="sidebar-module sidebar-module-inset">
<h4>{{ i18n "about" }}</h4>
<p>{{ .Site.Params.sidebar.about | markdownify }}</p>
</section>
{{ end }}
{{ if .Site.Params.sidebar }}
{{ $num_recent_posts := (index .Site.Params.sidebar "num_recent_posts" | default 5) }}
<section class="sidebar-module">
<h4>{{ i18n "recentPosts" }}</h4>
<ol class="list-unstyled">
{{ range first $num_recent_posts (where .Site.RegularPages "Type" "post") }}
<li><a href="{{.RelPermalink}}">{{.Title | markdownify }}</a></li>
{{ end }}
</ol>
</section>
{{ end }}
{{ with .Site.Menus.sidebar }}
<section class="sidebar-module">
2016-12-09 15:46:31 +01:00
<h4>{{ i18n "links" }}</h4>
2016-08-28 21:41:52 +02:00
<ol class="list-unstyled">
{{ range . }}
<li><a href="{{ .URL | absURL }}">{{ .Name }}</a></li>
{{ end }}
2016-08-28 21:41:52 +02:00
</ol>
</section>
{{ end }}
</aside><!-- /.blog-sidebar -->
{{- /* vim: set ts=2 sw=2 et: */}}