Sha256: 9a628768541ef97b793f335d0af8f5b01e6877281d1b40d476006a1707c51cdf

Contents?: true

Size: 872 Bytes

Versions: 15

Compression:

Stored size: 872 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 content of the given page +node+.
      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

    end

  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
webgen-1.7.3 lib/webgen/path_handler/page.rb
webgen-1.7.2 lib/webgen/path_handler/page.rb
webgen-1.7.1 lib/webgen/path_handler/page.rb
webgen-1.7.0 lib/webgen/path_handler/page.rb
webgen-1.6.0 lib/webgen/path_handler/page.rb
webgen-1.5.2 lib/webgen/path_handler/page.rb
webgen-1.5.1 lib/webgen/path_handler/page.rb
webgen-1.5.0 lib/webgen/path_handler/page.rb
webgen-1.4.1 lib/webgen/path_handler/page.rb
webgen-1.4.0 lib/webgen/path_handler/page.rb
webgen-1.3.0 lib/webgen/path_handler/page.rb
webgen-1.2.1 lib/webgen/path_handler/page.rb
webgen-1.2.0 lib/webgen/path_handler/page.rb
webgen-1.1.0 lib/webgen/path_handler/page.rb
webgen-1.0.0 lib/webgen/path_handler/page.rb