Automate docs top panel

Signed-off-by: lucperkins <lucperkins@gmail.com>
This commit is contained in:
lucperkins 2019-04-24 12:07:18 -07:00
parent 75509d8aa4
commit 35a84eba18
8 changed files with 27 additions and 11 deletions

View File

@ -1,6 +1,7 @@
---
layout: guides
title: Guides
weight: 2
---
This document introduces you to gRPC and protocol buffers. gRPC can use

View File

@ -1,6 +1,7 @@
---
title: Quick Start
layout: quickstart
weight: 1
---
<p class="lead">
Get started with gRPC

View File

@ -4,6 +4,7 @@ headline: 'Language Specific API Reference'
layout: docs
title: Reference
type: markdown
weight: 4
---
<p class="lead">Links to the language specific automatically generated API reference documentation.</p>

View File

@ -4,7 +4,9 @@ headline: 'gRPC Samples'
layout: docs
title: Samples
type: markdown
weight: 5
---
<p class="lead">Here are some sample apps to help developers build certain functionalities</p>
<ul>

View File

@ -1,7 +1,9 @@
---
layout: docs
title: Presentations & Talks
short: Presentations
type: markdown
weight: 6
---
<p class="lead">gRPC has been talked about in many conferences and sessions. Here are a few interesting ones:</p>

View File

@ -1,6 +1,7 @@
---
layout: tutorials
title: Tutorials
weight: 3
---
This section contains tutorials for each of our supported languages. They

View File

@ -35,8 +35,8 @@
<div class="row">
<div class="topbanner{{ if not .IsHome }}sub{{ end }}">
<nav class="navbar navbar-expand-md navbar-dark topnav">
<a class="navbar-brand" href="{{ .Site.BaseURL }}">
<img src="{{ .Site.BaseURL }}img/grpc-logo.png" width="114" height="50">
<a class="navbar-brand" href="/">
<img src="/img/grpc-logo.png" width="114" height="50">
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
@ -46,10 +46,10 @@
<div class="topnav, collapse navbar-collapse" id="navbarSupportedContent" style="float:right !important">
<ul class="navbar-nav ml-auto">
<li class="nav-item {{ if in .RelPermalink "about" }}active{{ end }}">
<a class="nav-link" href="{{ .Site.BaseURL }}about/">About</a>
<a class="nav-link" href="/about/">About</a>
</li>
<li class="nav-item dropdown {{ if in .RelPermalink "docs" }}active{{ end }}">
<a class="nav-link dropdown-toggle" href="{{ .Site.BaseURL }}docs/" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<a class="nav-link dropdown-toggle" href="/docs/" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Docs
</a>

View File

@ -1,9 +1,17 @@
{{ $docsSections := (index (where site.Sections "Section" "docs") 0).Sections }}
{{ $isDocsHome := eq .RelPermalink "/docs/" }}
{{ $currentSection := .CurrentSection.Title }}
<div class="subnav d-none d-md-block">
<a href="{{ .Site.BaseURL }}docs/" {{ if eq (countrunes .RelPermalink) 6 }} class="active"{{ end }}>Overview</a>
| <a href="{{ .Site.BaseURL }}docs/quickstart/" {{ if in .RelPermalink "quickstart" }} class="active"{{ end }}>Quick Start</a>
| <a href="{{ .Site.BaseURL }}docs/guides/" {{ if in .RelPermalink "guides" }} class="active"{{ end }}>Guides</a>
| <a href="{{ .Site.BaseURL }}docs/tutorials/" {{ if in .RelPermalink "tutorials" }} class="active"{{ end }}>Tutorials</a>
| <a href="{{ .Site.BaseURL }}docs/reference/" {{ if in .RelPermalink "reference" }} class="active"{{ end }}>Reference</a>
| <a href="{{ .Site.BaseURL }}docs/samples/" {{ if in .RelPermalink "samples" }} class="active"{{ end }}>Samples</a>
| <a href="{{ .Site.BaseURL }}docs/talks/" {{ if in .RelPermalink "talks" }} class="active"{{ end }}>Presentations</a>
<a href="/docs"{{ if $isDocsHome }} class="active"{{ end }}>
Overview
</a>
{{ range $docsSections }}
{{ $isCurrentSection := eq $currentSection .CurrentSection.Title }}
{{ $title := cond (isset .Params "short") .Params.short .Title }}
|
<a href="{{ .RelPermalink }}"{{ if $isCurrentSection }} class="active"{{ end }}>
{{ $title }}
</a>
{{ end }}
</div>