1
0
mirror of https://github.com/alanorth/hugo-theme-bootstrap4-blog.git synced 2024-11-15 16:57:05 +01:00
hugo-theme-bootstrap4-blog/layouts/partials/sidebar.html
Alan Orth 6ccdf9a438
layouts: Allow specifying number of "Recent Posts" to display in the sidebar
Set the following param in your config:

  [params.sidebar]
    num_recent_posts = 5

Alternatively, delete or comment out the variable to disable showing
of recents. I should probably allow setting it to "0" to disable.
2016-08-28 22:45:51 +03:00

44 lines
1.4 KiB
HTML

<div class="col-sm-3 offset-sm-1 blog-sidebar">
<div class="sidebar-module sidebar-module-inset">
<h4>About</h4>
<p>Etiam porta <em>sem malesuada magna</em> mollis euismod. Cras mattis consectetur purus sit amet fermentum. Aenean lacinia bibendum nulla sed consectetur.</p>
</div>
{{ if isset .Site.Params.sidebar "num_recent_posts" }}
<div 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>
</div>
{{ end }}
<div class="sidebar-module">
<h4>Archives</h4>
<ol class="list-unstyled">
<li><a href="#">March 2014</a></li>
<li><a href="#">February 2014</a></li>
<li><a href="#">January 2014</a></li>
<li><a href="#">December 2013</a></li>
<li><a href="#">November 2013</a></li>
<li><a href="#">October 2013</a></li>
<li><a href="#">September 2013</a></li>
<li><a href="#">August 2013</a></li>
<li><a href="#">July 2013</a></li>
<li><a href="#">June 2013</a></li>
<li><a href="#">May 2013</a></li>
<li><a href="#">April 2013</a></li>
</ol>
</div>
<div 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>
</div>
</div><!-- /.blog-sidebar -->