<% const _base = (typeof siteUrlBase !== 'undefined' && siteUrlBase) ? siteUrlBase : ''; %> <% const _tracks = (typeof tracks !== 'undefined' && tracks) ? tracks : []; %>

<%= t('nav.search') %>

<% if (queryError) { %>

<%= t('search.error') %>

<% } %> <% if (query && !queryError) { %>

<%= t(total === 1 ? 'search.results_one' : 'search.results_other', { n: total, q: query }) %>

<% } %> <% if (_tracks.length) { %>

<%= t('search.section_tracks') %>

<% var _inPost = t('search.in_post'); /* t() vóór de loop ophalen: function(t) overschaduwt 'm */ %>
<% _tracks.forEach(function(t) { const tj = JSON.stringify({ id: t.id, url: t.url, title: t.title, artist: t.artist || '', cover: t.cover || '' }) .replace(/&/g, '&').replace(/'/g, ''').replace(/
<% if (t.cover) { %> <% } %>
<%= t.title %>
<% if (t.artist || t.album) { %>
<%= t.artist %><% if (t.artist && t.album) { %> · <% } %><%= t.album %>
<% } %>
<% if (t.postUrl) { %> <%= _inPost %> <% } %>
<% }); %>
<% } %> <% if (results && results.length) { %> <% if (_tracks.length) { %>

<%= t('search.section_posts') %>

<% } %>
    <% results.forEach(function(r) { %>
  1. <%= r.title || '(zonder titel)' %>

    <%= r.author_username %> <% if (r.published_at) { %> · <%= formatDate(r.published_at) %><% } %>

    <%- r.snippet %>

  2. <% }); %>
<% } %> <% if (query && !queryError && !results.length && !_tracks.length) { %>

<%= t('search.empty') %>

<% } %>