% const _base = (typeof siteUrlBase !== 'undefined' && siteUrlBase) ? siteUrlBase : ''; %>
<% const _tracks = (typeof tracks !== 'undefined' && tracks) ? tracks : []; %>
<% const _events = (typeof events !== 'undefined' && events) ? events : []; %>
<% const _pages = (typeof pages !== 'undefined' && pages) ? pages : []; %>
<%= 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) { %>
-
<%= r.author_username %>
<% if (r.published_at) { %> · <%= formatDate(r.published_at) %><% } %>
<%- r.snippet %>
<% }); %>
<% } %>
<% if (_events.length) { %>
<%= t('search.section_events') %>
<% _events.forEach(function(ev) { %>
-
<%= [ev.date, ev.time].filter(Boolean).join(' ') %>
<% }); %>
<% } %>
<% if (_pages.length) { %>
<%= t('search.section_pages') %>
<% _pages.forEach(function(pg) { %>
- <%= pg.label %> →
<% }); %>
<% } %>
<% if (query && !queryError && !results.length && !_tracks.length && !_events.length && !_pages.length) { %>
<%= t('search.empty') %>
<% } %>