Skip to content

Commit

Permalink
Add markdown-it-footnote plugin and update styles for footnotes (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
afnizarnur committed May 5, 2024
1 parent 2876ec3 commit 193be81
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const pluginNavigation = require("@11ty/eleventy-navigation")
const pluginSvgSprite = require("eleventy-plugin-svg-sprite")
const pluginPageAssets = require("eleventy-plugin-page-assets")
const markdownIt = require("markdown-it")
const markdownItFootnote = require("markdown-it-footnote")

const lodash = require("lodash")
const filters = require("./utils/filters.js")
Expand Down Expand Up @@ -58,7 +59,7 @@ module.exports = function (config) {
breaks: true,
linkify: true,
typographer: true
})
}).use(markdownItFootnote)
)

// Layouts
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"lodash": "^4.17.21",
"luxon": "^2.1.1",
"markdown-it": "^12.2.0",
"markdown-it-footnote": "^4.0.0",
"memfs": "^3.4.0",
"netlify-cli": "^17.23.1",
"node-fetch": "^3.3.1",
Expand Down
25 changes: 25 additions & 0 deletions src/assets/styles/components/_content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,31 @@
}
}

.footnotes-sep {
margin-top: 2.75rem;
margin-bottom: 2.75rem;
}

.footnotes {
ol {
font-size: 0.875rem;
line-height: 1.2rem;
font-weight: 520;
letter-spacing: -0.01rem;
}

.footnote-backref {
text-decoration: none;
}
}

.footnote-ref {
a {
text-decoration: none;
font-weight: 520;
}
}

code {
font-weight: 600;
}
Expand Down

0 comments on commit 193be81

Please sign in to comment.