Browse Source

Get started on tables of contents.

table-of-contents
Danila Fedorin 1 year ago
parent
commit
01734d24f7
  1. 6
      config.toml
  2. 38
      themes/vanilla/assets/scss/style.scss
  3. 6
      themes/vanilla/layouts/blog/single.html

6
config.toml

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

38
themes/vanilla/assets/scss/style.scss

@ -231,3 +231,41 @@ figure {
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;
}
}

6
themes/vanilla/layouts/blog/single.html

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

Loading…
Cancel
Save