Fix routing logic in tutorials

Signed-off-by: lucperkins <lucperkins@gmail.com>
This commit is contained in:
lucperkins 2019-04-22 18:53:44 -07:00
parent 4b1d921721
commit dabbbdb3cf
15 changed files with 59 additions and 27 deletions

View File

@ -1,7 +1,9 @@
--- ---
layout: tutorials layout: tutorials
title: Asynchronous Basics - C++ title: Asynchronous Basics - C++
short: Async - C++
aliases: [docs/tutorials/async/helloasync-cpp.html] aliases: [docs/tutorials/async/helloasync-cpp.html]
type: async
--- ---
This tutorial shows you how to write a simple server and client in C++ using This tutorial shows you how to write a simple server and client in C++ using

View File

@ -1,6 +1,8 @@
--- ---
layout: tutorials layout: tutorials
title: OAuth2 on gRPC - Objective-C title: OAuth2 on gRPC - Objective-C
short: Auth - Objective-C
type: auth
aliases: [/docs/tutorials/auth/oauth2-objective-c.html] aliases: [/docs/tutorials/auth/oauth2-objective-c.html]
--- ---
This example demonstrates how to use OAuth2 on gRPC to make This example demonstrates how to use OAuth2 on gRPC to make

View File

@ -1,7 +1,8 @@
--- ---
layout: tutorials layout: tutorials
title: gRPC Basics - Android Java title: gRPC Basics - Android Java
aliases: [/docs/tutorials/basic/android.html] short: Android
type: basic
--- ---
This tutorial provides a basic Android Java programmer's introduction to working with gRPC. This tutorial provides a basic Android Java programmer's introduction to working with gRPC.

View File

@ -1,7 +1,8 @@
--- ---
layout: tutorials layout: tutorials
title: gRPC Basics - C++ title: gRPC Basics - C++
aliases: [/docs/tutorials/basic/c.html] type: basic
short: C
--- ---
This tutorial provides a basic C++ programmer's introduction to working with gRPC. This tutorial provides a basic C++ programmer's introduction to working with gRPC.

View File

@ -1,7 +1,8 @@
--- ---
layout: tutorials layout: tutorials
title: gRPC Basics - C# title: gRPC Basics - C#
aliases: [/docs/tutorials/basic/csharp.html] type: basic
short: C#
--- ---
This tutorial provides a basic C# programmer's introduction to working with gRPC. This tutorial provides a basic C# programmer's introduction to working with gRPC.

View File

@ -1,7 +1,8 @@
--- ---
layout: tutorials layout: tutorials
title: gRPC Basics - Dart title: gRPC Basics - Dart
aliases: [/docs/tutorials/basic/dart.html] type: basic
short: Dart
--- ---
This tutorial provides a basic Dart programmer's introduction to This tutorial provides a basic Dart programmer's introduction to
working with gRPC. working with gRPC.

View File

@ -1,7 +1,8 @@
--- ---
layout: tutorials layout: tutorials
title: gRPC Basics - Go title: gRPC Basics - Go
aliases: [/docs/tutorials/basic/go.html] type: basic
short: Go
--- ---
This tutorial provides a basic Go programmer's introduction to This tutorial provides a basic Go programmer's introduction to
working with gRPC. working with gRPC.

View File

@ -1,7 +1,8 @@
--- ---
layout: tutorials layout: tutorials
title: gRPC Basics - Java title: gRPC Basics - Java
aliases: [/docs/tutorials/basic/java.html] type: basic
short: Java
--- ---
This tutorial provides a basic Java programmer's introduction to This tutorial provides a basic Java programmer's introduction to
working with gRPC. working with gRPC.

View File

@ -1,7 +1,8 @@
--- ---
layout: tutorials layout: tutorials
title: gRPC Basics - Node.js title: gRPC Basics - Node.js
aliases: [/docs/tutorials/basic/node.html] type: basic
short: Node
--- ---
This tutorial provides a basic Node.js programmer's introduction This tutorial provides a basic Node.js programmer's introduction
to working with gRPC. to working with gRPC.

View File

@ -1,7 +1,7 @@
--- ---
layout: tutorials layout: tutorials
title: gRPC Basics - Objective-C title: gRPC Basics - Objective-C
aliases: [/docs/tutorials/basic/objective-c.html] type: basic
--- ---
This tutorial provides a basic Objective-C programmer's This tutorial provides a basic Objective-C programmer's
introduction to working with gRPC. introduction to working with gRPC.

View File

@ -1,7 +1,8 @@
--- ---
layout: tutorials layout: tutorials
title: gRPC Basics - PHP title: gRPC Basics - PHP
aliases: [/docs/tutorials/basic/php.html] type: basic
short: PHP
--- ---
This tutorial provides a basic PHP programmer's introduction to This tutorial provides a basic PHP programmer's introduction to
working with gRPC. working with gRPC.

View File

@ -1,7 +1,8 @@
--- ---
layout: tutorials layout: tutorials
title: gRPC Basics - Python title: gRPC Basics - Python
aliases: [/docs/tutorials/basic/python.html] type: basic
short: Python
--- ---
This tutorial provides a basic Python programmer's introduction This tutorial provides a basic Python programmer's introduction
to working with gRPC. to working with gRPC.

View File

@ -1,7 +1,8 @@
--- ---
layout: tutorials layout: tutorials
title: gRPC Basics - Ruby title: gRPC Basics - Ruby
aliases: [/docs/tutorials/basic/ruby.html] type: basic
short: Ruby
--- ---
This tutorial provides a basic Ruby programmer's introduction to working with gRPC. This tutorial provides a basic Ruby programmer's introduction to working with gRPC.

View File

@ -1,7 +1,8 @@
--- ---
layout: tutorials layout: tutorials
title: gRPC Basics - Web title: gRPC Basics - Web
aliases: [/docs/tutorials/basic/web.html] type: basic
short: Web
--- ---
This tutorial provides a basic introduction on how to use This tutorial provides a basic introduction on how to use

View File

@ -3,6 +3,12 @@
{{ .Title }} &ndash; {{ .Site.Title }} {{ .Title }} &ndash; {{ .Site.Title }}
{{ end }} {{ end }}
{{ define "main" }} {{ define "main" }}
{{ $currentUrl := .RelPermalink }}
{{ $tutorials := where site.Pages ".Layout" "tutorials" }}
{{ $async := where $tutorials ".Params.type" "eq" "async" }}
{{ $auth := where $tutorials ".Params.type" "eq" "auth" }}
{{ $basic := where $tutorials ".Params.type" "eq" "basic" }}
<div class="headertext">Documentation</div> <div class="headertext">Documentation</div>
</div> </div>
</div> </div>
@ -15,21 +21,32 @@
<div class="quickstartcol1"> <div class="quickstartcol1">
<h8>Tutorials</h8> <h8>Tutorials</h8>
<a href="{{ .Site.BaseURL }}docs/tutorials/async/helloasync-cpp/" {{ if in .RelPermalink "helloasync-cpp" }}class="active"{{ end }}>Async - C++</a>
<a href="{{ .Site.BaseURL }}docs/tutorials/auth/oauth2-objective-c/" {{ if in .RelPermalink "oauth2-objective-c" }}class="active"{{ end }}>Auth - Objective C</a> {{ range $auth }}
{{ $isCurrentPage := eq $currentUrl .RelPermalink }}
{{ $title := .Params.short }}
<a href="{{ .RelPermalink }}"{{ if $isCurrentPage }} class="active"{{ end }}>
{{ $title }}
</a>
{{ end }}
{{ range $async }}
{{ $isCurrentPage := eq $currentUrl .RelPermalink }}
{{ $title := .Params.short }}
<a href="{{ .RelPermalink }}">
{{ $title }}
</a>
{{ end }}
<h8>Basic</h8> <h8>Basic</h8>
<a href="{{ .Site.BaseURL }}docs/tutorials/basic/c/" {{ if in .RelPermalink "basic/c/" }}class="active"{{ end }}>C++</a>
<a href="{{ .Site.BaseURL }}docs/tutorials/basic/csharp/" {{ if in .RelPermalink "csharp" }}class="active"{{ end }}>C#</a> {{ range $basic }}
<a href="{{ .Site.BaseURL }}docs/tutorials/basic/dart/" {{ if in .RelPermalink "dart" }}class="active"{{ end }}>Dart</a> {{ $isCurrentPage := eq $currentUrl .RelPermalink }}
<a href="{{ .Site.BaseURL }}docs/tutorials/basic/go/" {{ if in .RelPermalink "go" }}class="active"{{ end }}>Go</a> {{ $title := .Params.short }}
<a href="{{ .Site.BaseURL }}docs/tutorials/basic/java/" {{ if in .RelPermalink "java" }}class="active"{{ end }}>Java</a> <a href="{{ .RelPermalink }}">
<a href="{{ .Site.BaseURL }}docs/tutorials/basic/android/" {{ if in .RelPermalink "android" }}class="active"{{ end }}>Android Java</a> {{ $title }}
<a href="{{ .Site.BaseURL }}docs/tutorials/basic/node/" {{ if in .RelPermalink "node" }}class="active"{{ end }}>Node</a> </a>
<a href="{{ .Site.BaseURL }}docs/tutorials/basic/objective-c/" {{ if in .RelPermalink "objective-c" }}class="active"{{ end }}>Objective-C</a> {{ end }}
<a href="{{ .Site.BaseURL }}docs/tutorials/basic/php/" {{ if in .RelPermalink "php" }}class="active"{{ end }}>PHP</a>
<a href="{{ .Site.BaseURL }}docs/tutorials/basic/python/" {{ if in .RelPermalink "python" }}class="active"{{ end }}>Python</a>
<a href="{{ .Site.BaseURL }}docs/tutorials/basic/ruby/" {{ if in .RelPermalink "ruby" }}class="active"{{ end }}>Ruby</a>
<a href="{{ .Site.BaseURL }}docs/tutorials/basic/web/" {{ if in .RelPermalink "web" }}class="active"{{ end }}>Web</a>
</div> </div>