From da9178b83de9f412a858db5264bb61f6ad6a04e4 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 4 May 2012 15:13:11 +0200 Subject: [PATCH 1/2] Force escape on title in Atom feed Signed-off-by: Julien Danjou --- hyde/layouts/basic/layout/atom.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hyde/layouts/basic/layout/atom.j2 b/hyde/layouts/basic/layout/atom.j2 index 5f894fe..8ab04db 100644 --- a/hyde/layouts/basic/layout/atom.j2 +++ b/hyde/layouts/basic/layout/atom.j2 @@ -21,7 +21,7 @@ {% for res in resource.node.walk_resources_sorted_by_time() %} - {{ res.meta.title }} + {{ res.meta.title|forceescape }} {{ res.meta.author }} {{ res.meta.created|xmldatetime }} @@ -46,4 +46,4 @@ {% endfor %} - \ No newline at end of file + From d47707af6c8f0c683103016a8f21ab0e0ca4527f Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Thu, 21 Jun 2012 15:31:57 +0200 Subject: [PATCH 2/2] Add Node.rwalk support Signed-off-by: Julien Danjou --- hyde/site.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hyde/site.py b/hyde/site.py index be17521..fa56087 100644 --- a/hyde/site.py +++ b/hyde/site.py @@ -192,6 +192,16 @@ class Node(Processable): for node in child.walk(): yield node + def rwalk(self): + """ + Walk the node upward, first yielding itself then + yielding its parents. + """ + x = self + while x: + yield x + x = x.parent + def walk_resources(self): """ Walks the resources in this hierarchy.