<commit_before>module Precious
  module Views
    class Create < Layout
      include Editable

      attr_reader :page, :name

      def title
        "Create a new page"
      end
      
      def is_create_page
        true
      end
      
      def is_edit_page
        false
      end
      
      def format
        @format = (@page.format || false) if @format.nil?
        @format.to_s.downcase
      end
    
      def has_footer 
        @footer = (@page.footer || false) if @footer.nil?
        !!@footer
      end
        
      def has_sidebar
        @sidebar = (@page.sidebar || false) if @sidebar.nil?
        !!@sidebar
      end

      def page_name
        @name.gsub('-', ' ')
      end

      def formats
        super(:markdown)
      end
    end
  end
end<commit_msg>fix some 'create' view errors if @page is nil<commit_after>module Precious
  module Views
    class Create < Layout
      include Editable

      attr_reader :page, :name

      def title
        "Create a new page"
      end
      
      def is_create_page
        true
      end
      
      def is_edit_page
        false
      end
      
      def format
        @format = (@page.format || false) if @format.nil? && @page
        @format.to_s.downcase
      end

      def has_footer
        @footer = (@page.footer || false) if @footer.nil? && @page
        !!@footer
      end

      def has_sidebar
        @sidebar = (@page.sidebar || false) if @sidebar.nil? && @page
        !!@sidebar
      end

      def page_name
        @name.gsub('-', ' ')
      end

      def formats
        super(:markdown)
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.08610086100861009, 'fraction_numerical': 0.0, 'mean_word_length': 1.4503012048192772, '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': '1194074', 'n_tokens_mistral': 494, 'n_tokens_neox': 478, 'n_words': 140}