1
0
mirror of https://github.com/alanorth/hugo-theme-bootstrap4-blog.git synced 2024-11-15 08:47:03 +01:00
hugo-theme-bootstrap4-blog/layouts/partials/sidebar.html
Alan Orth 15a41a86a2
Allow optional configuration of "About" block in sidebar
Add something like the following to your config to enable the about
block in the sidebar:

  [params.sidebar]
    about = "*My site* is really cool. Adios!"

Can be formatted in Markdown.
2016-09-07 16:41:04 +03:00

29 lines
843 B
HTML

<aside class="col-sm-3 offset-sm-1 blog-sidebar">
{{ if isset .Site.Params.sidebar "about" }}
<section class="sidebar-module sidebar-module-inset">
<h4>About</h4>
<p>{{ .Site.Params.sidebar.about | markdownify }}</p>
</section>
{{ end }}
{{ if isset .Site.Params.sidebar "num_recent_posts" }}
<section class="sidebar-module">
<h4>Recent Posts</h4>
<ol class="list-unstyled">
{{ range first .Site.Params.sidebar.num_recent_posts .Site.Pages }}
<li><a href="{{.RelPermalink}}">{{.Title}}</a></li>
{{ end }}
</ol>
</section>
{{ end }}
<section class="sidebar-module">
<h4>Elsewhere</h4>
<ol class="list-unstyled">
<li><a href="#">GitHub</a></li>
<li><a href="#">Twitter</a></li>
<li><a href="#">Facebook</a></li>
</ol>
</section>
</aside><!-- /.blog-sidebar -->