{% extends ['serviceworker.js.twig', '_default/serviceworker.js.twig'] %}

{%- block precache ~%}
// cache cover image
precache.push('{{ asset(site.podcast.image)|url }}');
precache.push('{{ asset(site.podcast.image)|resize(225)|url }}');
// cache last 2 episodes
  {%- for page in site.pages|filter_by('section', 'episodes')|sort_by_date|slice(0,2) ~%}
precache.push('{{ asset(page.episode.file)|url }}');
    {%- if page.episode.image|default('') ~%}
precache.push('{{ asset(page.episode.image)|url }}');
    {%- endif ~%}
  {%- endfor ~%}
{%- endblock ~%}