Skip to content

Commit f09f1fe

Browse files
authored
Merge pull request #10 from SignPath/header-id-links
adds header links
2 parents 2996352 + 483fb7e commit f09f1fe

File tree

6 files changed

+33
-3
lines changed

6 files changed

+33
-3
lines changed

docs/_includes/header.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
<meta name="description" content="{{description}}"/>
3737
<!-- End Jekyll SEO tag -->
3838
<link rel='stylesheet' href='/assets/css/hint.min.css'>
39-
<link rel="stylesheet" href="/assets/css/index.css?cache=2025-05-15">
39+
<link rel="stylesheet" href="/assets/css/index.css?cache=2025-08-29">
4040
<link rel="alternate" type="application/atom+xml" title="SignPath Blog" href="/feed.xml">
4141
<script src='/assets/index.js?cache=2024-12-18'></script>
42-
<script src='/assets/js/main-bundle.js?cache=2025-03-06'></script>
42+
<script src='/assets/js/main-bundle.js?cache=2025-08-29'></script>
4343
{%- if page.redirhack != null -%}
4444
<!-- 404 redirect -->
4545
<script>

docs/_sass/headerlinks.scss

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.headerlink {
2+
a.link {
3+
display:none;
4+
color: $dark-grey-font-color;
5+
text-decoration: none;
6+
margin-left: 5px;
7+
}
8+
9+
&:hover {
10+
a.link {
11+
display: inline-block;
12+
}
13+
}
14+
}

docs/assets/css/index.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
'product-column-layout.scss',
2727
'svg.scss',
2828
'changelog.scss',
29+
'headerlinks.scss',
2930
'carousel.scss',
3031
'image.scss',
3132
'search.scss'

docs/assets/js/main-bundle.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webpack/headerlinks.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export function headerlinks() {
2+
document.querySelectorAll("article h1,h2,h3").forEach(headerElem => {
3+
let headerId = headerElem.id;
4+
if (headerId) {
5+
headerElem.classList.add("headerlink");
6+
var a = document.createElement('a');
7+
a.className = 'link';
8+
a.innerHTML = '#';
9+
a.href=`#${headerId}`
10+
headerElem.appendChild(a);
11+
}
12+
});
13+
}

webpack/main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ import {cookieBanner} from "./cookie.js";
22
import {changelog} from "./changelog.js";
33
import {carousel} from "./carousel.js";
44
import {search} from "./search.js";
5+
import {headerlinks} from "./headerlinks.js";
56

67
document.addEventListener('DOMContentLoaded', function () {
78
cookieBanner();
89
changelog();
910
carousel();
1011
search();
12+
headerlinks();
1113
});

0 commit comments

Comments
 (0)