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 48eda47 commit a4f09c8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
13 changes: 5 additions & 8 deletions docs/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
h2 {
font-size: 2rem;
margin-bottom: 1.25rem;
margin-top: 1.25rem;
scroll-margin-top: 0.5rem;
}

h3 {
font-size: 1.5rem;
margin-bottom: 1.25rem;
margin-top: 1.25rem;
scroll-margin-top: 0.5rem;
}

h4 {
font-size: 1.25rem;
margin-bottom: 1.25rem;
scroll-margin-top: 0.5rem;
}

.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 @@ -28,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 a4f09c8

Please sign in to comment.