Added heading links.
This commit is contained in:
@@ -73,7 +73,7 @@ $primary: #0b2a37;
|
||||
.pageHeader {
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
.content h1, h2, h3, h4, h5, h6, .title {
|
||||
h1,h2,h3,h4,h5,h6,.title {
|
||||
font-weight: 300;
|
||||
}
|
||||
h2 a {
|
||||
@@ -88,4 +88,11 @@ h2 a {
|
||||
.separateWithCommas + .separateWithCommas:before {
|
||||
content: ", ";
|
||||
}
|
||||
// /Custom styles
|
||||
.content h1, .content h2, .content h3, .content h4, .content h5, .content h6, .content .title {
|
||||
font-weight: 300;
|
||||
}
|
||||
.header-link {
|
||||
margin-right: 5px;
|
||||
color: $link;
|
||||
}
|
||||
// /Custom styles
|
||||
@@ -0,0 +1,10 @@
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const headings = document.querySelectorAll(".content h1, .content h2, .content h3, .content h4, .content h5, .content h6");
|
||||
headings.forEach(e => {
|
||||
const a = document.createElement("a");
|
||||
a.href = "#" + e.id;
|
||||
a.innerText = "#";
|
||||
a.classList.add("header-link");
|
||||
e.prepend(a);
|
||||
});
|
||||
});
|
||||
@@ -11,6 +11,7 @@
|
||||
<meta name="theme-color" content="#0b2a37">
|
||||
{{- end }}
|
||||
{{ block "js" . -}}
|
||||
{{ partial "js.html" "js/headerLink.js" }}
|
||||
{{ partial "js.html" "js/patek-logo-custom-element/patekLogo.js" }}
|
||||
{{ end }}
|
||||
<body>
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
<h2 class="title pageTitle"><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
|
||||
<p class="has-text-grey">{{- T "published" -}}: <time>{{ .PublishDate.Format "02.01.2006 15:04" }}</time></p>
|
||||
<p class="has-text-grey">
|
||||
{{- T "author" -}}:{{ range .Params.authors }}{{ with $.Site.GetPage (printf "authors/%s" .) }}<a class="separateWithCommas" href="{{ .Permalink }}">{{ .Title }}</a>{{ end }}{{ end }}
|
||||
{{- T "author" -}}: {{ range .Params.authors }}{{ with $.Site.GetPage (printf "authors/%s" .) }}<a class="separateWithCommas" href="{{ .Permalink }}">{{ .Title }}</a>{{ end }}{{ end }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user