added structure for reference navigation

pull/21/head
Scott Anderson 2019-01-21 08:57:35 -07:00
parent 117a18d387
commit 1a2dbc0e64
5 changed files with 129 additions and 1 deletions

View File

@ -240,3 +240,26 @@ to seeing the full content block.
Truncated markdown content here.
{{% /truncate %}}
```
### Reference content
The InfluxDB documentation is "task-based," meaning content primarily focuses on
what a user is **doing**, not what they are **using**.
However, there is a need to document tools and other things that don't necessarily
fit in the task-based style.
This is referred to as "reference content."
Reference content is styled just as the rest of the InfluxDB documentation.
The only difference is the `menu` reference in the page's frontmatter.
When defining the menu for reference content, use the following pattern:
```yaml
# Pattern
menu:
v<major-version-number>_<minor-version-number>_ref:
# ...
# Example
menu:
v2_0_ref:
# ...
```

View File

@ -1,6 +1,10 @@
///////////////////////////// Make headers linkable /////////////////////////////
$("h2,h3,h4,h5,h6").each(function() {
$(".article--content h2, \
.article--content h3, \
.article--content h4, \
.article--content h5, \
.article--content h6" ).each(function() {
var link = "<a href=\"#" + $(this).attr("id") + "\"></a>"
$(this).wrapInner( link );
})

View File

@ -207,6 +207,17 @@
&:after { transform: rotate(180deg); }
}
}
// Reference title styles
h4 {
margin: 2rem 0 0 -1rem;
color: rgba($article-heading, .8);
font-style: italic;
font-weight: 700;
text-transform: uppercase;
font-size: .85rem;
letter-spacing: .08rem;
}
}
}

View File

@ -0,0 +1,11 @@
---
title: Command line tools
seotitle: Command line tools for managing InfluxDB
description: InfluxDB comes with command line tools meant to aid in managing and working with InfluxDB.
menu:
v2_0_ref:
name: Command line tools
weight: 1
---
_Placeholder for command line content._

View File

@ -97,5 +97,84 @@
{{ end }}
</li>
{{end}}
<!-- Reference Section -->
{{ $refMenuID := print (replaceRE "[.]" "_" $currentVersion) "_ref" }}
<h4 class="reference">Reference</h4>
{{ range (index .Site.Menus $refMenuID) }}
<!-- Nested Reference Navigation -->
<li class="nav-category {{ if .HasChildren }}parent{{ end }} {{ if or ($currentPage.IsMenuCurrent .Menu .) ($currentPage.HasMenuCurrent .Menu .) }}active{{end}}">
{{ if .HasChildren }}<a href="#" class="children-toggle {{ if .HasChildren }}parent{{ end }} {{ if or ($currentPage.IsMenuCurrent .Menu .) ($currentPage.HasMenuCurrent .Menu .) }}open{{end}}"></a>{{ end }}
<a href="{{ .URL }}">{{ .Name }}</a>
{{ if .HasChildren }}
<ul class="children {{ if .HasChildren }}parent{{ end }} {{ if or ($currentPage.IsMenuCurrent .Menu .) ($currentPage.HasMenuCurrent .Menu .) }}open{{end}}">
{{ range .Children }}
<li class="nav-item {{ if .HasChildren }}parent{{ end }} {{ if or ($currentPage.IsMenuCurrent .Menu .) ($currentPage.HasMenuCurrent .Menu .) }}active{{end}}">
{{ if .HasChildren }}<a href="#" class="children-toggle {{ if .HasChildren }}parent{{ end }} {{ if or ($currentPage.IsMenuCurrent .Menu .) ($currentPage.HasMenuCurrent .Menu .) }}open{{end}}"></a>{{ end }}
<a href="{{ .URL }}">{{ .Name }}</a>
{{ if .HasChildren }}
<ul class="children {{ if .HasChildren }}parent{{ end }} {{ if or ($currentPage.IsMenuCurrent .Menu .) ($currentPage.HasMenuCurrent .Menu .) }}open{{end}}">
{{ range .Children }}
<li class="nav-item {{ if .HasChildren }}parent{{ end }} {{ if or ($currentPage.IsMenuCurrent .Menu .) ($currentPage.HasMenuCurrent .Menu .) }}active{{end}}">
{{ if .HasChildren }}<a href="#" class="children-toggle {{ if .HasChildren }}parent{{ end }} {{ if or ($currentPage.IsMenuCurrent .Menu .) ($currentPage.HasMenuCurrent .Menu .) }}open{{end}}"></a>{{ end }}
<a href="{{ .URL }}">{{ .Name }}</a>
{{ if .HasChildren }}
<ul class="children {{ if .HasChildren }}parent{{ end }} {{ if or ($currentPage.IsMenuCurrent .Menu .) ($currentPage.HasMenuCurrent .Menu .) }}open{{end}}">
{{ range .Children }}
<li class="nav-item {{ if .HasChildren }}parent{{ end }} {{ if or ($currentPage.IsMenuCurrent .Menu .) ($currentPage.HasMenuCurrent .Menu .) }}active{{end}}">
{{ if .HasChildren }}<a href="#" class="children-toggle {{ if .HasChildren }}parent{{ end }} {{ if or ($currentPage.IsMenuCurrent .Menu .) ($currentPage.HasMenuCurrent .Menu .) }}open{{end}}"></a>{{ end }}
<a href="{{ .URL }}">{{ .Name }}</a>
{{ if .HasChildren }}
<ul class="children {{ if .HasChildren }}parent{{ end }} {{ if or ($currentPage.IsMenuCurrent .Menu .) ($currentPage.HasMenuCurrent .Menu .) }}open{{end}}">
{{ range .Children }}
<li class="nav-item {{ if .HasChildren }}parent{{ end }} {{ if or ($currentPage.IsMenuCurrent .Menu .) ($currentPage.HasMenuCurrent .Menu .) }}active{{end}}">
{{ if .HasChildren }}<a href="#" class="children-toggle {{ if .HasChildren }}parent{{ end }} {{ if or ($currentPage.IsMenuCurrent .Menu .) ($currentPage.HasMenuCurrent .Menu .) }}open{{end}}"></a>{{ end }}
<a href="{{ .URL }}">{{ .Name }}</a>
{{ if .HasChildren }}
<ul class="children {{ if .HasChildren }}parent{{ end }} {{ if or ($currentPage.IsMenuCurrent .Menu .) ($currentPage.HasMenuCurrent .Menu .) }}open{{end}}">
{{ range .Children }}
<li class="nav-item {{ if .HasChildren }}parent{{ end }} {{ if or ($currentPage.IsMenuCurrent .Menu .) ($currentPage.HasMenuCurrent .Menu .) }}active{{end}}">
{{ if .HasChildren }}<a href="#" class="children-toggle {{ if .HasChildren }}parent{{ end }} {{ if or ($currentPage.IsMenuCurrent .Menu .) ($currentPage.HasMenuCurrent .Menu .) }}open{{end}}"></a>{{ end }}
<a href="{{ .URL }}">{{ .Name }}</a>
<!-- Begin nested block -->
{{ if .HasChildren }}
<ul class="children {{ if .HasChildren }}parent{{ end }} {{ if or ($currentPage.IsMenuCurrent .Menu .) ($currentPage.HasMenuCurrent .Menu .) }}open{{end}}">
{{ range .Children }}
<li class="nav-item {{ if .HasChildren }}parent{{ end }} {{ if or ($currentPage.IsMenuCurrent .Menu .) ($currentPage.HasMenuCurrent .Menu .) }}active{{end}}">
{{ if .HasChildren }}<a href="#" class="children-toggle {{ if .HasChildren }}parent{{ end }} {{ if or ($currentPage.IsMenuCurrent .Menu .) ($currentPage.HasMenuCurrent .Menu .) }}open{{end}}"></a>{{ end }}
<a href="{{ .URL }}">{{ .Name }}</a>
<!-- To add more nested layers, copy the nested block and paste it here -->
</li>
{{ end }}
</ul>
{{ end }}
<!-- End nested block -->
</li>
{{ end }}
</ul>
{{ end }}
</li>
{{ end }}
</ul>
{{ end }}
</li>
{{ end }}
</ul>
{{ end }}
</li>
{{ end }}
</ul>
{{ end }}
</li>
{{ end }}
</ul>
{{ end }}
</li>
{{end}}
</ul>
</aside>