diff --git a/cmd/gmnhg/templates.go b/cmd/gmnhg/templates.go index 046d9d6..6ce1c50 100644 --- a/cmd/gmnhg/templates.go +++ b/cmd/gmnhg/templates.go @@ -35,9 +35,9 @@ func defineFuncMap() template.FuncMap { return fm } -var defaultSingleTemplate = mustParseTmpl("single", `# {{ .Metadata.PostTitle }} +var defaultSingleTemplate = mustParseTmpl("single", `# {{ .Metadata.Title }} -{{ .Metadata.PostDate.Format "2006-01-02 15:04" }} +{{ .Metadata.Date.Format "2006-01-02 15:04" }} {{ printf "%s" .Post }}`) @@ -47,7 +47,7 @@ var defaultIndexTemplate = mustParseTmpl("index", `# Site index {{- range $dir, $posts := .PostData }}{{ if and (ne $dir "/") (eq (dir $dir) "/") }} Index of {{ trimPrefix "/" $dir }}: -{{ range $p := $posts | sortPosts }}=> {{ $p.Link }} {{ $p.Metadata.PostDate.Format "2006-01-02 15:04" }} - {{ if $p.Metadata.PostTitle }}{{ $p.Metadata.PostTitle }}{{else}}{{ $p.Link }}{{end}} +{{ range $p := $posts | sortPosts }}=> {{ $p.Link }} {{ $p.Metadata.Date.Format "2006-01-02 15:04" }} - {{ if $p.Metadata.Title }}{{ $p.Metadata.Title }}{{else}}{{ $p.Link }}{{end}} {{ end }}{{ end }}{{ end }} `) @@ -71,11 +71,11 @@ var defaultRssTemplate = mustParseTmpl("rss", `{{- $Site := .Site -}} {{ range $i, $p := .Posts | sortPosts }}{{ if lt $i 25 }} {{- $AbsURL := list (trimSuffix "/" $Site.GeminiBaseURL) (trimPrefix "/" $p.Link) | join "/" | html }} - {{ if $p.Metadata.PostTitle }}{{ html $p.Metadata.PostTitle }}{{ else }}{{ trimPrefix "/" $p.Link | html }}{{end}} + {{ if $p.Metadata.Title }}{{ html $p.Metadata.Title }}{{ else }}{{ trimPrefix "/" $p.Link | html }}{{end}} {{ $AbsURL }} - {{ $p.Metadata.PostDate.Format "Mon, 02 Jan 2006 15:04:05 -0700" }} + {{ $p.Metadata.Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" }} {{ $AbsURL }} - {{ html $p.Metadata.PostSummary }} + {{ html $p.Metadata.Summary }} {{end}}{{end}}