Implement mainSections for home page and replace .Data.Pages with alias .Pages.
This commit is contained in:
parent
97eac46006
commit
a942441544
8 changed files with 13 additions and 7 deletions
|
|
@ -1,7 +1,7 @@
|
|||
{{ define "main" -}}
|
||||
<main class="main layout__main">
|
||||
<h1 class="title">{{ .Title }}</h1>
|
||||
{{ $paginator := .Paginate (.Data.Pages) -}}
|
||||
{{ $paginator := .Paginate (.Pages) -}}
|
||||
{{ range $paginator.Pages -}}
|
||||
{{ .Render "summary"}}
|
||||
{{ end -}}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{{ $list := .Data.Pages -}}
|
||||
{{ $list := .Pages -}}
|
||||
{{ $length := (len $list) -}}
|
||||
{
|
||||
"version" : "https://jsonfeed.org/version/1",
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
{{ with .OutputFormats.Get "RSS" -}}
|
||||
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
|
||||
{{ end -}}
|
||||
{{ range .Data.Pages }}
|
||||
{{ range .Pages }}
|
||||
<item>
|
||||
<title>{{ .Title }}</title>
|
||||
<link>{{ .Permalink }}</link>
|
||||
|
|
|
|||
|
|
@ -7,5 +7,11 @@
|
|||
{{ .Content }}
|
||||
</div>
|
||||
</article>
|
||||
|
||||
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
|
||||
{{ range $pages -}}
|
||||
{{ .Render "summary"}}
|
||||
{{ end -}}
|
||||
|
||||
</main>
|
||||
{{ end }}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<h1 class="title">Micro posts</h1>
|
||||
<p class="micro__follow"><a href="https://micro.blog/{{ with $.Param "microusername" }}{{ . }}{{ end }}">{{ i18n "string_follow" }} @{{ with $.Param "microusername" }}{{ . }}{{ end }}</a></p>
|
||||
|
||||
{{ $paginator := .Paginate (.Data.Pages) -}}
|
||||
{{ $paginator := .Paginate (.Pages) -}}
|
||||
{{ range $paginator.Pages -}}
|
||||
{{ .Render "summary"}}
|
||||
{{ end -}}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{{ $list := .Data.Pages -}}
|
||||
{{ $list := .Pages -}}
|
||||
{{ $length := (len $list) -}}
|
||||
{
|
||||
"version" : "https://jsonfeed.org/version/1",
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
{{ with .OutputFormats.Get "RSS" -}}
|
||||
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
|
||||
{{ end -}}
|
||||
{{ range .Data.Pages }}
|
||||
{{ range .Pages }}
|
||||
<item>
|
||||
<link>{{ .Permalink }}</link>
|
||||
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
{{ with .Site.Params.Podcast.Complete }}<itunes:complete>{{ . }}</itunes:complete>{{ end }}
|
||||
{{ with .Site.Params.Podcast.NewFeed }}<itunes:new-feed-url>{{ . }}</itunes:new-feed-url>{{ end }}
|
||||
<itunes:explicit>{{ if .Site.Params.Podcast.Explicit }}true{{ else }}false{{ end }}</itunes:explicit>
|
||||
{{ range .Data.Pages }}
|
||||
{{ range .Pages }}
|
||||
<item>
|
||||
<title>{{ .Title }}</title>
|
||||
<itunes:title>{{ .Title }}</itunes:title>
|
||||
|
|
|
|||
Loading…
Reference in a new issue