fix: fixed footer links
This commit is contained in:
parent
748a0b6589
commit
a46e05e377
2 changed files with 26 additions and 1 deletions
|
|
@ -299,11 +299,23 @@ a {
|
|||
margin-bottom: var(--space-tight);
|
||||
}
|
||||
|
||||
.footnote-ref {
|
||||
vertical-align: super;
|
||||
font-size: 0.75em;
|
||||
line-height: 0;
|
||||
}
|
||||
|
||||
.footnote-ref a {
|
||||
color: var(--color-text-link);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
sup {
|
||||
vertical-align: super;
|
||||
font-size: 0.75em;
|
||||
line-height: 0;
|
||||
}
|
||||
|
||||
.footnote-backref {
|
||||
margin-left: var(--space-tight);
|
||||
text-decoration: none;
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ const sharedPlugins = [
|
|||
markdownItFootnote,
|
||||
markdownItHashtag,
|
||||
markdownItMermaid,
|
||||
[markdownItTaskLists, { enabled: true, label: true, labelAfter: true }],
|
||||
[markdownItTaskLists, { enabled: true, label: true, labelAfter: false }],
|
||||
markdownItDetails,
|
||||
];
|
||||
|
||||
|
|
@ -188,6 +188,19 @@ const createMarkdownInstance = (extraPlugins = []) => {
|
|||
|
||||
const md = createMarkdownInstance([markdownItStripTrailingHashtags]);
|
||||
|
||||
// Customize footnote rendering to remove brackets
|
||||
md.renderer.rules.footnote_ref = (tokens, idx, options, env, slf) => {
|
||||
const id = slf.rules.footnote_anchor_name(tokens, idx, options, env, slf);
|
||||
const n = Number(tokens[idx].meta.id + 1).toString();
|
||||
let refid = id;
|
||||
|
||||
if (tokens[idx].meta.subId > 0) {
|
||||
refid += ':' + tokens[idx].meta.subId;
|
||||
}
|
||||
|
||||
return '<sup class="footnote-ref"><a href="#fn' + id + '" id="fnref' + refid + '">' + n + '</a></sup>';
|
||||
};
|
||||
|
||||
const tagExtractorMd = createMarkdownInstance();
|
||||
|
||||
module.exports = (eleventyConfig) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue