mirror of
https://github.com/gethinode/hinode.git
synced 2025-10-13 21:13:21 +00:00
40 lines
1.5 KiB
HTML
40 lines
1.5 KiB
HTML
{{- define "featured" -}}
|
|
{{- partial "home/featured.html" . -}}
|
|
{{- end -}}
|
|
|
|
{{- define "main" -}}
|
|
{{- $page := . -}}
|
|
{{- $sections := site.Params.home.sections -}}
|
|
{{- if not $sections -}}
|
|
{{ range $section := site.Sections }}
|
|
{{ $sections = $sections | append $section.Type }}
|
|
{{ end }}
|
|
{{- end -}}
|
|
|
|
{{- range $index, $section := $sections -}}
|
|
{{- $sectionPage := site.GetPage "section" $section -}}
|
|
{{- $sectionURL := $sectionPage.RelPermalink -}}
|
|
{{- $title := or $sectionPage.Title $sectionPage.Type -}}
|
|
{{- $thumbnail := (or (and (reflect.IsMap $sectionPage.Params.Thumbnail) $sectionPage.Params.Thumbnail.url) $sectionPage.Params.Thumbnail) -}}
|
|
{{- $icon := $sectionPage.Params.Icon -}}
|
|
{{- $content := $sectionPage.Content -}}
|
|
{{- $sectionTitle := strings.FirstUpper $sectionPage.Type -}}
|
|
{{- $moreTitle := "" -}}
|
|
{{- with (index site.Params.sections $section) -}}
|
|
{{- with index . "reference" }}{{ $moreTitle = . }}{{ end -}}
|
|
{{- end -}}
|
|
{{- $moreTitle = or $moreTitle (printf (T "more" (pluralize $sectionTitle))) -}}
|
|
|
|
{{- partial "assets/section-list.html" (dict
|
|
"page" $page
|
|
"section" $section
|
|
"home" true
|
|
"nested" true
|
|
"thumbnail" $thumbnail
|
|
"icon" $icon
|
|
"content" $content
|
|
"moreTitle" $moreTitle
|
|
"sectionURL" $sectionURL)
|
|
-}}
|
|
{{- end -}}
|
|
{{- end -}} |