- else:
- article_patterns += patterns('',
- url((r'^(?:%s)/(?P<year>\d{4})/(?P<slug>[-\w]+)/?$' % self.article_permalink_base), self.article_view)
- )
- else:
- article_patterns += patterns('',
- url((r'^(?:%s)/(?P<slug>[-\w]+)/?$' % self.article_permalink_base), self.article_view)
+ if self.article_permalink_style == 'D':
+ urlpatterns += patterns('',
+ url(r'^(?:%s)/(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/' % self.article_permalink_base, include(self.feed_patterns(self.get_articles_by_ymd, self.article_archive_page, 'articles_by_day')))
+ )
+
+ if self.article_permalink_style == 'Y':
+ urlpatterns += patterns('',
+ url(r'^(?:%s)/(?P<year>\d{4})/(?P<slug>[\w-]+)/$' % self.article_permalink_base, self.article_view)
+ )
+ elif self.article_permalink_style == 'M':
+ urlpatterns += patterns('',
+ url(r'^(?:%s)/(?P<year>\d{4})/(?P<month>\d{2})/(?P<slug>[\w-]+)/$' % self.article_permalink_base, self.article_view)
+ )
+ elif self.article_permalink_style == 'D':
+ urlpatterns += patterns('',
+ url(r'^(?:%s)/(?P<year>\d{4})/(?P<month>\d{2})/(?P<day>\d{2})/(?P<slug>[\w-]+)/$' % self.article_permalink_base, self.article_view)
+ )
+ else:
+ urlpatterns += patterns('',
+ url(r'^(?:%s)/(?P<slug>[-\w]+)/?$' % self.article_permalink_base, self.article_view)