Create two column layout for wide screen browsers

master
Kevin C. Coram 2019-12-11 22:36:32 -05:00
parent ba844bf59a
commit d85b711791
Signed by: kevin
GPG Key ID: 0342351B3D61AD35
2 changed files with 47 additions and 18 deletions

View File

@ -30,13 +30,10 @@
</nav> </nav>
</header> </header>
<main {{ if eq .Kind "page" }}class="h-entry"{{ else if in (slice "section" "taxonomy" "taxonomyTerm" ) .Kind }}class="h-feed"{{ end }}> <main {{ if eq .Kind "page" }}class="h-entry"{{ else if in (slice "section" "taxonomy" "taxonomyTerm" ) .Kind }}class="h-feed"{{ end }}>
<div class="content-box">
<header> <header>
{{- block "content-header" . -}} {{- block "content-header" . -}}
{{- end -}} {{- end -}}
<nav>
{{- block "content-menu" . -}}
{{- end -}}
</nav>
</header> </header>
<section> <section>
{{- block "content" . -}} {{- block "content" . -}}
@ -47,11 +44,18 @@
{{- block "content-footer" . -}} {{- block "content-footer" . -}}
{{- end -}} {{- end -}}
</footer> </footer>
</div>
<div class="asides-box">
<aside> <aside>
{{ block "author-card" . }} {{ block "author-card" . }}
{{ partial "author-card.html" . }} {{ partial "author-card.html" . }}
{{ end }} {{ end }}
</aside> </aside>
<nav>
{{- block "content-menu" . -}}
{{- end -}}
</nav>
</div>
</main> </main>
<footer> <footer>
{{- block "footer" . -}} {{- block "footer" . -}}

View File

@ -1,5 +1,6 @@
.box { .box {
display: flex; display: flex;
flex-direction: row;
align-items: center; align-items: center;
flex-wrap: wrap; flex-wrap: wrap;
} }
@ -28,3 +29,27 @@ nav.paginator ul {
padding-inline-start: 1em; padding-inline-start: 1em;
padding-inline-end: 1em; padding-inline-end: 1em;
} }
/* Define grid layout for wide screen browsers */
div.content-box {
grid-area: content;
}
div.asides-box {
grid-area: aside;
}
@media (min-width: 1024px) {
div.asides-box {
max-width: 350px;
border-left: thin solid;
margin: 1em;
}
main {
display: grid;
grid-template-columns: 1fr 350px;
grid-template-areas:
"content aside";
}
}