Sha256: fcb4f3103a41c3ac5c3b5034b4b8331be7da6ba39e7f5e9cf88ba401ac749ec2

Contents?: true

Size: 720 Bytes

Versions: 18

Compression:

Stored size: 720 Bytes

Contents

require File.join(__FILE__, '../../base')

module Alchemy
  module Generators
    class SiteLayoutsGenerator < Base
      desc "This generator generates your site layouts view partials."
      source_root File.expand_path('templates', File.dirname(__FILE__))

      def create_partials
        @sites = Alchemy::Site.all
        return unless @sites
        @sites.each do |site|
          @site_name = site.name.parameterize.underscore
          conditional_template "layout.html.#{template_engine}", "#{site_layouts_dir}/_#{@site_name}.html.#{template_engine}"
        end
      end

      private

      def site_layouts_dir
        @_site_layouts_dir ||= "app/views/alchemy/site_layouts"
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
alchemy_cms-4.0.6 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-3.6.7 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-3.6.6 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-4.0.5 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-4.0.4 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-4.0.3 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-3.6.5 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-4.0.2 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-4.0.1 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-3.6.4 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-4.0.0 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-3.6.3 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-3.6.2 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-4.0.0.rc2 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-4.0.0.rc1 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-3.6.1 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-4.0.0.beta lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-3.6.0 lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb