mirror of
https://github.com/alanorth/hugo-theme-bootstrap4-blog.git
synced 2024-12-26 04:04:29 +01:00
Alan Orth
192d0bbee6
Add something like the following to your config: [[menu.sidebar]] name = "Link 1" url = "https://link1.com" [[menu.sidebar]] name = "Link 2" url = "https://link2.com" See the Hugo docs for more examples: https://gohugo.io/extras/menus/
31 lines
871 B
HTML
31 lines
871 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 }}
|
|
|
|
{{ $num_recent_posts := (index .Site.Params.sidebar "num_recent_posts" | default 5) }}
|
|
|
|
<section class="sidebar-module">
|
|
<h4>Recent Posts</h4>
|
|
<ol class="list-unstyled">
|
|
{{ range first $num_recent_posts .Site.Pages }}
|
|
<li><a href="{{.RelPermalink}}">{{.Title}}</a></li>
|
|
{{ end }}
|
|
</ol>
|
|
</section>
|
|
|
|
{{ with .Site.Menus.sidebar }}
|
|
<section class="sidebar-module">
|
|
<h4>Links</h4>
|
|
<ol class="list-unstyled">
|
|
{{ range . }}
|
|
<li><a href="{{ .URL | absURL }}">{{ .Name }}</a></li>
|
|
{{ end }}
|
|
</ol>
|
|
</section>
|
|
{{ end }}
|
|
</aside><!-- /.blog-sidebar -->
|