From e5bc198de105c366cacd48d1d4a9fae63b699225 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Wed, 9 Mar 2016 10:54:46 -0500 Subject: fix tag urls --- src/guff/handlers/blog.cr | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/guff') diff --git a/src/guff/handlers/blog.cr b/src/guff/handlers/blog.cr index 21e7db7..b961955 100644 --- a/src/guff/handlers/blog.cr +++ b/src/guff/handlers/blog.cr @@ -227,7 +227,7 @@ class Guff::Handlers::BlogHandler < Guff::Handler tag: "
  • %{name} (%{num_posts} posts) @@ -237,12 +237,17 @@ class Guff::Handlers::BlogHandler < Guff::Handler }) private def draw_tags(context, tags) + # generate tag url prefix + p = (context.request.path || "").match(/\/$/) ? "" : "./tag/" + # create page page = PageHTMLView.new( title: "Tags", body: TAG_TEMPLATES[:body].run({ "tags": tags.map { |row| - TAG_TEMPLATES[:tag].run(row.reduce({} of String => String) do |r, k, v| + TAG_TEMPLATES[:tag].run(row.reduce({ + "p": p + }) do |r, k, v| r[k] = HTML.escape(v.to_s) r end) -- cgit v1.2.3