constance

Scripts for generating (an earlier obsolete version of) my personal web site
git clone https://code.djc.id.au/git/constance/
commit fb3eab629dbd41cf263ab6ed02654a9e0956bfae
parent 7d1d495ac8a06e12d999fc767ee20928346550d6
Author: Dan Callaghan <djc@djc.id.au>
Date:   Sun, 15 Aug 2010 13:41:30 +1000

need to quote URLs

Diffstat:
Mtemplates/blog/entry.atom | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/templates/blog/entry.atom b/templates/blog/entry.atom
@@ -3,6 +3,7 @@
        xmlns:xi="http://www.w3.org/2001/XInclude">
 
 <?python
+import urllib
 from viewutils import ATOM_TIME_FORMAT
 ?>
 
@@ -14,9 +15,9 @@ from viewutils import ATOM_TIME_FORMAT
     <email>djc@djc.id.au</email>
 </author>
 <category py:for="tag in item.tags" scheme="http://www.djc.id.au/tags/" term="${tag}" />
-<link rel="alternate" href="http://www.djc.id.au/blog/${item.id}" />
+<link rel="alternate" href="http://www.djc.id.au/blog/${urllib.quote(item.id.encode('utf8'), '')}" />
 <title type="text">${item.title.striptags()}</title>
-<content type="xhtml" xml:base="http://www.djc.id.au/blog/${item.id}">
+<content type="xhtml" xml:base="http://www.djc.id.au/blog/${urllib.quote(item.id.encode('utf8'), '')}">
     <div xmlns="http://www.w3.org/1999/xhtml">
         ${item.body}
     </div>