Permalink
Browse files

add atom:link ref="self" tags in rss10.xml and rss20.xml

  • Loading branch information...
1 parent b5c2879 commit 1f5c9ce84812d99a9ff9a0e9f033ffabd5fecd0d @mdomsch mdomsch committed with Jun 15, 2010
Showing with 8 additions and 0 deletions.
  1. +2 −0 planet/shell/tmpl.py
  2. +3 −0 themes/common/rss10.xml.tmpl
  3. +3 −0 themes/common/rss20.xml.tmpl
View
@@ -256,8 +256,10 @@ def run(script, doc, output_file=None, options={}):
tp.set(key, value)
if output_file:
+ basename = os.path.basename(output_file)
reluri = os.path.splitext(os.path.basename(output_file))[0]
tp.set('url', urlparse.urljoin(config.link(),reluri))
+ tp.set('fullurl', urlparse.urljoin(config.link(),basename))
output = open(output_file, "w")
output.write(tp.process(template))
@@ -14,6 +14,9 @@
<TMPL_IF pubsubhubbub_hub>
<atom:link rel="hub" href="<TMPL_VAR pubsubhubbub_hub ESCAPE="HTML">"/>
</TMPL_IF>
+ <TMPL_IF fullurl>
+ <atom:link rel="self" href="<TMPL_VAR fullurl ESCAPE="HTML">" type="application/rss+xml"/>
+ </TMPL_IF>
<items>
<rdf:Seq>
@@ -9,6 +9,9 @@
<TMPL_IF pubsubhubbub_hub>
<atom:link rel="hub" href="<TMPL_VAR pubsubhubbub_hub ESCAPE="HTML">"/>
</TMPL_IF>
+ <TMPL_IF fullurl>
+ <atom:link rel="self" href="<TMPL_VAR fullurl ESCAPE="HTML">" type="application/rss+xml"/>
+ </TMPL_IF>
<TMPL_LOOP Items>
<item>

0 comments on commit 1f5c9ce

Please sign in to comment.