Sha256: 935edf44ccd0ed82cb7a0f042122ffea2dc6be44d9fe4518dd81dd2071f455f4
Contents?: true
Size: 757 Bytes
Versions: 13
Compression:
Stored size: 757 Bytes
Contents
require 'zine/page' module Zine # A page where the content comes from an array, usually an array of # links to other pages, eg an index page like the home page class DataPage < Zine::Page def initialize(data, templates, site_options, suffix = '.html') init_templates(templates) @formatted_data = FormattedData.new({}, site_options) @formatted_data.page[:title] = data[:title] @formatted_data.data = data[:post_array] @dest_path = File.join(data[:build_dir], Zine::Page.slug(data[:name]) + suffix) write end def write html = template_the_html compressor = HtmlCompressor::Compressor.new File.write(@dest_path, compressor.compress(html)) end end end
Version data entries
13 entries across 13 versions & 1 rubygems