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" -}}
|
{{ define "main" -}}
|
||||||
<main class="main layout__main">
|
<main class="main layout__main">
|
||||||
<h1 class="title">{{ .Title }}</h1>
|
<h1 class="title">{{ .Title }}</h1>
|
||||||
{{ $paginator := .Paginate (.Data.Pages) -}}
|
{{ $paginator := .Paginate (.Pages) -}}
|
||||||
{{ range $paginator.Pages -}}
|
{{ range $paginator.Pages -}}
|
||||||
{{ .Render "summary"}}
|
{{ .Render "summary"}}
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{{ $list := .Data.Pages -}}
|
{{ $list := .Pages -}}
|
||||||
{{ $length := (len $list) -}}
|
{{ $length := (len $list) -}}
|
||||||
{
|
{
|
||||||
"version" : "https://jsonfeed.org/version/1",
|
"version" : "https://jsonfeed.org/version/1",
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
{{ with .OutputFormats.Get "RSS" -}}
|
{{ with .OutputFormats.Get "RSS" -}}
|
||||||
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
|
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
{{ range .Data.Pages }}
|
{{ range .Pages }}
|
||||||
<item>
|
<item>
|
||||||
<title>{{ .Title }}</title>
|
<title>{{ .Title }}</title>
|
||||||
<link>{{ .Permalink }}</link>
|
<link>{{ .Permalink }}</link>
|
||||||
|
|
|
||||||
|
|
@ -7,5 +7,11 @@
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
|
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
|
||||||
|
{{ range $pages -}}
|
||||||
|
{{ .Render "summary"}}
|
||||||
|
{{ end -}}
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
<h1 class="title">Micro posts</h1>
|
<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>
|
<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 -}}
|
{{ range $paginator.Pages -}}
|
||||||
{{ .Render "summary"}}
|
{{ .Render "summary"}}
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{{ $list := .Data.Pages -}}
|
{{ $list := .Pages -}}
|
||||||
{{ $length := (len $list) -}}
|
{{ $length := (len $list) -}}
|
||||||
{
|
{
|
||||||
"version" : "https://jsonfeed.org/version/1",
|
"version" : "https://jsonfeed.org/version/1",
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
{{ with .OutputFormats.Get "RSS" -}}
|
{{ with .OutputFormats.Get "RSS" -}}
|
||||||
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
|
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
{{ range .Data.Pages }}
|
{{ range .Pages }}
|
||||||
<item>
|
<item>
|
||||||
<link>{{ .Permalink }}</link>
|
<link>{{ .Permalink }}</link>
|
||||||
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
<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.Complete }}<itunes:complete>{{ . }}</itunes:complete>{{ end }}
|
||||||
{{ with .Site.Params.Podcast.NewFeed }}<itunes:new-feed-url>{{ . }}</itunes:new-feed-url>{{ 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>
|
<itunes:explicit>{{ if .Site.Params.Podcast.Explicit }}true{{ else }}false{{ end }}</itunes:explicit>
|
||||||
{{ range .Data.Pages }}
|
{{ range .Pages }}
|
||||||
<item>
|
<item>
|
||||||
<title>{{ .Title }}</title>
|
<title>{{ .Title }}</title>
|
||||||
<itunes:title>{{ .Title }}</itunes:title>
|
<itunes:title>{{ .Title }}</itunes:title>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue