Skip to content

Commit

Permalink
docs(sidebar): Link size and unlink hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
tony committed Apr 26, 2022
1 parent ae49905 commit 72b3890
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
10 changes: 5 additions & 5 deletions docs/_static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ h4 {
}

.sidebar-tree p.indented-block {
padding: var(--sidebar-item-spacing-vertical) var(--sidebar-item-spacing-horizontal) 0 var(--sidebar-item-spacing-horizontal);
padding: var(--sidebar-item-spacing-vertical) var(--sidebar-item-spacing-horizontal) 0
var(--sidebar-item-spacing-horizontal);
margin-bottom: 0;
}

Expand All @@ -25,13 +26,12 @@ h4 {
display: block;
}

.sidebar-tree p.indented-block > :not(.project-name) {
font-size: var(--toc-font-size);
}

.sidebar-tree p.indented-block .project-name {
font-size: var(--sidebar-item-font-size);
font-weight: bold;
margin-right: calc(var(--sidebar-item-spacing-horizontal) / 2.5);
}

.sidebar-tree .active {
font-weight: bold;
}
17 changes: 16 additions & 1 deletion docs/_templates/sidebar/projects.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="sidebar-tree projects">
<div class="sidebar-tree projects" id="sidebar-projects">
<p class="caption" role="heading">
<span class="caption-text"
>team git-pull / <a href="https://www.git-pull.com/">Tony Narlock</a></span
Expand Down Expand Up @@ -29,3 +29,18 @@
</span>
</p>
</div>
<script type="text/javascript">
(() => {
console.log(window.location.hostname)
const sidebar = document.getElementById("sidebar-projects")
sidebar.querySelectorAll(`a[href*="${window.location.hostname}"]`)
.forEach((link) => {
if (!link.classList.contains("active")) {
const d = document.createElement('span');
d.innerHTML = link.innerHTML;
d.classList.add("active");
link.parentNode.replaceChild(d, link);
}
});
})()
</script>

0 comments on commit 72b3890

Please sign in to comment.