Skip to content

Commit 72b3890

Browse files
committed
docs(sidebar): Link size and unlink hostname
1 parent ae49905 commit 72b3890

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

docs/_static/css/custom.css

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ h4 {
1616
}
1717

1818
.sidebar-tree p.indented-block {
19-
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);
2021
margin-bottom: 0;
2122
}
2223

@@ -25,13 +26,12 @@ h4 {
2526
display: block;
2627
}
2728

28-
.sidebar-tree p.indented-block > :not(.project-name) {
29-
font-size: var(--toc-font-size);
30-
}
31-
3229
.sidebar-tree p.indented-block .project-name {
3330
font-size: var(--sidebar-item-font-size);
3431
font-weight: bold;
3532
margin-right: calc(var(--sidebar-item-spacing-horizontal) / 2.5);
3633
}
3734

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

docs/_templates/sidebar/projects.html

+16-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,18 @@
2929
</span>
3030
</p>
3131
</div>
32+
<script type="text/javascript">
33+
(() => {
34+
console.log(window.location.hostname)
35+
const sidebar = document.getElementById("sidebar-projects")
36+
sidebar.querySelectorAll(`a[href*="${window.location.hostname}"]`)
37+
.forEach((link) => {
38+
if (!link.classList.contains("active")) {
39+
const d = document.createElement('span');
40+
d.innerHTML = link.innerHTML;
41+
d.classList.add("active");
42+
link.parentNode.replaceChild(d, link);
43+
}
44+
});
45+
})()
46+
</script>

0 commit comments

Comments
 (0)