Skip to content

Commit 9d2552c

Browse files
committed
docs(sidebar): Link size and unlink hostname
1 parent 48eda47 commit 9d2552c

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

docs/_static/css/custom.css

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
11
h2 {
2-
font-size: 2rem;
32
margin-bottom: 1.25rem;
43
margin-top: 1.25rem;
54
scroll-margin-top: 0.5rem;
65
}
76

87
h3 {
9-
font-size: 1.5rem;
108
margin-bottom: 1.25rem;
119
margin-top: 1.25rem;
1210
scroll-margin-top: 0.5rem;
1311
}
1412

1513
h4 {
16-
font-size: 1.25rem;
1714
margin-bottom: 1.25rem;
1815
scroll-margin-top: 0.5rem;
1916
}
2017

2118
.sidebar-tree p.indented-block {
22-
padding: var(--sidebar-item-spacing-vertical) var(--sidebar-item-spacing-horizontal) 0 var(--sidebar-item-spacing-horizontal);
19+
padding: var(--sidebar-item-spacing-vertical) var(--sidebar-item-spacing-horizontal) 0
20+
var(--sidebar-item-spacing-horizontal);
2321
margin-bottom: 0;
2422
}
2523

@@ -28,13 +26,12 @@ h4 {
2826
display: block;
2927
}
3028

31-
.sidebar-tree p.indented-block > :not(.project-name) {
32-
font-size: var(--toc-font-size);
33-
}
34-
3529
.sidebar-tree p.indented-block .project-name {
3630
font-size: var(--sidebar-item-font-size);
3731
font-weight: bold;
3832
margin-right: calc(var(--sidebar-item-spacing-horizontal) / 2.5);
3933
}
4034

35+
.sidebar-tree .active {
36+
font-weight: bold;
37+
}

docs/_templates/sidebar/projects.html

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="sidebar-tree projects">
1+
<div class="sidebar-tree projects" id="sidebar-projects">
22
<p class="caption" role="heading">
33
<span class="caption-text"
44
>team git-pull / <a href="https://www.git-pull.com/">Tony Narlock</a></span
@@ -29,3 +29,17 @@
2929
</span>
3030
</p>
3131
</div>
32+
<script type="text/javascript">
33+
(() => {
34+
const sidebar = document.getElementById("sidebar-projects")
35+
sidebar.querySelectorAll(`a[href*="${window.location.hostname}"]`)
36+
.forEach((link) => {
37+
if (!link.classList.contains("active")) {
38+
const d = document.createElement('span');
39+
d.innerHTML = link.innerHTML;
40+
d.classList.add("active");
41+
link.parentNode.replaceChild(d, link);
42+
}
43+
});
44+
})()
45+
</script>

0 commit comments

Comments
 (0)