on master help sign in
Remove content nav toggle on non-doc/post content
commitb8fd5f63bcd955f1b97507cb4ed23493312d00c8 authorMatilde Park <matilde@park.computer> dateWed 7 Aug 2019, 12:59 (7 years ago) parent8ef328e
2 files changed+13
sass/_responsive.scss+3 static/scripts.js+10
sass/_responsive.scss+3
@@ -19,6 +19,9 @@
1919 }
2020 .content-nav-icon {
2121 display: block;
22+ &.none {
23+ display: none;
24+ }
2225 }
2326 .content, .content-spacer {
2427 flex-basis: 90%;
static/scripts.js+10
@@ -7,6 +7,16 @@ if (toggleMainNav !== null) {
77}
88
99var toggleContentNav = document.getElementById('js-content-nav-toggle');
10+
11+// Only show the content nav for docs or posts
12+let navEnabledSections = ['docs', 'posts']
13+let showNav = false
14+for (let section of navEnabledSections) {
15+ window.location.href.includes(section) ? showNav = true : null
16+}
17+showNav ? null : toggleContentNav.classList.add('none')
18+
19+
1020if (toggleContentNav !== null) {
1121 toggleContentNav.onclick = function() {
1222 document.body.classList.toggle('has-active-content-nav');