updt: <h2> rendering

This commit is contained in:
Junyi Hou 2024-03-04 14:51:17 +08:00
parent 28434af973
commit 6daffab512
2 changed files with 12 additions and 7 deletions

View File

@ -79,6 +79,11 @@ h1 {
h2 { h2 {
font-size: 1.2em; font-size: 1.2em;
margin-top: 3em;
}
h2:first-of-type {
margin-top: 0;
} }
h3 { h3 {
@ -415,9 +420,8 @@ article header h1 a {
.post h4 a, .post h4 a,
.post h5 a, .post h5 a,
.post h6 a { .post h6 a {
opacity: 0; opacity: 1;
position: absolute; border-bottom: none;
left: -1.2rem;
} }
.post h1:hover a, .post h1:hover a,

View File

@ -1,7 +1,8 @@
<h{{ .Level }} id="{{ .Anchor | safeURL }}" {{ if .Attributes.style }}style="{{ .Attributes.style | safeCSS }}"{{ end }}>{{ .Text | safeHTML }} <h{{ .Level }} id="{{ .Anchor | safeURL }}" {{ if .Attributes.style }}style="{{ .Attributes.style | safeCSS }}"{{ end }}>
<span> <div>
<a href="#{{ .Anchor }}"> <a href="#{{ .Anchor }}">
<svg viewBox="0 0 28 23" height="100%" width="19" xmlns="http://www.w3.org/2000/svg"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" fill="none" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" fill="none" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2"/></svg> {{ range seq 2 .Level}}#{{end}}
</a> </a>
</span> {{ .Text | safeHTML }}
</div>
</h{{ .Level }}> </h{{ .Level }}>