blog/themes/chosto/layouts/_default/single.html

48 lines
1.6 KiB
HTML
Raw Normal View History

2021-05-11 10:01:24 +02:00
{{ define "main" }}
<div class="columns mt-5 is-variable is-mobile is-8">
2021-05-21 14:53:35 +02:00
<!--
If the current page is a blog post and belongs to a case, we will add a side menu
2021-05-21 14:53:35 +02:00
with all other blog posts belonging to that case, emphasis to the current.
-->
{{ if (and .IsPage (eq .FirstSection.Section "posts"))}}
2021-05-22 00:16:10 +02:00
{{ with .CurrentSection }}
<aside class="menu box column is-3 is-align-self-flex-start is-fixed-top" style="position: sticky; top: 7%;">
2021-05-21 14:53:35 +02:00
<p class="menu-label">
2021-05-22 00:16:10 +02:00
Dans le dossier « <a href="{{ .Permalink }}">{{ .Params.Title }} »</a>...
2021-05-21 14:53:35 +02:00
</p>
2021-05-21 23:50:10 +02:00
<div class="menu-list">
2021-05-21 14:53:35 +02:00
{{ $posts := (where $.Site.RegularPages "CurrentSection.Params.Code" "==" $.CurrentSection.Params.Code )}}
{{ $postsSorted := (sort $posts "Date" )}}
{{ range $postsSorted }}
2021-05-21 23:50:10 +02:00
<a {{ if eq $.Title .Title }} class="is-active" {{ end }} href="{{ .Permalink }}">{{ .Title }}</a>
2021-05-19 18:24:05 +02:00
{{ end }}
2021-05-21 23:50:10 +02:00
</div>
2021-05-21 14:53:35 +02:00
</aside>
{{ end }}
{{ end }}
<section class="column is-7">
2021-05-11 10:01:24 +02:00
<div>
2021-05-21 23:50:10 +02:00
<article>
{{ .Content }}
</article>
2021-05-11 10:01:24 +02:00
</div>
2021-05-21 23:50:10 +02:00
<aside class="container level my-5">
<div class="level-left">
{{ with .PrevInSection }}
<div class="level-item">
<a class="button is-info" href="{{ .Permalink }}">&laquo;&nbsp;{{ .Title }}</a>
2021-05-21 23:50:10 +02:00
</div>
{{ end }}
2021-05-21 14:53:35 +02:00
</div>
2021-05-21 23:50:10 +02:00
<div class="level-right">
{{ with .NextInSection }}
<div class="level-item">
<a class="button is-info" href="{{ .Permalink }}">{{ .Title }}&nbsp;&raquo;</a>
2021-05-21 23:50:10 +02:00
</div>
{{ end }}
</div>
</aside>
</section>
2021-05-21 14:53:35 +02:00
</div>
2021-05-11 10:01:24 +02:00
{{ end }}