diff --git a/.eleventy.js b/.eleventy.js index 387343d..7bc3f71 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -15,8 +15,13 @@ module.exports = config => { html: true }; + let headingOptions = { + prefixHeadingIds: false, + className: "heading-anchor" + }; + config.setLibrary("md", - markdownIt(options).use(markdownItScrollable).use(markdownItHeadings)); + markdownIt(options).use(markdownItScrollable).use(markdownItHeadings, headingOptions)); const paths = [ 'main/assets', diff --git a/main/css/page.css b/main/css/page.css index d326aba..95d7b3d 100644 --- a/main/css/page.css +++ b/main/css/page.css @@ -40,11 +40,11 @@ div.contents a::before { margin-right: 0em; } -a[id*="user-content-"]::before { +a[class="heading-anchor"]::before { display: none; } -a[id*="user-content-"] svg { +a[class="heading-anchor"] svg { fill: #e5adea; margin-right: 5px; margin-left: -21px; @@ -52,7 +52,7 @@ a[id*="user-content-"] svg { transition: opacity 0.2s ease-in-out; } -:is(h1, h2, h3, h4, h5, h6):hover a[id*="user-content-"] svg { +:is(h1, h2, h3, h4, h5, h6):hover a[class="heading-anchor"] svg { opacity: 80%; transition: opacity 0.2s ease-in-out; } @@ -264,8 +264,8 @@ pre > code:not([class]) { padding-right: 0.5em; } - a[id*="user-content-"] { - margin-left: 0; + a[class="heading-anchor"] { + margin-left: 21px; float: right; } } \ No newline at end of file