Create docs/platforms, relocate android & web pages (#473)

Closes #472
This commit is contained in:
Patrice Chalin 2020-11-02 15:16:56 -05:00 committed by GitHub
parent b5f585c983
commit bb85a41f22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 54 additions and 18 deletions

View File

@ -101,6 +101,10 @@ menu:
url: /docs/languages/ url: /docs/languages/
weight: 2 weight: 2
parent: docs parent: docs
- name: Platforms
url: /docs/platforms/
weight: 2
parent: docs
- name: Guides - name: Guides
url: /docs/guides/ url: /docs/guides/
identifier: guides identifier: guides

View File

@ -50,5 +50,5 @@ Principles](/blog/principles/) on the [gRPC blog](/blog/).
<a name="officially-supported-languages-and-platforms"></a> <a name="officially-supported-languages-and-platforms"></a>
Our table of **officially supported languages and platforms** has moved! Our table of **officially supported languages and platforms** has moved!
See [Supported languages and platforms](/docs/languages/#official-support). See [Official support](/docs/#official-support).
{{< /note >}} {{< /note >}}

View File

@ -3,7 +3,7 @@ title: Documentation
--- ---
Learn about key gRPC concepts, try a quick start, find tutorials and reference Learn about key gRPC concepts, try a quick start, find tutorials and reference
material for all [supported languages](languages/). material for all supported [languages][] and [platforms][]:
- **New to gRPC?** Start with the following pages: - **New to gRPC?** Start with the following pages:
@ -13,11 +13,22 @@ material for all [supported languages](languages/).
- **Eager to see gRPC in action?** - **Eager to see gRPC in action?**
[Select a language](languages/) and then choose its **Quick start**. Select a [language][] or [platform][], then choose its **Quick start**.
- Interested in **gRPC feature details?** - Interested in **gRPC feature details?**
Try one of the following: Try one of the following:
- [Select a language](languages/) and then choose **Tutorial** or **API reference** - Select a [language][] or [platform][], then choose **Tutorial** or **API reference**
- [Guides](guides/) - [Guides](guides/)
### Official support
These are the officially supported gRPC language, platform and OS versions:
{{< supported-platforms >}}
[language]: {{< ref "languages" >}}
[languages]: {{< ref "languages" >}}
[platform]: {{< ref "platforms" >}}
[platforms]: {{< ref "platforms" >}}

View File

@ -1,11 +1,11 @@
--- ---
title: Supported languages and platforms title: Supported languages
short: Languages short: Languages
weight: 2 weight: 2
nav_children: section nav_children: section
--- ---
Each gRPC language / platform has links to the following pages and more: Each gRPC language / [platform][] has links to the following pages and more:
- Quick start - Quick start
- Tutorials - Tutorials
@ -13,7 +13,6 @@ Each gRPC language / platform has links to the following pages and more:
Select a language to get started: Select a language to get started:
- [Android Java](android/)
- [C# / .NET](csharp/) - [C# / .NET](csharp/)
- [C++](cpp/) - [C++](cpp/)
- [Dart](dart/) - [Dart](dart/)
@ -25,10 +24,5 @@ Select a language to get started:
- [PHP](php/) - [PHP](php/)
- [Python](python/) - [Python](python/)
- [Ruby](ruby/) - [Ruby](ruby/)
- [Web](web/)
### Official support [platform]: {{< relref "platforms" >}}
These are the officially supported gRPC language, platform and OS versions:
{{< supported-platforms >}}

View File

@ -0,0 +1,20 @@
---
title: Supported platforms
short: Platforms
weight: 2
nav_children: section
---
Each gRPC [language][] / platform has links to the following pages and more:
- Quick start
- Tutorials
- API reference
Select a platform to get started:
- [Android Java](android/)
- iOS (coming soon)
- [Web](web/)
[language]: {{< ref "languages" >}}

View File

@ -1,4 +1,4 @@
{{ $isRedirected := findRE "^(|../|/docs/languages/.+?/)(api|daily-builds)(/.*)?(\\?.*)?$" .Destination -}} {{ $isRedirected := findRE "^(|../|/docs/(languages|platforms)/.+?/)(api|daily-builds)(/.*)?(\\?.*)?$" .Destination -}}
{{ $isExternal := or (hasPrefix .Destination "http") $isRedirected -}} {{ $isExternal := or (hasPrefix .Destination "http") $isRedirected -}}
<a href="{{ .Destination | safeURL }}" <a href="{{ .Destination | safeURL }}"
{{- with .Title }} title="{{ . }}"{{ end -}} {{- with .Title }} title="{{ . }}"{{ end -}}

View File

@ -1,5 +1,10 @@
# cSpell:ignore channelz helloasync loadbalancing quickstart sapi vendasta vendastagrpc # cSpell:ignore channelz helloasync loadbalancing quickstart sapi vendasta vendastagrpc
#
# Languages -> platforms redirects
/docs/languages/android/* /docs/platforms/android/:splat
/docs/languages/web/* /docs/platforms/web/:splat
# API reference docs # API reference docs
# #
# Redirects are handled as if by the following rules (let $api_path be the # Redirects are handled as if by the following rules (let $api_path be the
@ -9,7 +14,9 @@
# /docs/languages/:lang/api $api_path 301! # when $api_path starts with 'http' # /docs/languages/:lang/api $api_path 301! # when $api_path starts with 'http'
# /docs/languages/:lang/api https://grpc.github.io/$api_path 301! # otherwise; 'LANG' in $api_path is replaced by :lang # /docs/languages/:lang/api https://grpc.github.io/$api_path 301! # otherwise; 'LANG' in $api_path is replaced by :lang
{{ range (.Site.GetPage "/docs/languages").Sections -}} {{ $pages := (.Site.GetPage "/docs/platforms").Sections -}}
{{ $pages := $pages | union (.Site.GetPage "/docs/languages").Sections -}}
{{ range $pages -}}
{{ $from_path := printf "/%sapi" .File.Dir -}} {{ $from_path := printf "/%sapi" .File.Dir -}}
{{ $api_path := .Params.api_path | default "grpc/LANG" -}} {{ $api_path := .Params.api_path | default "grpc/LANG" -}}

View File

@ -60,7 +60,7 @@
<ul class="nav-section-links" x-show="open"> <ul class="nav-section-links" x-show="open">
{{ range $children -}} {{ range $children -}}
{{ $isActive := eq $here .RelPermalink -}} {{ $isActive := eq $here .RelPermalink -}}
{{ $isRedirected := findRE "^/docs/languages/.+?/(api|daily-builds)(/.*)?$" .RelPermalink -}} {{ $isRedirected := findRE "^/docs/(languages|platforms)/.+?/(api|daily-builds)(/.*)?$" .RelPermalink -}}
{{ $isExternal := or (hasPrefix .RelPermalink "http") $isRedirected -}} {{ $isExternal := or (hasPrefix .RelPermalink "http") $isRedirected -}}
<li class="nav-section-link{{ if $isActive }} is-active{{ end }}"> <li class="nav-section-link{{ if $isActive }} is-active{{ end }}">
<a href="{{ .RelPermalink }}" <a href="{{ .RelPermalink }}"