hugo-theme-zzo/layouts/index.html

65 lines
2.4 KiB
HTML
Raw Normal View History

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>
<main class="{{ if $.Param "enableSidebar" }}main-main{{ else }}main{{ end }}">
2019-11-04 13:09:44 +00:00
<article class="{{ with .Section }}section-{{ . | urlize }} {{ end }}single-view">
<div class="content">
{{ .Content }}
</div>
</article>
<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" }}
2019-11-04 13:09:44 +00:00
{{ end }}
</div> {{ partial "pagination/pagination" . }}
2019-11-04 13:09:44 +00:00
</main>
{{ if $.Param "enableSidebar" }}
<aside class="main-side">
{{ partial "sidebar/sidebar-home" . }}
</aside>
{{ end }}
2019-12-08 14:29:02 +00:00
<script>
enquire.register("screen and (max-width: 769px)", {
2019-12-08 14:29:02 +00:00
match: function () {
if (document.getElementsByTagName('main')[0]) {
document.getElementsByTagName('main')[0].className = "main";
}
if (document.getElementsByTagName('aside')[0]) {
document.getElementsByTagName('aside')[0].className = "hide";
}
},
unmatch: function () {
if (document.getElementsByTagName('main')[0]) {
document.getElementsByTagName('main')[0].className = "main-main";
}
if (document.getElementsByTagName('aside')[0]) {
document.getElementsByTagName('aside')[0].className = "main-side";
}
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>
{{ partial "script/home-script" . }}
{{ end }}