{{ define "main" }}
<div class="top">
  <header class="main blog__bg">
    <div class="sv" data-view="full">
      {{ partial "header/blog-header.html" . }}
    </div>
  </header>
</div>
<div class="mid blog__bg">
  <main class="main blog__bg">
    <div class="sv" data-view="full">
      <div class="blog">
        {{ $paginator := .Paginate (where .RegularPages "Type" .Type) }}
        {{ range $paginator.Pages }}
          {{ .Render "summary" }}
        {{ end }}
        {{ partial "main/component/pagination.html" . }}
      </div>
    </div>
  </main>
</div>

<script>
  var singleViewElem = document.querySelectorAll('.sv');

  enquire.register("screen and (max-width:1280px)", {
    match: function () {
      singleViewElem.forEach(function(elem) {
        elem.setAttribute('data-view', 'full');
      });
    },
    unmatch: function () {
      singleViewElem.forEach(function (elem) {
        elem.setAttribute('data-view', 'full');
      });
    },
  }).register("screen and (max-width:769px)", {
    match: function () {
      singleViewElem.forEach(function (elem) {
        elem.setAttribute('data-view', 'mobile');
      });
    },
    unmatch: function () {
      singleViewElem.forEach(function (elem) {
        elem.setAttribute('data-view', 'full');
      });
    },
  });
</script>
{{ end }}