Sha256: d78f452589823a13aab7e5ad38c3926b9467cd7957d7f196d359759011a28473
Contents?: true
Size: 1.12 KB
Versions: 14
Compression:
Stored size: 1.12 KB
Contents
require 'shinmun' blog = Shinmun::Blog.new task :index do blog.write "index.html", "index.rhtml" blog.write "index.rss", "index.rxml" end blog.pages.each do |page| task page.path do blog.write page.path, "page.rhtml", :page => page end end blog.posts.each do |post| task "#{post.path}.html" do blog.write "#{post.path}.html", "post.rhtml", :post => post end end blog.archives.each do |year, month| task "#{year}/#{month}" do blog.write "#{year}/#{month}/index.html", "archive.rhtml", :year => year, :month => month end end blog.categories.each do |name| category = blog.find_category(name) task "categories/#{category[:permalink]}" do blog.write "categories/#{category[:permalink]}.html", "category.rhtml", category blog.write "categories/#{category[:permalink]}.rss", "category.rxml", category end end task :pages => blog.pages.map { |p| p.path } task :posts => blog.posts.map { |p| p.path } task :archives => blog.archives.map { |y,m| "#{y}/#{m}" } task :categories => blog.categories.map { |name| "categories/#{blog.urlify name}" } task :default => [:index, :pages, :posts, :archives, :categories]
Version data entries
14 entries across 13 versions & 1 rubygems