Get started on tables of contents.

This commit is contained in:
Danila Fedorin 2020-06-24 22:46:22 -07:00
parent 71fc0546e0
commit 01734d24f7
3 changed files with 50 additions and 0 deletions

View File

@ -5,3 +5,9 @@ theme = "vanilla"
pygmentsCodeFences = true pygmentsCodeFences = true
pygmentsStyle = "github" pygmentsStyle = "github"
summaryLength = 20 summaryLength = 20
[markup]
[markup.tableOfContents]
endLevel = 4
ordered = false
startLevel = 3

View File

@ -231,3 +231,41 @@ figure {
text-align: center; text-align: center;
} }
} }
.table-of-contents {
@include margin-content;
@include margin-content-left;
display: flex;
flex-direction: column;
align-items: end;
em {
font-style: normal;
font-weight: bold;
font-size: 1.2em;
display: block;
margin-bottom: 1rem;
}
#TableOfContents > ul {
padding-left: 0;
}
nav {
width: auto;
}
ul {
position: relative;
list-style: none;
padding-left: 2rem;
}
li {
position: relative;
}
a {
padding: 0;
}
}

View File

@ -10,6 +10,12 @@
</div> </div>
<div class="post-content"> <div class="post-content">
<div class="table-of-contents">
<div>
<em>Table of Contents</em>
{{ .TableOfContents }}
</div>
</div>
{{ .Content }} {{ .Content }}
</div> </div>
{{ end }} {{ end }}