refactor: add post-title to ToC

This commit is contained in:
Jake Wiesler 2020-06-25 12:21:47 -04:00
parent 970d27c330
commit 9ea3be7d21
2 changed files with 16 additions and 7 deletions

View File

@ -70,12 +70,24 @@ $tocBreakpoint: 1024px;
padding-top: 3rem;
}
#TableOfContents {
.toc-container {
position: sticky;
align-self: start;
top: 3rem;
max-width: 350px;
@media screen and (max-width: $tocBreakpoint) {
visibility: hidden;
width: 0;
margin: 0;
}
}
.toc-post-title {
font-size: 0.9rem;
}
#TableOfContents {
ul {
list-style: none;
margin: 0;
@ -90,12 +102,6 @@ $tocBreakpoint: 1024px;
a.active {
color: rgb(51, 51, 51);
}
@media screen and (max-width: $tocBreakpoint) {
visibility: hidden;
width: 0;
margin: 0;
}
}
.tags__list {

View File

@ -28,7 +28,10 @@
</div>
</div>
{{ if or .Params.toc .Site.Params.toc }}
<div class="toc-container">
<div class="toc-post-title">{{.Title}}</div>
{{ .TableOfContents }}
</div>
{{ end }}
</div>