# Path: blog/feeds.py
# class PostFeed(Feed):
#     """
#     定义文章 ATOM 输出的类
#     """
#     feed_type = Atom1Feed
#     title = "学习笔记"
#     link = "/"
#     subtitle = "恩岩的学习笔记"
# 
#     def items(self):
#         return Post.objects.order_by('-id')
# 
#     def item_title(self, item):
#         return item.title
# 
#     def item_description(self, item):
#         return item.body_html
# 
# Path: blog/sitemaps.py
# class StaticSitemap(Sitemap):
#     """静态链接的站点地图"""
#     changefreq = 'daily'
#     priority = 0.5
# 
#     def items(self):
#         return ['index', ]
# 
#     def location(self, item):
#         from django.core.urlresolvers import reverse
#         return reverse(item)
# 
# class PostSitemap(Sitemap):
#     """文章详情页面的站点地图"""
#     changefreq = 'never'
#     priority = 0.5
# 
#     def items(self):
#         return Post.objects.all()
# 
#     def lastmod(self, obj):
#         return obj.modification_time


from django.conf.urls import url, include
from django.contrib.sitemaps.views import sitemap
from django.contrib.flatpages.sitemaps import FlatPageSitemap
from blog.feeds import PostFeed
from blog.sitemaps import StaticSitemap, PostSitemap
from . import views
"""
定义 blog 应用的 URL 映射。
"""

sitemaps = {
    'static': StaticSitemap,

# Path: blog/feeds.py
# class PostFeed(Feed):
#     """
#     定义文章 ATOM 输出的类
#     """
#     feed_type = Atom1Feed
#     title = "学习笔记"
#     link = "/"
#     subtitle = "恩岩的学习笔记"
# 
#     def items(self):
#         return Post.objects.order_by('-id')
# 
#     def item_title(self, item):
#         return item.title
# 
#     def item_description(self, item):
#         return item.body_html
# 
# Path: blog/sitemaps.py
# class StaticSitemap(Sitemap):
#     """静态链接的站点地图"""
#     changefreq = 'daily'
#     priority = 0.5
# 
#     def items(self):
#         return ['index', ]
# 
#     def location(self, item):
#         from django.core.urlresolvers import reverse
#         return reverse(item)
# 
# class PostSitemap(Sitemap):
#     """文章详情页面的站点地图"""
#     changefreq = 'never'
#     priority = 0.5
# 
#     def items(self):
#         return Post.objects.all()
# 
#     def lastmod(self, obj):
#         return obj.modification_time


# Path: blog/urls.py
from django.conf.urls import url, include
from django.contrib.sitemaps.views import sitemap
from django.contrib.flatpages.sitemaps import FlatPageSitemap
from blog.feeds import PostFeed
from blog.sitemaps import StaticSitemap, PostSitemap
from . import views

"""
定义 blog 应用的 URL 映射。
"""

sitemaps = {
    'static': StaticSitemap,

    'posts': PostSitemap,