Sha256: a085e12e5ef740d361932e98f799e49b775c3cdea96d8e026cc1c32b9c1d8d0f
Contents?: true
Size: 1.54 KB
Versions: 14
Compression:
Stored size: 1.54 KB
Contents
# frozen_string_literal: true module Paperwork ## # task generators for building with middleman module Tasks require "rake" ## # task generator for root_helpers.rb that will # provide url path to the root page # class RootHelpers < Paperwork::Tasks::Base attr_reader :root include Rake::DSL def initialize(dir, root, *dependencies) super( File.join(dir, "lib", "root_helpers.rb"), dir, *dependencies ) Template.new(dir) @root = File.basename(root, ".md") + ".html" end def tasks file self.name => self.dependencies do File.write( name, <<~ROOT_HELPERS module RootHelpers def root_path relative_link "#{self.root}" end def custom_css ["#{Paperwork::Config[:custom_css].join("\", \"")}"] end def custom_js ["#{Paperwork::Config[:custom_js].join("\", \"")}"] end end ROOT_HELPERS ) end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems