{{ define "main" }}
{{ if eq .Site.Params.blog.layout "sidebar" }}
{{ partial "blog-sidebar.html" . }}
{{ end }}

{{ .Title }}

{{ .Content }}
{{ $featuredPosts := where .Pages ".Params.featured" true }} {{ if isset .Site.Params "blog" }} {{ if isset .Site.Params.blog "featured_sort_by_weight" }} {{ if .Site.Params.blog.featured_sort_by_weight }} {{ $featuredPosts = sort $featuredPosts "Weight" }} {{ end }} {{ else }} {{ $featuredPosts = sort $featuredPosts "Date" "desc" }} {{ end }} {{ else }} {{ $featuredPosts = sort $featuredPosts "Date" "desc" }} {{ end }} {{ $mainFeaturedPost := first 1 $featuredPosts }} {{ if $mainFeaturedPost }} {{ range $mainFeaturedPost }}

{{ .Title }}

{{ .Summary | plainify | safeHTML }}

Continue reading...

{{ if isset .Params "images" }} {{ with .Params.images }} {{ if isset . "featured_image" }}
{{ $.Title }}
{{ end }} {{ end }} {{ end }}
{{ end }} {{ else }} {{ end }}
{{ $secondaryFeaturedPosts := after 1 $featuredPosts | first 2 }} {{ if $secondaryFeaturedPosts }} {{ range $secondaryFeaturedPosts }}
{{ with .GetTerms "topics" }} {{ range first 1 . }} {{ .LinkTitle }} {{ end }} {{ end }}

{{ .Title }}

{{ .Date.Format "Jan 2, 2006" }}
{{ .Summary | plainify | truncate 120 }}
Continue reading
{{ if isset .Params "images" }} {{ with .Params.images }} {{ if isset . "featured_image" }} {{ $.Title }} {{ else }} Placeholder Thumbnail {{ end }} {{ end }} {{ else }} Placeholder Thumbnail {{ end }}
{{ end }} {{ end }}
{{ $allPosts := .Pages }} {{ $nonFeaturedPosts := where $allPosts ".Params.featured" "!=" true }} {{ range $nonFeaturedPosts }}
{{ .Render "summary" }}
{{ end }}
{{ if eq .Site.Params.blog.layout "sidebar-right" }}
{{ partial "blog-sidebar.html" . }}
{{ end }}
{{ end }}