Sha256: aa1989f9fd05169deff013b069b085d1d06031a897527fa32cad14c4f2dae2e2

Contents?: true

Size: 594 Bytes

Versions: 8

Compression:

Stored size: 594 Bytes

Contents

module Caboodle
  class Page < Caboodle::Kit
    
    description "Create markdown pages in the config directory and they are displayed as menu items and pages"

    configure do
      pages = []
      Dir[File.join(Caboodle::App.root,"pages","*.md")].map do |a| 
        pages << a.split("/").last.split(".").first
      end
      
      puts pages.inspect
    
      pages.each do |page|
        puts "Add page: #{page}"
        menu "#{page.capitalize.gsub('_',' ')}" do
          @title = page.capitalize.gsub('_',' ')
          markdown :"#{page}"
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
caboodle-0.3.0 lib/caboodle/kits/page/page.rb
caboodle-0.2.30 lib/caboodle/kits/page/page.rb
caboodle-0.2.29 lib/caboodle/kits/page/page.rb
caboodle-0.2.28 lib/caboodle/kits/page/page.rb
caboodle-0.2.27 lib/caboodle/kits/page/page.rb
caboodle-0.2.26 lib/caboodle/kits/page/page.rb
caboodle-0.2.25 lib/caboodle/kits/page/page.rb
caboodle-0.2.24 lib/caboodle/kits/page/page.rb