Do not generate ToC if less than 400 words or special variable defined
parent
c7e8c504f8
commit
89e1349ed9
|
@ -1,4 +1,5 @@
|
||||||
---
|
---
|
||||||
title: À propos
|
title: À propos
|
||||||
|
notoc: true
|
||||||
menu: end
|
menu: end
|
||||||
---
|
---
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="columns mt-5 is-variable is-mobile is-8">
|
<div class="columns mt-5 is-variable is-mobile is-8">
|
||||||
<!--
|
<!--
|
||||||
If the current page is a blog post and belongs to a case, we will add a side menu
|
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.
|
with all other blog posts belonging to that case, emphasis to the current.
|
||||||
-->
|
-->
|
||||||
{{ if (and .IsPage (eq .FirstSection.Section "posts"))}}
|
{{ if (and .IsPage (eq .FirstSection.Section "posts"))}}
|
||||||
{{ with .CurrentSection }}
|
{{ with .CurrentSection }}
|
||||||
<aside class="menu column is-3 mt-2 is-align-self-flex-start">
|
<aside class="menu column is-3 mt-2 is-align-self-flex-start">
|
||||||
|
@ -28,11 +28,13 @@
|
||||||
{{ . }}
|
{{ . }}
|
||||||
<br /><br />
|
<br /><br />
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ if (or (not .Params.notoc) (gt .WordCount 400)) }}
|
||||||
<div class="message is-info">
|
<div class="message is-info">
|
||||||
<div class="message-header">Sommaire</div>
|
<div class="message-header">Sommaire</div>
|
||||||
<!-- Appreciate this horrible trick, even a 2000's HTML generator won't generate such horrible code -->
|
<!-- Appreciate this horrible trick, even a 2000's HTML generator won't generate such horrible code -->
|
||||||
<div class="message-body pt-1">{{ .TableOfContents | replaceRE "<a" "<a style='text-decoration:none;'" | safeHTML }}</div>
|
<div class="message-body pt-1">{{ .TableOfContents | replaceRE "<a" "<a style='text-decoration:none;'" | safeHTML }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
{{ end }}
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
</article>
|
</article>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue