Sha256: 9bd1278ca335cbfbe6b657de57fa06f9b24777ed5ac11b2ce993e69d63b64fa8

Contents?: true

Size: 721 Bytes

Versions: 88

Compression:

Stored size: 721 Bytes

Contents

# frozen_string_literal: true
require_relative "../base"

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

      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

88 entries across 88 versions & 1 rubygems

Version Path
alchemy_cms-6.1.10 lib/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-6.1.9 lib/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-6.1.8 lib/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-6.1.7 lib/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-6.1.6 lib/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-6.1.5 lib/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-6.0.14 lib/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-6.1.4 lib/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-7.0.0.pre.a lib/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-6.0.13 lib/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-6.1.3 lib/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-6.1.2 lib/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-6.1.1 lib/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-6.1.0 lib/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-6.0.12 lib/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-6.0.11 lib/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-6.0.10 lib/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-5.3.8 lib/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-6.0.9 lib/generators/alchemy/site_layouts/site_layouts_generator.rb
alchemy_cms-5.3.7 lib/generators/alchemy/site_layouts/site_layouts_generator.rb