Commits

Takeshi Komiya committed 0e1bd28

* Use Map.updated_at in sitemap

Comments (0)

Files changed (2)

 @app.route('/sitemap.xml')
 def sitemap():
     maps = Map.all().order('-id').fetch(1000)
-    for map in maps:
-        map.lastmod = datetime.datetime.now().isoformat()
-
     return render_template('sitemap.xml', maps=maps)
 
 

app/templates/sitemap.xml

     <loc>http://gmappers.monochrome.jp/show_map/{{ map.id }}</loc>
     <changefreq>weekly</changefreq>
     <priority>1.0</priority>
-    <lastmod>{{ map.lastmod }}</lastmod>
+    <lastmod>{{ map.updated_at.isoformat() }}</lastmod>
   </url>
   {% endfor %}
 </urlset>