<% if category_navigation.present? %>
  <ul class="primary-nav" id="primary-nav">

    <% category_navigation.each do |category| %>
      <li class="primary-nav__item">
        <% if category.id == 'news' %>
          <a href="/<%= I18n.locale %>/news"><%= category.title %></a>
        <% else %>
          <a href="/<%= I18n.locale %>/categories/<%= category.id %>"><%= category.title %></a>
        <% end %>

        <% if category.contents.present? %>
          <div class="l-primary-nav-dropdown primary-nav__dropdown">
            <ul class="menu">
              <% category.contents.each do |sub_category| %>
                <li><a href="/<%= I18n.locale %>/categories/<%= sub_category.id %>"><%= sub_category.title %></a></li>
              <% end %>
            </ul>
          </div>
        <% end %>

      </li>
    <% end %>

  </ul>
<% end %>

<% if category_navigation.present? %>
  <ul class="primary-nav" id="primary-nav">

    <% category_navigation.each do |category| %>
      <li class="primary-nav__item">
        <% if category.id == 'news' %>
          <a href="/<%= I18n.locale %>/news"><%= category.title %></a>
        <% else %>
          <a href="/<%= I18n.locale %>/categories/<%= category.id %>"><%= category.title %></a>
        <% end %>

        <% if category.contents.present? %>
          <div class="primary-nav__dropdown l-primary-nav-dropdown">
            <ul class="menu">
              <% category.contents.each do |sub_category| %>
                <li><a href="/<%= I18n.locale %>/categories/<%= sub_category.id %>"><%= sub_category.title %></a></li>
              <% end %>
            </ul>
          </div>
        <% end %>

      </li>
    <% end %>

  </ul>
<% end %>

Reorder the class names for the primary nav
Reorder the class names for the primary nav
