initial checkin
This commit is contained in:
41
themes/hugo-theme-notrack/layouts/home.html
Normal file
41
themes/hugo-theme-notrack/layouts/home.html
Normal file
@ -0,0 +1,41 @@
|
||||
{{ define "main" }}
|
||||
<main>
|
||||
{{ $contentExists := gt (len .Content) 0 }}
|
||||
{{ $blogPages := where .Site.RegularPages.ByDate.Reverse ".Type" "in" .Site.Params.mainSections }}
|
||||
{{ $blogPages = where $blogPages ".Params.draft" "!=" true }}
|
||||
{{ $showLatest := and (default true site.Params.showBlogLatest) $blogPages }}
|
||||
{{ $headlessExists := false }}
|
||||
|
||||
{{ if $contentExists }}
|
||||
{{ .Content }}
|
||||
{{ else }}
|
||||
{{ with .Site.GetPage "/homepage" }}
|
||||
{{ $headlessExists = true }}
|
||||
<div class="headless-homepage">
|
||||
{{ range .Resources }}
|
||||
<h2>
|
||||
{{ .Title }}
|
||||
</h2>
|
||||
<p>{{ .Content }}</p>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if and (or $headlessExists $contentExists) $showLatest }}
|
||||
<p class="delimiter">♦ ♦ ♦</p>
|
||||
|
||||
{{ $blogLatest := default "Latest Blog Posts" site.Params.blogLatestHeading }}
|
||||
<h2 id="latest-blog-home">{{- $blogLatest -}}</h2>
|
||||
{{ end }}
|
||||
|
||||
{{ if $showLatest }}
|
||||
{{ with $blogPages }}
|
||||
{{ range first (default 3 site.Params.nBlogLatest) . }}
|
||||
{{- partial "blog-entry-summary" . -}}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
</main>
|
||||
{{ end }}
|
Reference in New Issue
Block a user