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, line 24
def content(node)
  @website.ext.item_tracker.add(node, :template_chain, node)
  chain = node.template_chain << node
  chain.first.render_block('content', Webgen::Context.new(@website, :chain => chain)).content
end
create_nodes(path, blocks) click to toggle source

Create a page file from path.

# File lib/webgen/path_handler/page.rb, line 15
def create_nodes(path, blocks)
  path.meta_info['lang'] ||= @website.config['website.lang']
  path.ext = 'html' if path.ext == 'page'
  create_node(path) do |node|
    set_blocks(node, blocks)
  end
end