Class: Alchemy::Generators::PageLayoutsGenerator

Inherits:
Base
  • Object
show all
Defined in:
lib/rails/generators/alchemy/page_layouts/page_layouts_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_partialsObject


9
10
11
12
13
14
15
16
17
# File 'lib/rails/generators/alchemy/page_layouts/page_layouts_generator.rb', line 9

def create_partials
  @page_layouts = load_alchemy_yaml('page_layouts.yml')
  return unless @page_layouts
  @page_layouts.each do |page_layout|
    next if page_layout['redirects_to_external']
    @page_layout_name = page_layout["name"].underscore
    conditional_template "layout.html.#{template_engine}", "#{page_layouts_dir}/_#{@page_layout_name}.html.#{template_engine}"
  end
end