Skip to content

Commit

Permalink
Merge pull request #604 from rjawesome/update-sidenav
Browse files Browse the repository at this point in the history
Update sidenav so pages are smaller
  • Loading branch information
andrewsu authored Jun 28, 2023
2 parents 83b7a25 + f876464 commit 4664967
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 6 deletions.
2 changes: 0 additions & 2 deletions _includes/sidebar.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{% assign sidebar = site.data.sidebars[page.sidebar].entries %}

<ul id="mysidebar" class="nav">
<li class="sidebarTitle">{{sidebar[0].product}} {{sidebar[0].version}}</li>
{% for entry in sidebar %}
Expand Down
11 changes: 7 additions & 4 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
<head>
{% include head.html %}
<script>
$(document).ready(function() {

fetch("sidebar-{{page.sidebar}}.html")
.then(resp => resp.text())
.then(html => document.getElementById("tg-sb-sidebar").innerHTML = html)
.then(function () {
// Initialize navgoco with default options
$("#mysidebar").navgoco({
caretHtml: '',
Expand All @@ -30,8 +34,7 @@
e.preventDefault();
$("#mysidebar").navgoco('toggle', true);
});

});
})

</script>
<script>
Expand Down Expand Up @@ -83,7 +86,7 @@
{% unless page.hide_sidebar %}
<!-- Sidebar Column -->
<div class="col-md-3" id="tg-sb-sidebar">
{% include sidebar.html %}

</div>
{% assign content_col_size = "col-md-9" %}
{% endunless %}
Expand Down
8 changes: 8 additions & 0 deletions pages/sidebar-home_sidebar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
layout: none
permalink: sidebar-home_sidebar.html
---

{% assign sidebar = site.data.sidebars["home_sidebar"].entries %}

{% include sidebar.html %}
8 changes: 8 additions & 0 deletions pages/sidebar-mydoc_sidebar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
layout: none
permalink: sidebar-mydoc_sidebar.html
---

{% assign sidebar = site.data.sidebars["mydoc_sidebar"].entries %}

{% include sidebar.html %}
8 changes: 8 additions & 0 deletions pages/sidebar-other.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
layout: none
permalink: sidebar-other.html
---

{% assign sidebar = site.data.sidebars["other"].entries %}

{% include sidebar.html %}
8 changes: 8 additions & 0 deletions pages/sidebar-product1_sidebar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
layout: none
permalink: sidebar-product1_sidebar.html
---

{% assign sidebar = site.data.sidebars["product1_sidebar"].entries %}

{% include sidebar.html %}
8 changes: 8 additions & 0 deletions pages/sidebar-product2_sidebar.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
layout: none
permalink: sidebar-product2_sidebar.html
---

{% assign sidebar = site.data.sidebars["product2_sidebar"].entries %}

{% include sidebar.html %}

0 comments on commit 4664967

Please sign in to comment.