aboutsummaryrefslogtreecommitdiff
path: root/src/guff/handlers
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2016-03-09 15:49:25 -0500
committerPaul Duncan <pabs@pablotron.org>2016-03-09 15:49:25 -0500
commit9f8c1fce2c94c9fb040586740e28b3e83a3cc41f (patch)
tree0ad3b470b84c13187ff374c8f2a4d26383095c85 /src/guff/handlers
parent7417966101a0b0bbd0fefc8723482ae5a2010f19 (diff)
downloadold-guff-9f8c1fce2c94c9fb040586740e28b3e83a3cc41f.tar.bz2
old-guff-9f8c1fce2c94c9fb040586740e28b3e83a3cc41f.zip
add created_at sorting and use json for sort fields
Diffstat (limited to 'src/guff/handlers')
-rw-r--r--src/guff/handlers/blog.cr12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/guff/handlers/blog.cr b/src/guff/handlers/blog.cr
index b961955..e9d9763 100644
--- a/src/guff/handlers/blog.cr
+++ b/src/guff/handlers/blog.cr
@@ -166,14 +166,16 @@ class Guff::Handlers::BlogHandler < Guff::Handler
#######################
FILTERS = {
- year: "year",
- month: "month",
- day: "day",
- slug: "slug",
+ posted_year: "year",
+ posted_month: "month",
+ posted_day: "day",
+ slug: "slug",
}
private def get_post_filters(md) : Hash(Symbol, String)
- FILTERS.reduce({} of Symbol => String) do |r, k, s|
+ FILTERS.reduce({
+ state: "posted"
+ }) do |r, k, s|
r[k] = md[s] if md[s]?
r
end