Sha256: b863d9c2dd0d0a942e63f52f1a067a0970cc8bd8d3f4892e26c26b2192c2e0fc
Contents?: true
Size: 990 Bytes
Versions: 2
Compression:
Stored size: 990 Bytes
Contents
# -*- encoding: utf-8 -*- require 'webgen/path_handler/base' require 'webgen/path_handler/page_utils' module Webgen class PathHandler # Path handler for handling content files in Webgen Page Format. class Page include Base include PageUtils # Create a page file from +path+. 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 # Render the block +block_name+ of the given +node+. # # If the parameter +chain+ (an array of template nodes) is not set, the default template chain # for the given +node+ is used. def content(node, block_name = 'content', chain = node.template_chain) chain << node chain.first.render_block(block_name, Webgen::Context.new(@website, :chain => chain)).content end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
webgen-1.0.0.beta3 | lib/webgen/path_handler/page.rb |
webgen-1.0.0.beta2 | lib/webgen/path_handler/page.rb |