Refactor translation codes
This commit is contained in:
parent
5da3cf5ebf
commit
db5a18f80d
12 changed files with 96 additions and 68 deletions
|
@ -29,28 +29,14 @@
|
|||
{{- partial "sections/home.html" . -}}
|
||||
|
||||
<!--- ADD OPTIONAL SECTIONS ----------->
|
||||
{{ $sections:= .Site.Data.sections }}
|
||||
{{ if (index .Site.Data .Site.Language.Lang).sections }}
|
||||
{{ $sections = (index .Site.Data .Site.Language.Lang).sections }}
|
||||
{{ end }}
|
||||
|
||||
{{ if $sections }}
|
||||
{{ $background:= "bg-white"}}
|
||||
{{ range sort (index .Site.Data .Site.Language.Lang).sections "section.weight" }}
|
||||
{{ if .section.enable }}
|
||||
<div class="container-fluid section-holder d-flex {{ $background }}">
|
||||
{{ if .section.template }}
|
||||
{{- partial .section.template . -}}
|
||||
{{ else }}
|
||||
{{- partial (printf "sections/%s.html" (replace (lower .section.name) " " "-")) . -}}
|
||||
{{ end }}
|
||||
</div>
|
||||
<!--- alter background color for next section --->
|
||||
{{ if eq $background "bg-white" }}
|
||||
{{ $background = "bg-dimmed" }}
|
||||
{{ else }}
|
||||
{{ $background = "bg-white" }}
|
||||
{{end}}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ else if .Site.Data.sections }}
|
||||
{{ $background:= "bg-white"}}
|
||||
{{ range sort .Site.Data.sections "section.weight" }}
|
||||
{{ range sort $sections "section.weight" }}
|
||||
{{ if .section.enable }}
|
||||
<div class="container-fluid section-holder d-flex {{ $background }}">
|
||||
{{ if .section.template }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue