浏览代码

Add support for tags with multiple words

Fixes issue where `my-blog/tags/multi-word-tag` would result in a 404, even if there was a valid tag slug for `mult-word-tag`
LB (Ben Johnston) 7 年之前
父节点
当前提交
02710075ae
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      bakerydemo/blog/models.py

+ 1 - 1
bakerydemo/blog/models.py

@@ -179,7 +179,7 @@ class BlogIndexPage(RoutablePageMixin, Page):
     # More information on RoutablePages is at
     # http://docs.wagtail.io/en/latest/reference/contrib/routablepage.html
     @route('^tags/$', name='tag_archive')
-    @route('^tags/(\w+)/$', name='tag_archive')
+    @route('^tags/([\w-]+)/$', name='tag_archive')
     def tag_archive(self, request, tag=None):
 
         try: