<commit_before>require File.join(__FILE__, '../../base')

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

      def create_directory
        @page_layouts_dir = "#{Rails.root}/app/views/alchemy/page_layouts"
        empty_directory @page_layouts_dir
      end

      def create_partials
        @page_layouts = load_alchemy_yaml('page_layouts.yml')
        @page_layouts.each do |page_layout|
          @page_layout_name = page_layout["name"].underscore
          conditional_template "layout.html.#{template_engine}", "#{@page_layouts_dir}/_#{@page_layout_name}.html.#{template_engine}"
        end if @page_layouts
      end
    end
  end
end<commit_msg>Do not generate views for layouts that redirect to external.<commit_after>require File.join(__FILE__, '../../base')

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

      def create_directory
        @page_layouts_dir = "#{Rails.root}/app/views/alchemy/page_layouts"
        empty_directory @page_layouts_dir
      end

      def create_partials
        @page_layouts = load_alchemy_yaml('page_layouts.yml')
        @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 if @page_layouts
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.09874429223744292, 'fraction_numerical': 0.0, 'mean_word_length': 3.4719387755102042, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6720875', 'n_tokens_mistral': 532, 'n_tokens_neox': 522, 'n_words': 105}