Layout refactoring (#477)

Prep work, contributing to #433. No non-whitespace changes to the generated site.
This commit is contained in:
Patrice Chalin 2020-10-26 15:56:06 -04:00 committed by GitHub
parent 0b14ae1a48
commit 72a6d16bbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 22 deletions

View File

@ -1,5 +1,3 @@
{{ $desc := .Params.description -}}
{{ $source := printf "https://github.com/grpc/grpc.io/tree/%s/content/%s" $.Site.Params.branch .File.Path -}}
<section class="section">
<div class="container">
<div class="columns is-variable is-8">
@ -8,26 +6,7 @@
</div>
{{/* Why is-clipped? See https://github.com/grpc/grpc.io/issues/185 */}}
<div class="column is-clipped">
<section class="hero is-small">
<div class="hero-body">
<div class="container">
<p class="title is-size-2 is-size-3-mobile has-text-primary has-text-weight-bold{{ if $desc }} is-spaced{{ end }}">
{{- .Title -}}
<span class="buttons page-github-buttons">
<a class="button is-white" href="{{$source}}" title="View page source" target="_blank" rel="noopener">
<i class="fab fa-github"></i>
</a>
</span>
</p>
{{ with $desc -}}
<p class="subtitle is-size-4 is-size-5-mobile has-text-grey">
{{- . -}}
</p>
{{ end -}}
</div>
</div>
</section>
{{ partial "docs/hero.html" . }}
<section class="section">
<div class="container">

View File

@ -0,0 +1,21 @@
{{ $desc := .Params.description -}}
{{ $source := printf "https://github.com/grpc/grpc.io/tree/%s/content/%s" $.Site.Params.branch .File.Path -}}
<section class="hero is-small">
<div class="hero-body">
<div class="container">
<p class="title is-size-2 is-size-3-mobile has-text-primary has-text-weight-bold{{ if $desc }} is-spaced{{ end }}">
{{- .Title -}}
<span class="buttons page-github-buttons">
<a class="button is-white" href="{{$source}}" title="View page source" target="_blank" rel="noopener">
<i class="fab fa-github"></i>
</a>
</span>
</p>
{{ with $desc -}}
<p class="subtitle is-size-4 is-size-5-mobile has-text-grey">
{{- . -}}
</p>
{{ end -}}
</div>
</div>
</section>