Implement mainSections for home page and replace .Data.Pages with alias .Pages.

This commit is contained in:
Fredrik Jonsson 2019-08-16 13:05:43 +02:00
commit a942441544
3 changed files with 13 additions and 7 deletions

View file

@ -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 -}}

View file

@ -1,4 +1,4 @@
{{ $list := .Data.Pages -}}
{{ $list := .Pages -}}
{{ $length := (len $list) -}}
{
"version" : "https://jsonfeed.org/version/1",

View file

@ -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>