Class: Estatic::Generator
- Inherits:
-
Object
- Object
- Estatic::Generator
- Defined in:
- lib/estatic/generator.rb
Instance Method Summary collapse
-
#initialize ⇒ Generator
constructor
A new instance of Generator.
- #run ⇒ Object
Constructor Details
#initialize ⇒ Generator
3 4 5 6 7 8 9 |
# File 'lib/estatic/generator.rb', line 3 def initialize site_path = "#{Dir.pwd}/estatic_site".freeze unless File.directory?(site_path) FileUtils.mkdir_p site_path end end |
Instance Method Details
#run ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/estatic/generator.rb', line 11 def run generate_home_page if config.featured config.categories.each do |config_category| category = fetch_category(config_category) generate_product_listings_pages(category) unless category.has_subcategories? generate_product_pages(category) if config.include_product_page else category.subcategories.each do |subcategory| generate_product_listings_pages(subcategory) generate_product_pages(subcategory) if config.include_product_page end end end copy_assets_folder end |