add an anchor tag for heading tags
This commit is contained in:
parent
74d8389340
commit
5204b6f0ce
2 changed files with 15 additions and 0 deletions
7
new-site/layouts/_default/_markup/render-heading.html
Normal file
7
new-site/layouts/_default/_markup/render-heading.html
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<h{{ .Level }} id="{{ .Anchor | safeURL }}">{{ .Text | safeHTML }}
|
||||||
|
{{- if and (ge .Level 1) (le .Level 6) }}{{" " -}}
|
||||||
|
<a class="anchor" href="#{{ .Anchor | safeURL }}">
|
||||||
|
<span class="spanForHeader">#</span>
|
||||||
|
</a>
|
||||||
|
{{- end -}}
|
||||||
|
</h{{ .Level }}>
|
|
@ -117,3 +117,11 @@ pre {
|
||||||
max-width: 800px;
|
max-width: 800px;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.spanForHeader{
|
||||||
|
color: rgba(0, 255, 255, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
.spanForHeader:hover{
|
||||||
|
color: cyan;
|
||||||
|
}
|
Loading…
Reference in a new issue