{{ define "main" }} {{ $baseurl := .Site.BaseURL }}
{{ if eq .Data.Singular "tag" }}

#{{ .Title | lower }}

{{ else }}

{{ .Title }}

{{ end }} {{ .Content }}
{{ if .Pages }} {{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups}}

{{ .Key }}

{{ range where .Pages "Section" "posts" }}
{{ .Title }} {{ if .Params.tags }}
{{ range $i, $t := .Params.tags }} #{{ $t }} {{ end }}
{{ end }}
{{ partial "aside" . }}
{{ end }} {{ end }} {{ end }}
{{ partial "pagination" . }} {{ end }}