Sha256: 65b9e8e46f35e86b3a5d6ab8ff3471b5b8caaf694c52e159591b6a48fc8f23c8
Contents?: true
Size: 1.04 KB
Versions: 4
Compression:
Stored size: 1.04 KB
Contents
Loquacious.configuration_for(:webby) { desc "The default directory where new tumblog posts will be created." tumblog_dir 'blog' } namespace :tumblog do # iterate over all the files in the "templates/tumblog" folder and create a # rake task corresponding to each file found FileList["#{Webby.site.template_dir}/tumblog/*"].each do |template| next unless test(?f, template) name = template.pathmap('%n') desc "Create a new tumblog #{name}" task name do |t| page = Webby.site.args.page title = Webby.site.args.title dir = Webby.site.args.dir # if no directory was given use the default tumblog directory (underneath # the content directory) dir = Webby.site.tumblog_dir if dir.empty? dir = File.join(dir, Time.now.strftime('%Y%m')) page = File.join(dir, File.basename(page)) page = Webby::Builder.create(page, :from => template, :locals => {:title => title, :directory => dir}) Webby.exec_editor(page) end end # each end # namespace :tumblog # EOF
Version data entries
4 entries across 3 versions & 2 rubygems