mirror of https://github.com/grpc/grpc.io.git
Initial version of sidebar nav
Signed-off-by: lucperkins <lucperkins@gmail.com>
This commit is contained in:
parent
081f724b02
commit
7605c37be2
|
|
@ -28,6 +28,8 @@ $primary: $grpc-green
|
||||||
$secondary: $grpc-blue
|
$secondary: $grpc-blue
|
||||||
$secondary-dark: darken($secondary, 15%)
|
$secondary-dark: darken($secondary, 15%)
|
||||||
$link: $secondary-dark
|
$link: $secondary-dark
|
||||||
|
$code: $primary
|
||||||
|
$code-background: $white-bis
|
||||||
$navbar-height: 5rem
|
$navbar-height: 5rem
|
||||||
$navbar-item-img-max-height: $navbar-height * 0.6
|
$navbar-item-img-max-height: $navbar-height * 0.6
|
||||||
|
|
||||||
|
|
@ -165,4 +167,26 @@ $colors: mergeColorMaps(("secondary": ($secondary, $white)), $colors)
|
||||||
top: $navbar-height + 2rem
|
top: $navbar-height + 2rem
|
||||||
|
|
||||||
.is-constrained
|
.is-constrained
|
||||||
max-width: 80ch
|
max-width: 80ch
|
||||||
|
|
||||||
|
=active
|
||||||
|
color: $black
|
||||||
|
font-weight: 700
|
||||||
|
|
||||||
|
.nav
|
||||||
|
&-section
|
||||||
|
.title
|
||||||
|
&.is-active
|
||||||
|
+active
|
||||||
|
|
||||||
|
ul.nav-section-links
|
||||||
|
margin-top: 1rem
|
||||||
|
|
||||||
|
li
|
||||||
|
font-size: 1rem
|
||||||
|
|
||||||
|
&.is-active
|
||||||
|
+active
|
||||||
|
|
||||||
|
& + &
|
||||||
|
margin-top: 1.5rem
|
||||||
|
|
@ -4,6 +4,5 @@
|
||||||
|
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
{{ partial "hero.html" . }}
|
{{ partial "hero.html" . }}
|
||||||
{{ partial "nav.html" . }}
|
{{ partial "article.html" . }}
|
||||||
{{ partial "content.html" (dict "content" .Content "size" "medium") }}
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
@ -4,6 +4,5 @@
|
||||||
|
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
{{ partial "hero.html" . }}
|
{{ partial "hero.html" . }}
|
||||||
{{ partial "nav.html" . }}
|
|
||||||
{{ partial "article.html" . }}
|
{{ partial "article.html" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,8 @@
|
||||||
|
<section class="section">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="columns is-variable is-8">
|
<div class="columns is-variable is-8">
|
||||||
<div class="column is-one-quarter">
|
<div class="column is-one-quarter">
|
||||||
<div class="is-sticky">
|
{{ partial "nav.html" . }}
|
||||||
TOC
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="column">
|
<div class="column">
|
||||||
|
|
@ -12,3 +10,4 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</section>
|
||||||
|
|
@ -1,16 +1,38 @@
|
||||||
{{ $here := .RelPermalink }}
|
{{ $here := .RelPermalink }}
|
||||||
{{ $docsSections := (index (where site.Sections "Section" "docs") 0).Sections }}
|
{{ $docsSections := (index (where site.Sections "Section" "docs") 0).Sections }}
|
||||||
{{ $currentSection := .CurrentSection }}
|
{{ $currentSection := .CurrentSection }}
|
||||||
<div class="tabs is-medium is-toggle-rounded is-centered">
|
|
||||||
<ul>
|
<div class="nav">
|
||||||
{{ range $docsSections }}
|
{{ range $docsSections }}
|
||||||
{{ $title := .Title | upper }}
|
<div class="nav-section">
|
||||||
{{ $isCurrentSection := eq $currentSection .CurrentSection }}
|
{{ $isHere := eq $here .RelPermalink }}
|
||||||
<li{{ if $isCurrentSection }} class="is-active"{{ end }}>
|
<a class="title is-size-4 is-size-5-mobile{{ if $isHere }} is-active{{ end }}" href="{{ .RelPermalink }}">
|
||||||
<a href="{{ .RelPermalink }}">
|
{{ if $isHere }}
|
||||||
{{ $title }}
|
<span class="icon has-text-secondary">
|
||||||
</a>
|
<i class="fas fa-arrow-right"></i>
|
||||||
</li>
|
</span>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
|
||||||
|
{{ .Title }}
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<ul class="nav-section-links">
|
||||||
|
{{ range .RegularPages }}
|
||||||
|
{{ $isHere := eq $here .RelPermalink }}
|
||||||
|
{{ $title := cond (isset .Params "short") .Params.short .Title }}
|
||||||
|
<li{{ if $isHere }} class="is-active"{{ end }}>
|
||||||
|
<a href="{{ .RelPermalink }}">
|
||||||
|
{{ if $isHere }}
|
||||||
|
<span class="icon has-text-secondary">
|
||||||
|
<i class="fas fa-arrow-right"></i>
|
||||||
|
</span>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ $title }}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{{ end }}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue