Skip to content
Snippets Groups Projects
Verified Commit 4645e7b8 authored by Jeffrey Phillips Freeman's avatar Jeffrey Phillips Freeman :boom:
Browse files

Added rendering of Table of Contents

parent 350d0053
No related branches found
No related tags found
No related merge requests found
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
modification of code. See updated `README.me`. modification of code. See updated `README.me`.
* Added MathJax support for rendering Latex and math. * Added MathJax support for rendering Latex and math.
* Added support for PseudocodeJS for rendering beautiful, standard, pseudocode. * Added support for PseudocodeJS for rendering beautiful, standard, pseudocode.
* Table of contents will now render if frontmatter `toc` is set to `true`.
## 1.1.0 ## 1.1.0
......
...@@ -629,3 +629,36 @@ section > .container > .row > .col { ...@@ -629,3 +629,36 @@ section > .container > .row > .col {
width: 100%; width: 100%;
} }
} }
/* Styling for table of contents */
#TableOfContents {
border: 1px black solid;
display: inline-block;
padding-right: 40px;
padding-top: 5px;
padding-bottom: 5px;
background-color: floralwhite;
width: 400px;
margin-left: 40px;
margin-bottom: 10px;
}
#TableOfContents ul {
padding-inline-start: 40px;
}
#TableOfContents ul,
#TableOfContents ol {
padding-left: 40px;
margin-bottom: 10px;
}
/* Adjusts links within the same page so as to not be covered by the header menu */
:target::before {
content: "";
display: block;
height: calc(1em + var(--ifm-navbar-height)); /* fixed header height*/
margin: calc(-1em * (1em + var(--ifm-navbar-height))) 0 0; /* negative fixed header height */
}
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
{{ range $index, $element := $paginator.Pages }} {{ range $index, $element := $paginator.Pages }}
<article class='post'> <article class='post'>
{{ partial "post_header_list.html" . }} {{ partial "post_header_list.html" . }}
{{ partial "toc.html" . }}
<section class='post-content'> <section class='post-content'>
{{.Content }} {{.Content }}
</section> </section>
......
{{ .TableOfContents }}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment