{{- $date := .Date -}} {{- with .Params.dateFormat -}} {{- $date | time.Format . -}} {{- else -}} {{- with .Site.Params.dateFormat -}} {{- $date | time.Format . -}} {{- else -}} {{- $date | time.Format "2006-01-02" -}} {{- end -}} {{- end -}}