{{ define "main" }}
{{ $wideViewAsDefault := ($.Param "wideViewAsDefault") }}
<div class="mid">
  <div class="divider">
    
    <nav id="single-menu" class="{{ if $wideViewAsDefault }}hide{{ else }}l{{ end }}" data-dir="{{ $.Param "languagedir" | default "ltr" }}">
    </nav>

    <article id="list-main" class="{{ if $wideViewAsDefault }}lm{{ else }}m{{ end }}" data-dir="{{ $.Param "languagedir" | default "ltr" }}">
      {{ if $.Param "enableBlogBreadcrumb" }}
        {{ partial "main/component/breadcrumb.html" . }}
      {{ end }}
      {{ partial "main/sections/list-main.html" . }}
      {{ partial "main/component/pagination-single.html" . }}
    </article>
    
    <section id="list-side" class="r" data-dir="{{ $.Param "languagedir" | default "ltr" }}">
      {{ if $.Param "enableToc" }}
        {{ partial "main/component/toc.html" . }}
      {{ end }}
    </section>

  </div>
</div>

{{ partial "script/codeblock-script.html" . }}
{{ partial "script/single-script.html" . }}

<script>
  var singleMenu = document.getElementById('single-menu');
  var listMain = document.getElementById('list-main');
  var listSide = document.getElementById('list-side');
  var wideViewAsDefault = JSON.parse({{ $wideViewAsDefault | jsonify }});

  enquire.register("screen and (max-width:1280px)", {
    match: function () {
      if (wideViewAsDefault) {
        singleMenu.className = 'hide';
        listMain.className = 'lm';
        listSide.className = 'r';
      } else {
        singleMenu.className = 'l';
        listMain.className = 'm';
        listSide.className = 'r';
      }
    },
    unmatch: function () {
      if (wideViewAsDefault) {
        singleMenu.className = 'hide';
        listMain.className = 'lm';
        listSide.className = 'r';
      } else {
        singleMenu.className = 'l';
        listMain.className = 'm';
        listSide.className = 'r';
      }
    },
  }).register("screen and (max-width:960px)", {
    match: function () {
      listSide.className = 'r';
      listMain.className = 'lm';
      singleMenu.className = 'hide';
    },
    unmatch: function () {
      if (wideViewAsDefault) {
        singleMenu.className = 'hide';
        listMain.className = 'lm';
        listSide.className = 'r';
      } else {
        singleMenu.className = 'l';
        listMain.className = 'm';
        listSide.className = 'r';
      }
    },
  }).register("screen and (max-width:600px)", {
    match: function () {
      listSide.className = 'hide';
      listMain.className = 'lmr';
      singleMenu.className = 'hide';
    },
    unmatch: function () {
      listSide.className = 'r';
      listMain.className = 'lm';
      singleMenu.className = 'hide';
    },
  });
</script>
{{ end }}