{{ $show_date := .show_date | default true }}
{{ $pages := .pages }}
{{ $group_by_year := .group_by_year | default true }}

{{- if $pages -}}
{{- if $show_date -}}
    {{- $pages = $pages.ByPublishDate.Reverse -}}
{{- end -}}
<ul class="list-layout">
    {{ range $pages }}
        <li>
            <a href="{{ .RelPermalink }}">
                {{- .Title -}}
            </a>
            {{ if $show_date }}
                <span>
                    {{ if $group_by_year }}
                        {{- .PublishDate.Format "01/02" -}}
                    {{ else }}
                        {{- .PublishDate.Format "2006/01/02" -}}
                    {{ end }}
                </span>
            {{ end }}
        </li>
    {{ end }}
</ul>
{{- end -}}
