class Webgen::PathHandler::Page
Path handler for handling content files in Webgen Page Format.
Public Instance Methods
content(node)
click to toggle source
Render the content of the given page node.
# File lib/webgen/path_handler/page.rb 24 def content(node) 25 @website.ext.item_tracker.add(node, :template_chain, node) 26 chain = node.template_chain << node 27 chain.first.render_block('content', Webgen::Context.new(@website, :chain => chain)).content 28 end
create_nodes(path, blocks)
click to toggle source
Create a page file from path.
# File lib/webgen/path_handler/page.rb 15 def create_nodes(path, blocks) 16 path.meta_info['lang'] ||= @website.config['website.lang'] 17 path.ext = 'html' if path.ext == 'page' 18 create_node(path) do |node| 19 set_blocks(node, blocks) 20 end 21 end