mirror of
https://github.com/GTFOBins/GTFOBins.github.io
synced 2024-12-25 06:19:27 +01:00
Add permalinks for headings
This commit is contained in:
parent
2d1c051d1c
commit
5a6b10911b
@ -19,5 +19,14 @@
|
||||
</head>
|
||||
<body>
|
||||
{{ content }}
|
||||
<script>
|
||||
// add permalink on headings
|
||||
document.querySelectorAll('h2, h3, h4, h5, h5').forEach((heading) => {
|
||||
const link = document.createElement('a');
|
||||
link.className = 'permalink';
|
||||
link.href = `#${heading.id}`;
|
||||
heading.appendChild(link);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
26
style.scss
26
style.scss
@ -46,11 +46,29 @@ a:hover {
|
||||
color: $hover;
|
||||
}
|
||||
|
||||
// fragment targets
|
||||
// permalink on headings
|
||||
|
||||
*:target {
|
||||
border-left: 5px solid $accent;
|
||||
padding-left: 5px;
|
||||
h2, h3, h4, h5, h5 {
|
||||
.permalink {
|
||||
margin-left: 5px;
|
||||
text-decoration: none;
|
||||
visibility: hidden;
|
||||
|
||||
&::before {
|
||||
content: "#";
|
||||
}
|
||||
}
|
||||
|
||||
&:target {
|
||||
border-left: 5px solid $accent;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
.permalink {
|
||||
visibility: visible;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// binary list and search
|
||||
|
Loading…
Reference in New Issue
Block a user