Permalinks for website section heads (#272)

* Permalinks for website section heads

* Tabs vs spaces strikes again
This commit is contained in:
Anthony Atkinson
2023-11-08 04:43:40 -05:00
committed by GitHub
parent ca62dd3150
commit 1a5d1847b6
2 changed files with 22 additions and 0 deletions

View File

@@ -62,6 +62,18 @@ main.main-content,main.titlepage,div.footnotes{
padding:1rem; padding:1rem;
} }
.sectionHead a.permalink {
opacity: 0.5;
text-decoration: none;
font-size: 0.75rem;
vertical-align: top;
line-height: 0.8rem;
margin-left: 0.25rem;
padding-top: 0.2rem;
color: black;
display: inline-block;
}
p.indent, p.noindent{ p.indent, p.noindent{
text-indent: 0; text-indent: 0;
text-align: justify; text-align: justify;

View File

@@ -8,4 +8,14 @@ document.addEventListener('DOMContentLoaded', function() {
}); });
} }
}); });
// Add permalinks to headers
var heads = document.querySelectorAll('.sectionHead');
heads.forEach(function (head) {
let permalink = document.createElement("a");
permalink.href = '#' + head.id;
permalink.classList.add('permalink');
permalink.append('🔗');
head.append(permalink);
});
}); });