Skip to content

Commit 188b972

Browse files
committed
Merge pull request poole#84 from poole/footnotes
Add footnotes
2 parents 20d86be + e3b8aaa commit 188b972

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

_posts/2014-01-01-example-content.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,22 @@ HTML defines a long list of available inline tags, a complete list of which can
2727

2828
Most of these elements are styled by browsers with few modifications on our part.
2929

30+
## Footnotes
31+
32+
Footnotes are supported as part of the Markdown syntax. Here's one in action. Clicking this number[^fn-sample_footnote] will lead you to a footnote. The syntax looks like:
33+
34+
{% highlight text %}
35+
Clicking this number[^fn-sample_footnote]
36+
{% endhighlight %}
37+
38+
Each footnote needs the `^fn-` prefix and a unique ID to be referenced for the footnoted content. The syntax for that list looks something like this:
39+
40+
{% highlight text %}
41+
[^fn-sample_footnote]: Handy! Now click the return link to go back.
42+
{% endhighlight %}
43+
44+
You can place the footnoted content wherever you like. Markdown parsers should properly place it at the bottom of the post.
45+
3046
## Heading
3147

3248
Vivamus sagittis lacus vel augue rutrum faucibus dolor auctor. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.
@@ -136,3 +152,6 @@ Nullam id dolor id nibh ultricies vehicula ut id elit. Sed posuere consectetur e
136152
-----
137153

138154
Want to see something else added? <a href="https://github.com/poole/poole/issues/new">Open an issue.</a>
155+
156+
[^fn-sample_footnote]: Handy! Now click the return link to go back.
157+

_sass/_type.scss

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,25 @@ blockquote {
8888
}
8989

9090

91+
// Markdown footnotes
92+
//
93+
// See the example content post for an example.
94+
95+
// Footnote number within body text
96+
a[href^="#fn:"],
97+
// Back to footnote link
98+
a[href^="#fnref:"] {
99+
display: inline-block;
100+
margin-left: .1rem;
101+
font-weight: bold;
102+
}
103+
104+
// List of footnotes
105+
.footnotes {
106+
margin-top: 2rem;
107+
font-size: 85%;
108+
}
109+
91110
// Custom type
92111
//
93112
// Extend paragraphs with `.lead` for larger introductory text.

0 commit comments

Comments
 (0)