<commit_before>require 'erb'
require_relative 'template_processor'

module Compiler
  class LiquidProcessor < TemplateProcessor

    @@yield_hash = {
      page_title: "{% if page.title %}{{ page.title }}{% endif %}",
      head: "{% include layouts/_head.html %}",
      body_classes: "{% include layouts/_body_classes.html %}",
      content: "{{ content }}",
      body_end: "{% include layouts/_body.html %}",
      footer_top: "{% include layouts/footer_top.html %}",
      footer_support_links: "{% include layouts/footer_support_links.html %}",
      inside_header: "{% include layouts/inside_header.html %}",
      after_header: "{% include layouts/after_header.html %}",
      cookie_message: "{% include layouts/_cookie_message.html %}"
    }

    def handle_yield(section = :layout)
      @@yield_hash[section]
    end

    def asset_path(file, options={})
      return file if @is_stylesheet
      case File.extname(file)
      when '.css'
        "{{ site.govuk_template_assets }}/stylesheets/#{file}"
      when '.js'
        "{{ site.govuk_template_assets }}/javascripts/#{file}"
      else
        "{{ site.govuk_template_assets }}/images/#{file}"
      end
    end

    def content_for?(*args)
      @@yield_hash.include? args[0]
    end
  end
end
<commit_msg>Standardise on underscores for partials<commit_after>require 'erb'
require_relative 'template_processor'

module Compiler
  class LiquidProcessor < TemplateProcessor

    @@yield_hash = {
      page_title: "{% if page.title %}{{ page.title }}{% endif %}",
      head: "{% include layouts/_head.html %}",
      body_classes: "{% include layouts/_body_classes.html %}",
      content: "{{ content }}",
      body_end: "{% include layouts/_body.html %}",
      footer_top: "{% include layouts/_footer_top.html %}",
      footer_support_links: "{% include layouts/_footer_support_links.html %}",
      inside_header: "{% include layouts/_inside_header.html %}",
      after_header: "{% include layouts/_after_header.html %}",
      cookie_message: "{% include layouts/_cookie_message.html %}"
    }

    def handle_yield(section = :layout)
      @@yield_hash[section]
    end

    def asset_path(file, options={})
      return file if @is_stylesheet
      case File.extname(file)
      when '.css'
        "{{ site.govuk_template_assets }}/stylesheets/#{file}"
      when '.js'
        "{{ site.govuk_template_assets }}/javascripts/#{file}"
      else
        "{{ site.govuk_template_assets }}/images/#{file}"
      end
    end

    def content_for?(*args)
      @@yield_hash.include? args[0]
    end
  end
end

{'fraction_non_alphanumeric': 0.14551083591331268, 'fraction_numerical': 0.0007739938080495357, 'mean_word_length': 3.149277688603531, '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': '5887005', 'n_tokens_mistral': 837, 'n_tokens_neox': 783, 'n_words': 154}