mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-15 09:14:47 -04:00
Use lang.Merge to "fill in the gaps" for untranslated pages
For example, to get pages under the About Hugo section to show up on https://gohugo.io/zh/about/. This commit is non-exhaustive; more work is necessary. Also bump theme min_version to 0.38 due to the use of the new lang.Merge function.
This commit is contained in:
parent
ef079406cf
commit
56e4e95d9e
@ -1,4 +1,5 @@
|
||||
{{ define "main" }}
|
||||
{{ $section_to_display := .Sections | default .Paginator.Pages }}
|
||||
{{ $paginator := .Paginate (.Pages | lang.Merge (where .Sites.First.RegularPages "Section" .Section)) }}
|
||||
{{ $section_to_display := .Sections | default $paginator.Pages }}
|
||||
{{ partial "pagelayout.html" (dict "context" . "section_to_display" $section_to_display ) }}
|
||||
{{ end }}
|
||||
|
@ -28,7 +28,8 @@
|
||||
|
||||
{{ $interior_classes := $.Site.Params.flex_box_interior_classes }}
|
||||
<section class="flex-ns flex-wrap justify-between w-100 w-80-nsTK v-top">
|
||||
{{ range .Paginator.Pages }}
|
||||
{{ $paginator := .Paginate (.Pages | lang.Merge (where .Sites.First.RegularPages "Section" .Section)) -}}
|
||||
{{ range $paginator.Pages }}
|
||||
{{ partial "boxes-section-summaries" (dict "context" . "classes" $interior_classes "fullcontent" false) }}
|
||||
{{ end }}
|
||||
</section>
|
||||
|
@ -1,4 +1,4 @@
|
||||
{{ define "main" }}
|
||||
{{ $section_to_display := (.Site.Taxonomies.categories.fundamentals).Pages }}
|
||||
{{ $section_to_display := (.Site.Taxonomies.categories.fundamentals).Pages | lang.Merge (.Sites.First.Taxonomies.categories.fundamentals).Pages }}
|
||||
{{ partial "pagelayout.html" (dict "context" . "section_to_display" $section_to_display ) }}
|
||||
{{ end }}
|
||||
|
@ -6,18 +6,18 @@
|
||||
<li class="f5 w-100 hover-bg-light-gray hover-accent-color-light fw8{{ if eq $post "break" }} mb1 bb b--moon-gray{{ end }}">
|
||||
<a href="{{ if .HasChildren }}javascript:void(0){{ else }}{{ .URL }}{{ end }}" class="js-toggle dib w-100 link mid-gray hover-accent-color-light pl2 pr2 pv2 {{if or ($currentPage.IsMenuCurrent "docs" .) ($currentPage.HasMenuCurrent "docs" .) }} primary-color{{end}}" data-target=".{{ .Identifier }}">{{ .Name }}</a>
|
||||
|
||||
{{ if .HasChildren }}
|
||||
<ul class="{{ .Identifier }} desktopmenu animated fadeIn list pl0 bg-light-gray{{if $currentPage.HasMenuCurrent "docs" . }} db{{ else }} dn{{ end }}">
|
||||
{{ range .Children }}
|
||||
<li class="f6 fw4">
|
||||
<a href="{{.URL}}" class="db link hover-bg-gray hover-white pl3 pr2 pv2 {{if $currentPage.IsMenuCurrent "docs" . }}primary-color {{ else }}black {{end}}">
|
||||
{{ .Name }}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{end}}
|
||||
</li>
|
||||
{{end}}
|
||||
{{- if .HasChildren }}
|
||||
<ul class="{{ .Identifier }} desktopmenu animated fadeIn list pl0 bg-light-gray{{if $currentPage.HasMenuCurrent "docs" . }} db{{ else }} dn{{ end }}">
|
||||
{{- range .Children }}
|
||||
<li class="f6 fw4">
|
||||
<a href="{{.URL}}" class="db link hover-bg-gray hover-white pl3 pr2 pv2 {{if $currentPage.IsMenuCurrent "docs" . }}primary-color {{ else }}black {{end}}">
|
||||
{{ .Name }}
|
||||
</a>
|
||||
</li>
|
||||
{{- end}}
|
||||
</ul>
|
||||
{{- end}}
|
||||
</li>
|
||||
{{- end}}
|
||||
</ul>
|
||||
</nav>
|
||||
|
@ -8,7 +8,7 @@ description = ""
|
||||
homepage = "https://github.com/budparr/gohugo.io"
|
||||
tags = ["website"]
|
||||
features = ["", ""]
|
||||
min_version = 0.18
|
||||
min_version = 0.38
|
||||
|
||||
[author]
|
||||
name = "Bud Parr"
|
||||
|
Loading…
x
Reference in New Issue
Block a user