Skip to content

Commit 7402ba0

Browse files
committed
feat: Add hashtag to headings
1 parent 666ae45 commit 7402ba0

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

assets/css/v2/style.css

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,6 +1007,26 @@ h2 {
10071007
margin: 1rem 0 .75rem 0;
10081008
}
10091009

1010+
h2:has(a) {
1011+
width: calc(100% + 1rem);
1012+
margin-left: -1rem;
1013+
padding-left: 1rem;
1014+
}
1015+
1016+
h2:has(a):hover {
1017+
.headerlink::before {
1018+
display: block;
1019+
}
1020+
}
1021+
1022+
.headerlink::before {
1023+
position: absolute;
1024+
content: "#";
1025+
margin-left: -1.5rem;
1026+
opacity: 20%;
1027+
display: none;
1028+
}
1029+
10101030
/* MARK: Tables
10111031
*/
10121032
table {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<h{{ .Level }}
2-
id="{{ .Anchor | safeURL }}">{{ .Text | safeHTML }} <a class="headerlink float-right" href="#{{ .Anchor | safeURL }}" title="{{ .Text | safeHTML }}"><i class="fas fa-link fa-xs"></i></a>
2+
id="{{ .Anchor | safeURL }}"> <a class="headerlink float-right" href="#{{ .Anchor | safeURL }}" title="{{ .Text | safeHTML }}"><i class="fas fa-link fa-xs"></i></a> {{ .Text | safeHTML }}
33
</h{{ .Level }}>

0 commit comments

Comments
 (0)