Add toc to main-article partial

This commit is contained in:
Sam 2024-08-07 00:39:11 +01:00
parent 284b5469ce
commit cf40c32443
1 changed files with 20 additions and 13 deletions

View File

@ -1,15 +1,22 @@
<article class="main-article"> <div class="article-container">
<header> <article class="main-article">
<h1>{{ .Title }}</h1> <header>
<div class="author-row"> <h1>{{ .Title }}</h1>
{{ with .Params.author }} <div class="author-row">
<strong><p class="author-name">{{ .name }}</p></strong> {{ with .Params.author }}
<p class="author-name">on</p> <strong><p class="author-name">{{ .name }}</p></strong>
{{ end }} <p class="author-name">on</p>
{{ if isset .Params "date" }} {{ end }} {{ if isset .Params "date" }}
<time>{{ .Date.Format "January 2, 2006" }}</time> <time>{{ .Date.Format "January 2, 2006" }}</time>
{{ end }}
</div>
</header>
<div id="tocWrapper">
<h4>Table of Contents</h4>
{{ if .Params.toc }}
<aside>{{.TableOfContents}}</aside>
{{ end }} {{ end }}
</div> </div>
</header> {{ .Content }}
{{ .Content }} </article>
</article> </div>