added hideInSidebare option to docs sidebar

This commit is contained in:
trean
2023-06-14 16:19:54 +02:00
parent ba4ea92eff
commit 560cc40ec0
2 changed files with 14 additions and 4 deletions
+11 -1
View File
@@ -108,4 +108,14 @@ cd qdrant-landing
hugo new --kind external-link documentation/<link-title>.md
```
It will create a file `content/documentation/<link-title>.md`. Open it and set the `external_link` parameter to the desired value.
It will create a file `content/documentation/<link-title>.md`. Open it and set the `external_link` parameter to the desired value.
### Params
Additionally, to the standard hugo front matter params, we have the following params:
```yaml
hideInSidebar: true
```
If `true`, the page will not be shown in the sidebar. It can be used in regular documentation pages and in documentation section pages (_index.md).
@@ -17,7 +17,7 @@
<h5 class="documentation__sidebar-delimiter">{{ .Title }}</h5>
{{ else }}
{{ if .IsPage }}
{{ if and (.IsPage) (not .Params.hideInSidebar) }}
<div class="link-group {{ if eq .File.UniqueID $currentNode.File.UniqueID }}active {{ end }}">
<div class="link-group-heading">
@@ -37,7 +37,7 @@
{{ end }}
{{ if .IsSection }}
{{ if and (.IsSection) (not .Params.hideInSidebar) }}
<!-- current page is active or any sub-page is active -->
{{ $isActive := false }}
@@ -78,7 +78,7 @@
<i class="link-group__icon fas fa-external-link-alt"></i>
</a>
</li>
{{ else }}
{{ else if not .Params.hideInSidebar }}
<li class="{{ if eq .File.UniqueID $currentNode.File.UniqueID }}active {{ end }}"><a href="{{ .Permalink }}">{{ .Title }}</a></li>
{{ end }}
{{ end }}