2019-11-07 18:09:15 +00:00
|
|
|
{{ define "title" }}{{ .Site.Title }}{{ end }}
|
|
|
|
|
2019-11-04 13:09:44 +00:00
|
|
|
{{ define "main" }}
|
2020-01-23 17:46:03 +00:00
|
|
|
<main class="main inner" data-sidebar-position="{{ $.Param "sidebarPosition" }}">
|
2020-01-31 06:06:30 +00:00
|
|
|
<div class="list__main {{ if $.Param "enableSidebar" }}{{ if eq ($.Param "sidebarPosition") "left" }}mr{{ else }}lm{{ end }}{{ else }}lmr{{ end }}">
|
2020-02-07 02:08:14 +00:00
|
|
|
<div class="summary__container" data-display="block">
|
2020-01-20 16:20:43 +00:00
|
|
|
{{ $filteredPages := .Site.RegularPages }}
|
2020-01-31 06:06:30 +00:00
|
|
|
{{ range $.Param "notAllowedTypesInHome" }}
|
2020-01-20 16:20:43 +00:00
|
|
|
{{ $filteredPages = (where $filteredPages "Type" "!=" (lower .)) }}
|
|
|
|
{{ end }}
|
|
|
|
{{ $paginator := .Paginate $filteredPages }}
|
|
|
|
{{ range $paginator.Pages }}
|
|
|
|
{{ .Render "summary" }}
|
|
|
|
{{ end }}
|
2020-02-07 02:08:14 +00:00
|
|
|
{{ partial "pagination/pagination" . }}
|
2019-11-04 13:09:44 +00:00
|
|
|
</div>
|
2020-02-07 02:08:14 +00:00
|
|
|
{{ partial "search/search-result-desktop" . }}
|
2020-01-20 16:20:43 +00:00
|
|
|
</div>
|
2019-11-12 10:03:15 +00:00
|
|
|
|
2020-01-20 16:20:43 +00:00
|
|
|
{{ if $.Param "enableSidebar" }}
|
2020-01-31 06:06:30 +00:00
|
|
|
<aside class="list__sidebar {{ if eq ($.Param "sidebarPosition") "left" }}l{{ else }}r{{ end }}" data-dir="{{ $.Param "languagedir" | default "ltr" }}">
|
2020-01-20 16:20:43 +00:00
|
|
|
{{ partial "sidebar/sidebar-home" . }}
|
|
|
|
</aside>
|
|
|
|
{{ end }}
|
|
|
|
</main>
|
2019-12-08 14:29:02 +00:00
|
|
|
<script>
|
2020-01-31 06:06:30 +00:00
|
|
|
{{ $sidebarPosition:= $.Param "sidebarPosition" }}
|
2020-01-20 16:20:43 +00:00
|
|
|
var sidebarPosition = JSON.parse({{ $sidebarPosition | jsonify }});
|
2020-01-31 06:06:30 +00:00
|
|
|
{{ $enableSidebar:= $.Param "enableSidebar" }}
|
2020-01-23 13:00:38 +00:00
|
|
|
var enableSidebar = JSON.parse({{ $enableSidebar | jsonify }});
|
|
|
|
|
2020-01-20 16:20:43 +00:00
|
|
|
var listMainElem = document.querySelector('.list__main');
|
|
|
|
var listSideElem = document.querySelector('.list__sidebar');
|
|
|
|
|
|
|
|
var gridSmall = 'l';
|
|
|
|
var gridBig = 'mr';
|
|
|
|
var gridFull = 'lmr'
|
|
|
|
|
|
|
|
if (sidebarPosition === "right") {
|
|
|
|
gridSmall = 'r';
|
|
|
|
gridBig = 'lm'
|
|
|
|
}
|
|
|
|
|
|
|
|
enquire.register("screen and (max-width: 769px)", {
|
2019-12-08 14:29:02 +00:00
|
|
|
match: function () {
|
2020-01-23 13:00:38 +00:00
|
|
|
if (enableSidebar) {
|
|
|
|
listMainElem.classList.remove(gridBig);
|
|
|
|
listMainElem.classList.add(gridFull);
|
|
|
|
listSideElem.classList.remove(gridSmall);
|
|
|
|
listSideElem.classList.add('hide');
|
|
|
|
} else {
|
|
|
|
if (listMainElem && !listMainElem.classList.contains(gridFull)) {
|
|
|
|
listMainElem.classList.remove(gridBig);
|
|
|
|
listMainElem.classList.add(gridFull);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (listSideElem && !listSideElem.classList.contains('hide')) {
|
|
|
|
listSideElem.classList.add('hide');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-12-08 14:29:02 +00:00
|
|
|
},
|
|
|
|
unmatch: function () {
|
2020-01-23 13:00:38 +00:00
|
|
|
if (enableSidebar) {
|
|
|
|
listMainElem.classList.remove(gridFull);
|
|
|
|
listMainElem.classList.add(gridBig);
|
|
|
|
listSideElem.classList.add(gridSmall);
|
|
|
|
listSideElem.classList.remove('hide');
|
|
|
|
} else {
|
|
|
|
if (listMainElem && !listMainElem.classList.contains(gridFull)) {
|
|
|
|
listMainElem.classList.remove(gridBig);
|
|
|
|
listMainElem.classList.add(gridFull);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (listSideElem && !listSideElem.classList.contains('hide')) {
|
|
|
|
listSideElem.classList.add('hide');
|
|
|
|
}
|
|
|
|
}
|
2020-01-20 16:20:43 +00:00
|
|
|
|
2020-02-20 14:08:34 +00:00
|
|
|
var navCollapseBtn = document.querySelector('.navbar__burger');
|
2020-02-20 10:08:38 +00:00
|
|
|
var navCollapse = document.getElementsByClassName('navbarm__collapse')[0];
|
|
|
|
if (navCollapse) {
|
|
|
|
navCollapse.setAttribute('data-open', false);
|
|
|
|
navCollapse.style.maxHeight = 0;
|
2020-02-20 14:08:34 +00:00
|
|
|
navCollapseBtn.classList.remove('is-active');
|
2020-01-06 16:41:38 +00:00
|
|
|
}
|
|
|
|
if (document.getElementsByClassName('navbar__menu')[0]) {
|
|
|
|
document.getElementsByClassName('navbar__menu')[0].classList.remove('is-active');
|
|
|
|
}
|
|
|
|
if (document.getElementsByClassName('mobile-search')[0]) {
|
|
|
|
document.getElementsByClassName('mobile-search')[0].classList.add('hide');
|
|
|
|
}
|
2019-12-08 14:29:02 +00:00
|
|
|
},
|
|
|
|
setup: function () { },
|
|
|
|
deferSetup: true,
|
|
|
|
destroy: function () { },
|
|
|
|
});
|
|
|
|
</script>
|
2019-11-24 14:31:28 +00:00
|
|
|
{{ partial "script/home-script" . }}
|
|
|
|
{{ end }}
|