Skip to content

Commit

Permalink
Include TOC
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoWinterhalter committed Oct 18, 2024
1 parent 505e3a6 commit cec3956
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/webpage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
--output=website/index.html
--template=pandoc/template.html4
--css=style.css
--toc
--toc-depth=2
--resource-path=.
src/index.md
Expand Down
16 changes: 10 additions & 6 deletions pandoc/template.html4
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,23 @@ $endif$
$endif$
</aside>
</header>
<main>
$for(include-before)$
$include-before$
$endfor$
$if(toc)$
$if(toc)$
<nav>
<div id="$idprefix$TOC">
$if(toc-title)$
<h2 id="$idprefix$toc-title">$toc-title$</h2>
$endif$
$table-of-contents$
</div>
$endif$
</nav>
$endif$
<main>
$for(include-before)$
$include-before$
$endfor$

$body$

$for(include-after)$
$include-after$
$endfor$
Expand Down

0 comments on commit cec3956

Please sign in to comment.