Layout: Post with Table Of Contents
Enable table of contents on post or page by adding toc: true
to its YAML Front Matter. The title and icon can also be changed with:
---
toc: true
toc_label: "Unique Title"
toc_icon: "heart" # corresponding Font Awesome icon name (without fa prefix)
---
HTML Elements
Below is just about everything you’ll need to style in the theme. Check the source code to see the many embedded elements within paragraphs.
Body text
Lorem ipsum dolor sit amet, test link adipiscing elit. This is strong. Nullam dignissim convallis est. Quisque aliquam.
This is emphasized. Donec faucibus. Nunc iaculis suscipit dui. 53 = 125. Water is H2O. Nam sit amet sem. Aliquam libero nisi, imperdiet at, tincidunt nec, gravida vehicula, nisl. The New York Times (That’s a citation). Underline.Maecenas ornare tortor. Donec sed tellus eget sapien fringilla nonummy. Mauris a ante. Suspendisse quam sem, consequat at, commodo vitae, feugiat in, nunc. Morbi imperdiet augue quis tellus.
HTML and CSS are our tools. Mauris a ante. Suspendisse quam sem, consequat at, commodo vitae, feugiat in, nunc. Morbi imperdiet augue quis tellus. Praesent mattis, massa quis luctus fermentum, turpis mi volutpat justo, eu volutpat enim diam eget metus.
Blockquotes
Lorem ipsum dolor sit amet, test link adipiscing elit. Nullam dignissim convallis est. Quisque aliquam.
List Types
Ordered Lists
- Item one
- sub item one
- sub item two
- sub item three
- Item two
Unordered Lists
- Item one
- Item two
- Item three
Tables
Header1 | Header2 | Header3 |
---|---|---|
cell1 | cell2 | cell3 |
cell4 | cell5 | cell6 |
cell1 | cell2 | cell3 |
cell4 | cell5 | cell6 |
Foot1 | Foot2 | Foot3 |
Code Snippets
#container {
float: left;
margin: 0 -240px 0 0;
width: 100%;
}
Buttons
Make any link standout more when applying the .btn
class.
<a href="#" class="btn btn--success">Success Button</a>
Notices
Watch out! You can also add notices by appending {: .notice}
to a paragraph.
Comments
jean
it would be nice if the table of content was sticky so it scrolls down with the user to ease navigation
Albus
+1 to jean. If only we can have toc in sidebar navigation so it sticks to the page end.
Mora
+1 to jean. Furthermore, for posts with no table to contents, it would be great to have a “sticky” post-specific sidebar with CTAs (like different ‘shares’ for the post - Twitter, Linkedin, FB, etc., #comments, post categories, post tags and subscribe - RSS, newsletter). Here is an example of such sidebar, despite non-sticky: https://www.feld.com/archives/2018/05/misty-ii-teardown.html And here is another example (with less CTAs, and also non-sticky): https://www.gatesnotes.com/Books/Leonardo-da-Vinci
Shahar Shani-Kadmiel
Making a sticky TOC sidebar is quite easy. I have made a separate blog post about it.
Matthew Dorey
Shahars’s sticky sidebar is great on firefox, but doesn’t work on Safari. I haven’t tested other browsers.
Michael Rose
@Matthew - that’s likely due to vendor prefixes missing from the CSS.
position: sticky
isn’t enough for webkit browsers like Safari.Leave a Comment
Your email address will not be published. Required fields are marked *