Sha256: b070fc6c4c4e11731051dee63326011ac3d3085bb4c4dadbafb6b0bf7e4334f7
Contents?: true
Size: 804 Bytes
Versions: 30
Compression:
Stored size: 804 Bytes
Contents
require_relative '../base' module Alchemy module Generators class PageLayoutsGenerator < Base desc "This generator generates your page_layouts view partials." source_root File.expand_path('templates', __dir__) 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 private def page_layouts_dir @_page_layouts_dir ||= "app/views/alchemy/page_layouts" end end end end
Version data entries
30 entries across 30 versions & 1 rubygems