<commit_before><% get_all = false if local_assigns[:get_all].nil? %>
<% get_news_items get_all %>

<div class="cards--articles">

  <% unless get_all %>
    <div class="flex flex-v-center flex-h-between">
      <h2><%= @items[:title] %></h2>
      <%= link_to t('global.button.all'), @items[:url], target: '_blank', title: t('global.button.all'), class: 'button--all' %>
    </div>
  <% end %>

  <div class="cards__cards">
    <% @items[:cards].each do |card| %>
      <%= link_to root_path + card[:full_path], title: card[:label], class: 'card bg--grey-light' do %>
        
        <% if cms_fragment_content(:image, card).present? %>
          <div class="card__image" style="background-image: url(<%= cms_fragment_render(:image, card) %>);"></div>
        <% else %>
          <div class="card__image">
            <i class="card__icon icon--image"></i>
          </div>
        <% end %>

        <div class="card__content">
          <p class="card__date"><%= card[:created_at].strftime('%d %B %y') %></p><!-- TODO swap this out for new date field -->
          <h3 class="card__h3"><%= card[:label] %></h3>
          <p class="card__summary"><%= cms_fragment_content(:summary, card) %></p>
        </div>
      <% end %>
    <% end %>
  </div>
</div><commit_msg>Add date field to the news cards<commit_after><% get_all = false if local_assigns[:get_all].nil? %>
<% get_news_items get_all %>

<div class="cards--articles">

  <% unless get_all %>
    <div class="flex flex-v-center flex-h-between">
      <h2><%= @items[:title] %></h2>
      <%= link_to t('global.button.all'), @items[:url], target: '_blank', title: t('global.button.all'), class: 'button--all' %>
    </div>
  <% end %>

  <div class="cards__cards">
    <% @items[:cards].each do |card| %>
      <%= link_to root_path + card[:full_path], title: card[:label], class: 'card bg--grey-light' do %>
        
        <% if cms_fragment_content(:image, card).present? %>
          <div class="card__image" style="background-image: url(<%= cms_fragment_render(:image, card) %>);"></div>
        <% else %>
          <div class="card__image">
            <i class="card__icon icon--image"></i>
          </div>
        <% end %>

        <div class="card__content">
          <% if cms_fragment_content(:published_date, card).present? %>
            <p class="card__date"><%= cms_fragment_content(:published_date, card).strftime('%d %B %y') %></p>
          <% end %>
          <h3 class="card__h3"><%= card[:label].truncate(59, separator: ' '); %></h3>
          <p class="card__summary"><%= cms_fragment_content(:summary, card).truncate(167, separator: ' '); %></p>
        </div>
      <% end %>
    <% end %>
  </div>
</div>
{'fraction_non_alphanumeric': 0.21380846325167038, 'fraction_numerical': 0.005567928730512249, 'mean_word_length': 2.9285714285714284, 'pattern_counts': {'":': 0, '<': 84, '<?xml version=': 0, '>': 84, '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': '7238511', 'n_tokens_mistral': 965, 'n_tokens_neox': 889, 'n_words': 186}