Adding a feature to support hiding sidebar on pages
This commit is contained in:
@ -40,7 +40,8 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
{% endif %}
|
</li>
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<!-- if you aren't using the accordion, uncomment this block:
|
<!-- if you aren't using the accordion, uncomment this block:
|
||||||
@ -48,9 +49,7 @@
|
|||||||
<a href="#" id="collapseAll">Collapse All</a> | <a href="#" id="expandAll">Expand All</a>
|
<a href="#" id="collapseAll">Collapse All</a> | <a href="#" id="expandAll">Expand All</a>
|
||||||
</p>
|
</p>
|
||||||
-->
|
-->
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- this highlights the active parent class in the navgoco sidebar. this is critical so that the parent expands when you're viewing a page. This must appear below the sidebar code above. Otherwise, if placed inside customscripts.js, the script runs before the sidebar code runs and the class never gets inserted.-->
|
<!-- this highlights the active parent class in the navgoco sidebar. this is critical so that the parent expands when you're viewing a page. This must appear below the sidebar code above. Otherwise, if placed inside customscripts.js, the script runs before the sidebar code runs and the class never gets inserted.-->
|
||||||
<script>$("li.active").parents('li').toggleClass("active");</script>
|
<script>$("li.active").parents('li').toggleClass("active");</script>
|
||||||
|
@ -62,7 +62,7 @@
|
|||||||
searchInput: document.getElementById('search-input'),
|
searchInput: document.getElementById('search-input'),
|
||||||
resultsContainer: document.getElementById('results-container'),
|
resultsContainer: document.getElementById('results-container'),
|
||||||
dataSource: '{{ "search.json" }}',
|
dataSource: '{{ "search.json" }}',
|
||||||
searchResultTemplate: '<li><a href="{url}" title="{{page.title | replace: "'", "\"}}">{title}</a></li>',
|
searchResultTemplate: '<li><a href="{url}" title="{{page.title | replace: "\'", "\"}}">{title}</a></li>',
|
||||||
noResultsText: '{{site.data.strings.search_no_results_text}}',
|
noResultsText: '{{site.data.strings.search_no_results_text}}',
|
||||||
limit: 10,
|
limit: 10,
|
||||||
fuzzy: true,
|
fuzzy: true,
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
<head>
|
<head>
|
||||||
{% include head.html %}
|
{% include head.html %}
|
||||||
<script>
|
<script>
|
||||||
@ -78,14 +79,19 @@
|
|||||||
<div class="col-lg-12"> </div>
|
<div class="col-lg-12"> </div>
|
||||||
<!-- Content Row -->
|
<!-- Content Row -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<!-- Sidebar Column -->
|
{% assign content_col_size = "col-md-12" %}
|
||||||
<div class="col-md-3" id="tg-sb-sidebar">
|
{% 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 %}
|
||||||
|
|
||||||
{% include sidebar.html %}
|
<!-- Content Column -->
|
||||||
<!-- Content Column -->
|
<div class="{{content_col_size}}" id="tg-sb-content">
|
||||||
<div class="col-md-9" id="tg-sb-content">
|
{{content}}
|
||||||
{{content}}
|
</div>
|
||||||
</div>
|
|
||||||
<!-- /.row -->
|
<!-- /.row -->
|
||||||
</div>
|
</div>
|
||||||
<!-- /.container -->
|
<!-- /.container -->
|
||||||
|
2
index.md
2
index.md
@ -138,6 +138,8 @@ Note that your sidebar can only have 2 levels. Given that each product has its o
|
|||||||
|
|
||||||
{% include note.html content="Note that each level must have at least one topic before the next level starts. You can't have a second level that contains multiple third levels without having at least one standalone topic in the second level." %}
|
{% include note.html content="Note that each level must have at least one topic before the next level starts. You can't have a second level that contains multiple third levels without having at least one standalone topic in the second level." %}
|
||||||
|
|
||||||
|
You can optionally turn off the sidebar on any page (e.g. landing pages). To turn off the sidebar for a page, you should set the page frontmatter tag as `hide_sidebar: true`.
|
||||||
|
|
||||||
For more detail on the sidebar, see [Sidebar navigation][mydoc_sidebar_navigation].
|
For more detail on the sidebar, see [Sidebar navigation][mydoc_sidebar_navigation].
|
||||||
|
|
||||||
## Sidebar syntax
|
## Sidebar syntax
|
||||||
|
Reference in New Issue
Block a user