{{ . }}
{{ end }} + {{ with .Published }}{{ dateformat . "02. Jan 2006" }}
{{ end }}{{ summary . }}
Viewdiff --git a/posts.go b/posts.go
index af4a215..11c241b 100644
--- a/posts.go
+++ b/posts.go
@@ -186,7 +186,7 @@ func getPosts(context context.Context, config *postsRequestConfig) (posts []*Pos
defaultSelection := "select p.path, coalesce(content, ''), coalesce(published, ''), coalesce(updated, ''), coalesce(parameter, ''), coalesce(value, '') "
postsTable := "posts"
if config.taxonomy != nil && len(config.taxonomyValue) > 0 {
- postsTable = "(select distinct p.* from " + postsTable + " p left outer join post_parameters pp on p.path = pp.path where pp.parameter = '" + config.taxonomy.Name + "' and pp.value = '" + config.taxonomyValue + "')"
+ postsTable = "(select distinct p.* from " + postsTable + " p left outer join post_parameters pp on p.path = pp.path where pp.parameter = '" + config.taxonomy.Name + "' and lower(pp.value) = lower('" + config.taxonomyValue + "'))"
}
if len(config.sections) > 0 {
postsTable = "(select * from " + postsTable + " where"
@@ -199,7 +199,7 @@ func getPosts(context context.Context, config *postsRequestConfig) (posts []*Pos
postsTable += ")"
}
defaultTables := " from " + postsTable + " p left outer join post_parameters pp on p.path = pp.path "
- defaultSorting := " order by coalesce(p.updated, p.published) desc "
+ defaultSorting := " order by p.published desc "
if config.path != "" {
query := defaultSelection + defaultTables + " where p.path=?" + defaultSorting
rows, err = appDb.QueryContext(context, query, config.path)
diff --git a/render.go b/render.go
index 3e9b513..2ab7f22 100644
--- a/render.go
+++ b/render.go
@@ -70,6 +70,7 @@ func initRendering() {
return template.HTML(buf.String()), err
},
"urlize": urlize,
+ "sort": sortedStrings,
}
templates = make(map[string]*template.Template)
diff --git a/templates/summary.gohtml b/templates/summary.gohtml
index 7880bd6..466fb22 100644
--- a/templates/summary.gohtml
+++ b/templates/summary.gohtml
@@ -1,6 +1,7 @@
{{ define "summary" }}
{{ dateformat . "02. Jan 2006" }} {{ summary . }}{{ . }}
{{ end }}
+ {{ with .Published }}