<a href="#top" class="link-to-top-block"><%= t('back_to_top') %>
  <span class="icon icon--up-chevron-blue"></span>
</a>

<% if categories.present? %>
  <nav class="nav" role="navigation" aria-label="main">
    <ul class="link-list-primary">
      <% categories.each do |category| %>
        <li class="link-list-primary__item">
          <%= link_to category.title, category.path, class: 'link-list-primary__link' %>
        </li>
      <% end %>
    </ul>
  </nav>
<% end %>

<a href="#top" class="link-to-top-block"><%= t('back_to_top') %>
  <span class="icon icon--up-chevron-blue"></span>
</a>

<% if categories.present? %>
  <nav class="nav" role="navigation" aria-label="main" id="primary-nav">
    <ul class="link-list-primary">
      <% categories.each do |category| %>
        <li class="link-list-primary__item">
          <%= link_to category.title, category.path, class: 'link-list-primary__link' %>
        </li>
      <% end %>
    </ul>
  </nav>
<% end %>

Add JS ID to the nav
Add JS ID to the nav
