Commit 2ba20754 authored by deing's avatar deing

Add ToC support

parent 1b65cdf2
......@@ -36,7 +36,7 @@ echo [build.sh] Running pandoc for slugs…
FILES=$(find src/md -type f)
for FILE in $FILES
do
pandoc --template=src/template.html $FILE -o public/$(echo $FILE | sed -r "s/src\/md\/(.+)\.md/\1/")/index.html
pandoc --toc --template=src/template.html $FILE -o public/$(echo $FILE | sed -r "s/src\/md\/(.+)\.md/\1/")/index.html
done
mv public/index/index.html public/index.html
......
@media screen and (max-width: 75ch)
@media screen and (max-width: 130ch)
body
main
width: 100%
padding: 0
details.toc
position: fixed
background-color: #44475a
top: 0
left: 0
width: 100%
summary
list-style: none
padding: .5rem
text-align: center
color: #f8f8f2
&::before
content: '» Tap here for '
&::after
content: ' «'
&[open] summary
font-weight: bold
&::before
content: '« Tap here to close '
&::after
content: ' »'
ul
li
display: inline-block
padding: .3rem
a
color: #bd93f9
li > ul > li > ul > li > a
color: #8be9fd
article
margin-top: 2.5rem
display: block
max-width: 70ch
h2
......
......@@ -17,11 +17,13 @@ body
font-size: 1rem
margin: .4rem 0 .4rem 0
line-height: 1.5
h2
h2, h3
border-bottom: 3px solid #44475a
&:target
border-bottom: 3px solid #ffb86c
h2
text-transform: uppercase
h3
border-bottom: 3px solid #44475a
display: inline-block
code
padding: 2px
......@@ -73,7 +75,25 @@ body
list-style-type: none
display: inline
hr
display: none
display: none
details.toc
width: 30ch
position: fixed
top: 1rem
left: 1rem
&> ul > li > a
display: none
ul
padding: 0
li
list-style-type: none
li li
padding-left: 1ch
summary
text-transform: uppercase
font-size: 1rem
margin: 0
cursor: pointer
@import '_desktop.sass'
@import '_mobile.sass'
......@@ -86,21 +106,7 @@ body
src: url("la_b.woff2")
font-family: "lato"
font-weight: bold
@font-face
src: url("pl_it.woff2")
font-family: "plex"
font-weight: normal
font-style: italic
@font-face
src: url("pl_re.woff2")
font-family: "plex"
font-weight: normal
@font-face
src: url("pl_b.woff2")
font-family: "plex"
font-weight: bold
@font-face
src: url("pl_b_it.woff2")
font-family: "plex"
font-weight: bold
@font-face
src: url("la_it.woff2")
font-family: "lato"
font-style: italic
\ No newline at end of file
......@@ -15,10 +15,13 @@
</head>
<body>
<main>
$if(includetoc)$
<details class="toc">
<summary>Table of Contents</summary>
$toc$
</details>
$endif$
<article>
$if(intro)$
<p class="intro">$intro$</p>
$endif$
$body$
</article>
<footer>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment