<commit_before>module Beef
  module Pages
    module HelperMethods
      def get_template_names
        templates = []
        Dir.glob("#{RAILS_ROOT}/app/views/pages/templates/*") do |f| 
          match = /\/([^\/]+)\.html\.erb$/.match(f)
          templates << match[1] unless match.nil?
        end
        # Move default to top if it exists
        if default = templates.delete('default')
          templates.insert(0, default)
        end 
        templates
      end
    end
    
    module UrlHelper
      def page_path(page, options = {})
        permalink = page.is_a?( Page ) ? page.permalink : page.to_s
        page_permalink_path(permalink,options)
      end
    
      def page_url(page, options = {}) 
        page_path(page, options.merge(:only_path => false)) 
      end
    end
  end
end<commit_msg>enable support for hidden templates if needed<commit_after>module Beef
  module Pages
    module HelperMethods
      def get_template_names
        templates = []
        
        # get all files that would be useable templates from the templates folder
        # templates that start with an underscore are considered hidden
        Dir.glob("#{RAILS_ROOT}/app/views/pages/templates/*") do |f| 
          match = /\/([^_][^\/]+)\.html\.erb$/.match(f)
          templates << match[1] unless match.nil?
        end
        # Move default to top if it exists
        if default = templates.delete('default')
          templates.insert(0, default)
        end
        templates
      end
    end
    
    module UrlHelper
      def page_path(page, options = {})
        permalink = page.is_a?( Page ) ? page.permalink : page.to_s
        page_permalink_path(permalink,options)
      end
    
      def page_url(page, options = {}) 
        page_path(page, options.merge(:only_path => false)) 
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.10403050108932461, 'fraction_numerical': 0.002178649237472767, 'mean_word_length': 2.0413907284768213, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '5058765', 'n_tokens_mistral': 550, 'n_tokens_neox': 543, 'n_words': 140}