lib/webgen/sourcehandler/page.rb in gettalong-webgen-0.5.7.20090227 vs lib/webgen/sourcehandler/page.rb in gettalong-webgen-0.5.8.20090507
- old
+ new
@@ -30,11 +30,11 @@
def render_node(node, block_name = 'content', templates = website.blackboard.invoke(:templates_for_node, node))
chain = [templates, node].flatten
if chain.first.node_info[:page].blocks.has_key?(block_name)
node.node_info[:used_nodes] << chain.first.absolute_lcn
- context = chain.first.node_info[:page].blocks[block_name].render(Webgen::ContentProcessor::Context.new(:chain => chain))
+ context = chain.first.node_info[:page].blocks[block_name].render(Webgen::Context.new(:chain => chain))
context.content
else
raise "Error rendering <#{node.absolute_lcn}>: no block named '#{block_name}' in <#{chain.first.absolute_lcn}>"
end
end
@@ -45,14 +45,18 @@
#######
# Checks if the meta information provided by the file in Webgen Page Format changed.
def meta_info_changed?(node)
path = website.blackboard.invoke(:source_paths)[node.node_info[:src]]
- return if node.node_info[:processor] != self.class.name || !path.changed?
+ return if node.node_info[:processor] != self.class.name || (path && !path.changed?)
- old_mi = node.node_info[:sh_page_node_mi]
- new_mi = Webgen::Page.meta_info_from_data(path.io.data)
- node.flag(:dirty_meta_info) if old_mi && old_mi != new_mi
+ if !path
+ node.flag(:dirty_meta_info)
+ else
+ old_mi = node.node_info[:sh_page_node_mi]
+ new_mi = Webgen::Page.meta_info_from_data(path.io.data)
+ node.flag(:dirty_meta_info) if old_mi && old_mi != new_mi
+ end
end
end
end