<?xml version="1.0" encoding="koi8-r"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>$title</title>
- <id>${baseURL}news.html</id>
+ <id>$baseURL$indexFile</id>
<link rel="self" type="application/atom+xml" href="${baseURL}atom_10.xml" />
- <link rel="alternate" type="text/html" href="${baseURL}news.html" />
+ <link rel="alternate" type="text/html" href="$baseURL$indexFile" />
<updated>${posts[0].date}T00:00:00Z</updated>
<author>
<name>$author</name>
write_if_changed(index_name, ''.join(new_text))
-all_titles = []
all_tags = {}
+all_titles = []
+all_titles_tags = []
for year in sorted(years.keys()):
year_titles = []
for file, title, lead, tags in blog[key]:
if file.endswith(".tmpl"): file = file[:-len("tmpl")] + "html"
value = (year, month, day, file, title, lead)
+ all_titles_tags.append((year, month, day, file, title, lead, tags))
all_titles.append(value)
year_titles.append(value)
month_titles.append(value)
$phd_pp_ru.respond(self)
""")
write_if_changed(os.path.join(blog_root, "tags", "index.tmpl"), ''.join(new_text))
+
+
+from atom_10 import atom_10
+from rss_20 import rss_20
+from news import NewsItem
+
+baseURL = "http://phd.pp.ru/Russian/blog/"
+
+items = []
+for item in tuple(reversed(all_titles_tags))[:10]:
+ year, month, day, file, title, lead, tags = item
+ if lead:
+ lead = lead + ' '
+ else:
+ lead = ''
+ item = NewsItem(
+ "%s-%s-%s" % (year, month, day),
+ "%s%s" % (lead, title),
+ "%s/%s/%s/%s" % (year, month, day, file)
+ )
+ items.append(item)
+ item.baseURL = baseURL
+ item.categoryList = tags
+
+namespace = {
+ "title": "Oleg Broytmann's blog",
+ "baseURL": baseURL,
+ "indexFile": "",
+ "description": "",
+ "lang": "ru",
+ "author": "Oleg Broytmann",
+ "email": "phd@phd.pp.ru",
+ "posts": items,
+}
+
+atom_tmpl = str(atom_10(searchList=[namespace]))
+write_if_changed(os.path.join(blog_root, "atom_10.xml"), atom_tmpl)
+rss_tmpl = str(rss_20(searchList=[namespace]))
+write_if_changed(os.path.join(blog_root, "rss_20.xml"), rss_tmpl)