2021-05-11 10:01:24 +02:00
|
|
|
{{ define "main" }}
|
2021-05-26 19:03:43 +02:00
|
|
|
<div class="section">
|
2021-05-26 23:18:11 +02:00
|
|
|
<div class="container content">
|
2021-05-26 19:03:43 +02:00
|
|
|
<div class="columns mt-5 is-variable is-8">
|
|
|
|
<!--
|
2021-05-27 02:21:44 +02:00
|
|
|
If the current page is a blog post and belongs to a case, we will add a side menu
|
|
|
|
with all other blog posts belonging to that case, emphasis to the current.
|
|
|
|
Still use empty container if nothing to show for homogeneous layout
|
|
|
|
-->
|
2021-05-26 19:03:43 +02:00
|
|
|
<aside class="menu column is-3 mt-2 is-align-self-flex-start">
|
2021-05-27 02:21:44 +02:00
|
|
|
{{ if (and .IsPage (eq .FirstSection.Section "posts"))}}
|
|
|
|
{{ with .CurrentSection }}
|
2021-05-26 19:03:43 +02:00
|
|
|
<p class="menu-label">
|
|
|
|
Dans le dossier « <a href="{{ .Permalink }}">{{ .Params.Title }} »</a>...
|
|
|
|
</p>
|
|
|
|
<div class="menu-list">
|
|
|
|
{{ $posts := (where $.Site.RegularPages "CurrentSection.Params.Code" "==" $.CurrentSection.Params.Code )}}
|
|
|
|
{{ $postsSorted := (sort $posts "Date" )}}
|
|
|
|
{{ range $postsSorted }}
|
|
|
|
<a {{ if eq $.Title .Title }} class="is-active" {{ end }} href="{{ .Permalink }}">{{ .Title }}</a>
|
|
|
|
{{ end }}
|
|
|
|
</div>
|
2021-05-27 02:21:44 +02:00
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
2021-05-26 19:03:43 +02:00
|
|
|
</aside>
|
2021-05-27 02:21:44 +02:00
|
|
|
<section class="column">
|
2021-05-26 19:03:43 +02:00
|
|
|
<div>
|
|
|
|
<article>
|
2021-05-27 00:26:57 +02:00
|
|
|
<!-- First thing is a legend for the hero image, if it exists -->
|
|
|
|
{{ with .Params.imgExplanation }}
|
|
|
|
<article class="message mb-5">
|
|
|
|
<div class="message-body content is-italic">
|
|
|
|
{{ . }}
|
|
|
|
</div>
|
|
|
|
</article>
|
|
|
|
{{ end }}
|
|
|
|
<!-- Second, a summary before ToC, if it exists -->
|
2021-05-26 19:03:43 +02:00
|
|
|
{{ with .Params.summary }}
|
2021-05-25 01:24:43 +02:00
|
|
|
{{ . }}
|
|
|
|
<br /><br />
|
2021-05-26 19:03:43 +02:00
|
|
|
{{ end }}
|
2021-05-27 02:21:44 +02:00
|
|
|
<!-- Then, ToC if text has more than 600 words and not explicitly asked not to -->
|
2021-10-15 01:41:01 +02:00
|
|
|
{{ if (and (not .Params.notoc) (gt .WordCount 600)) }}
|
2021-05-26 19:03:43 +02:00
|
|
|
<div class="message is-info">
|
|
|
|
<div class="message-header">Sommaire</div>
|
|
|
|
<!-- Appreciate this horrible trick, even a 2000's HTML generator won't generate such code -->
|
|
|
|
<div class="message-body pt-1">{{ .TableOfContents | replaceRE "<a" "<a style='text-decoration:none;'" | safeHTML }}</div>
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
2021-05-27 00:26:57 +02:00
|
|
|
<!-- Finally, content! -->
|
2021-05-26 19:03:43 +02:00
|
|
|
{{ .Content }}
|
|
|
|
</article>
|
2021-05-25 00:07:23 +02:00
|
|
|
</div>
|
2021-05-26 19:03:43 +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 }}">« {{ .Title }}</a>
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
2021-05-25 00:07:23 +02:00
|
|
|
</div>
|
2021-05-26 19:03:43 +02:00
|
|
|
<div class="level-right">
|
|
|
|
{{ with .NextInSection }}
|
|
|
|
<div class="level-item">
|
|
|
|
<a class="button is-info" href="{{ .Permalink }}">{{ .Title }} »</a>
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
|
|
|
</div>
|
|
|
|
</aside>
|
|
|
|
</section>
|
2021-05-27 02:21:44 +02:00
|
|
|
<!-- So the middle column is sized automatically, useful in pages that are not blog posts -->
|
|
|
|
<div class="column is-2">
|
|
|
|
</div>
|
2021-05-26 19:03:43 +02:00
|
|
|
</div>
|
2021-05-25 00:07:23 +02:00
|
|
|
</div>
|
2021-05-21 14:53:35 +02:00
|
|
|
</div>
|
2021-05-11 10:01:24 +02:00
|
|
|
{{ end }}
|