2019-11-07 18:09:15 +00:00
|
|
|
{{ define "title" }}{{ .Site.Title }}{{ end }}
|
|
|
|
|
2019-11-04 13:09:44 +00:00
|
|
|
{{ define "main" }}
|
2019-12-08 14:29:02 +00:00
|
|
|
|
|
|
|
{{ $enquire := resources.Get "js/enquire.min.js" | resources.Fingerprint }}
|
|
|
|
<script src="{{ $enquire.RelPermalink }}"></script>
|
|
|
|
|
2020-01-20 16:20:43 +00:00
|
|
|
<main class="main inner">
|
|
|
|
<div class="list__main {{ if $.Param "enableSidebar" }}{{ if eq .Site.Params.sidebarPosition "left" }}mr{{ else }}lm{{ end }}{{ else }}lmr{{ end }}">
|
|
|
|
<div class="summary__container">
|
|
|
|
{{ $filteredPages := .Site.RegularPages }}
|
|
|
|
{{ range .Site.Params.notAllowedTypesInHome }}
|
|
|
|
{{ $filteredPages = (where $filteredPages "Type" "!=" (lower .)) }}
|
|
|
|
{{ end }}
|
|
|
|
{{ $paginator := .Paginate $filteredPages }}
|
|
|
|
{{ range $paginator.Pages }}
|
|
|
|
{{ .Render "summary" }}
|
|
|
|
{{ end }}
|
2019-11-04 13:09:44 +00:00
|
|
|
</div>
|
|
|
|
|
2020-01-20 16:20:43 +00:00
|
|
|
{{ partial "pagination/pagination" . }}
|
|
|
|
</div>
|
2019-11-12 10:03:15 +00:00
|
|
|
|
2020-01-20 16:20:43 +00:00
|
|
|
{{ if $.Param "enableSidebar" }}
|
|
|
|
<aside class="list__sidebar {{ if eq .Site.Params.sidebarPosition "left" }}l{{ else }}r{{ end }}">
|
|
|
|
{{ partial "sidebar/sidebar-home" . }}
|
|
|
|
</aside>
|
|
|
|
{{ end }}
|
|
|
|
</main>
|
2019-12-08 14:29:02 +00:00
|
|
|
<script>
|
2020-01-20 16:20:43 +00:00
|
|
|
{{ $sidebarPosition:= .Site.Params.sidebarPosition }}
|
|
|
|
var sidebarPosition = JSON.parse({{ $sidebarPosition | jsonify }});
|
2020-01-23 13:00:38 +00:00
|
|
|
{{ $enableSidebar:= .Site.Params.enableSidebar }}
|
|
|
|
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-01-06 16:41:38 +00:00
|
|
|
if (document.getElementsByClassName('navbar__burger')[0]) {
|
|
|
|
document.getElementsByClassName('navbar__burger')[0].classList.remove('is-active');
|
|
|
|
}
|
|
|
|
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 }}
|