<commit_before><% if artefact && artefact.present? %>

<!-- related -->
<div class="related-positioning">
  <div class="related-container">

    <div class="related">
      <div class="inner group">
        <h2>Related topics</h2>
        <nav role="navigation">
          <ul>
            <% if artefact.related_items.size > 0 %>
              <% (artefact.related_items || []).each do |item| %>
                <% if item.artefact %>
                <li class="<%= h(item.artefact.kind) %>">
                  <a href="/<%= h(item.artefact.slug) %>"><%= h(item.artefact.name) %></a>
                </li>
                <% end %>
              <% end %>
            <% end %>

            <% if artefact.section && artefact.section != "" %>
              <% section, subsection = artefact.section.split(':', 2) %>
              <li class="related-topic"><a href="/browse/<%= h(section.parameterize) %>"
                >More from the <span><%= h(section) %></span> section</a></li>
            <% end %>
          </ul>
        </nav>
     </div>
   </div>

  </div>
</div>
<!-- end related -->
<% end %><commit_msg>Update related template to work with a plain hash<commit_after><% if artefact %>

<!-- related -->
<div class="related-positioning">
  <div class="related-container">

    <div class="related">
      <div class="inner group">
        <h2>Related topics</h2>
        <nav role="navigation">
          <ul>
            <% if artefact["related_items"].any? %>
              <% artefact["related_items"].each do |item| %>
                <% if item["artefact"] %>
                <li class="<%= h item["artefact"]["kind"] %>">
                  <a href="/<%= h item["artefact"]["slug"] %>"><%= h item["artefact"]["name"] %></a>
                </li>
                <% end %>
              <% end %>
            <% end %>

            <% if artefact["section"] and artefact["section"] != "" %>
              <% section, subsection = artefact["section"].split(':', 2) %>
              <li class="related-topic"><a href="/browse/<%= h section.parameterize %>"
                >More from the <span><%= h section %></span> section</a></li>
            <% end %>
          </ul>
        </nav>
     </div>
   </div>

  </div>
</div>
<!-- end related -->
<% end %>
{'fraction_non_alphanumeric': 0.21029476462824462, 'fraction_numerical': 0.0030796304443466782, 'mean_word_length': 1.7430639324487334, 'pattern_counts': {'":': 0, '<': 87, '<?xml version=': 0, '>': 88, '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': '911009', 'n_tokens_mistral': 737, 'n_tokens_neox': 671, 'n_words': 147}