mirror of
https://github.com/hendricius/the-sourdough-framework
synced 2025-11-10 05:01:11 -06:00
Permalinks for website section heads (#272)
* Permalinks for website section heads * Tabs vs spaces strikes again
This commit is contained in:
@@ -62,6 +62,18 @@ main.main-content,main.titlepage,div.footnotes{
|
||||
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{
|
||||
text-indent: 0;
|
||||
text-align: justify;
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user