{{- define "content" -}} {{- $params := .Scratch.Get "params" -}} {{- $profile := .Site.Params.home.profile -}} {{- $posts := .Site.Params.home.posts -}} {{- /* Paginate */ -}} {{- $pages := where site.RegularPages "Type" "in" site.Params.mainSections -}} {{- if .Site.Params.page.hiddenFromHomePage -}} {{- $pages = where $pages "Params.hiddenfromhomepage" false -}} {{- else -}} {{- $pages = where $pages "Params.hiddenfromhomepage" "!=" true -}} {{- end -}} {{ $pinnedPostRelPermalinks := split .Site.Params.pinnedPost "," }} {{ $pinnedPosts := where $pages "RelPermalink" "in" $pinnedPostRelPermalinks }} {{ $pages := where $pages "RelPermalink" "not in" $pinnedPostRelPermalinks }} {{- with $posts.paginate | default .Site.Params.paginate -}} {{- $pages = $.Paginate $pages . -}} {{- else -}} {{- $pages = .Paginate $pages -}} {{- end -}}
{{- /* Profile */ -}} {{- if ne $profile.enable false -}} {{ if (and $profile.onlyToFirstPage (ne $pages.PageNumber 1)) }} {{/* Do nothing if the pinOnlyToFirstPage flag is set and we're not on page 1. */}} {{else}} {{- partial "home/profile.html" . -}} {{- end -}} {{- end -}} {{- /* Content */ -}} {{- if .Content -}}
{{- dict "Content" .Content "Ruby" $params.ruby "Fraction" $params.fraction | partial "function/content.html" | safeHTML -}}
{{- end -}} {{- /* Posts */ -}} {{- if ne $posts.enable false | and .Site.RegularPages -}} {{ if .Site.Params.pinnedPost }} {{ if (and .Site.Params.pinOnlyToFirstPage (ne $pages.PageNumber 1)) }} {{/* Do nothing if the pinOnlyToFirstPage flag is set and we're not on page 1. */}} {{else}} {{ range $pinnedPosts }}
{{- .Render "summary" -}}
{{end}} {{end}} {{end}} {{- range $pages.Pages -}} {{- .Render "summary" -}} {{- end -}} {{- partial "paginator.html" . -}} {{- end -}}
{{- $comment := .Site.Params.Comment -}} {{- $remark42 := $comment.remark42 | default dict -}} {{- if $remark42.enable -}} {{- end -}} {{- end -}}