[PATCH 2/3] add atom:link ref="self" tags in rss10.xml and rss20.xml

Matt Domsch Matt_Domsch at dell.com
Wed Jun 16 02:30:48 EST 2010


>From 481eac5de8dee79fd9becc056b4ff656d764d161 Mon Sep 17 00:00:00 2001
From: Matt Domsch <Matt_Domsch at dell.com>
Date: Tue, 15 Jun 2010 10:39:47 -0500
Subject: [PATCH 2/3] add atom:link ref="self" tags in rss10.xml and rss20.xml

---
 planet/shell/tmpl.py         |    2 ++
 themes/common/rss10.xml.tmpl |    3 +++
 themes/common/rss20.xml.tmpl |    3 +++
 3 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/planet/shell/tmpl.py b/planet/shell/tmpl.py
index a99d7ae..04eb20a 100644
--- a/planet/shell/tmpl.py
+++ b/planet/shell/tmpl.py
@@ -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))
diff --git a/themes/common/rss10.xml.tmpl b/themes/common/rss10.xml.tmpl
index 1652f5c..750bf4f 100644
--- a/themes/common/rss10.xml.tmpl
+++ b/themes/common/rss10.xml.tmpl
@@ -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>
diff --git a/themes/common/rss20.xml.tmpl b/themes/common/rss20.xml.tmpl
index 1503f12..217051c 100644
--- a/themes/common/rss20.xml.tmpl
+++ b/themes/common/rss20.xml.tmpl
@@ -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>
-- 
1.7.0.1



More information about the devel mailing list