This commit is contained in:
Vrifox 2020-11-12 09:57:45 +01:00
parent cc98aeaa05
commit a9852b3403
6 changed files with 86 additions and 153 deletions

View file

@ -5,63 +5,5 @@
@import '../import/include.scss'; @import '../import/include.scss';
main { main {
margin: 60px 0 0 0; @include posts;
}
.section-articles {
display: grid;
grid-gap: 1rem;
grid-template-columns: repeat(2, 1fr);
margin: 20px 0;
a {
color: $white-light;
text-decoration: none;
}
article {
background: $bg60;
border: 1px solid $bg60;
border-radius: 5px;
color: $white-light;
display: flex;
flex-flow: column;
height: max-content;
padding: 20px;
transition: background .2s;
&:hover {
background: $bg70;
}
img {
background: $bg80;
border-radius: 5px 5px 0px 0px;
margin: -20px -20px 15px -20px;
max-height: 250px;
max-width: calc(100% + 40px);
object-fit: cover;
order: -1;
}
h1 {
font-size: 18px;
font-weight: 400;
margin: 0 0 10px 0;
}
a {
color: $white-light;
&:hover {
text-decoration: underline;
}
}
.meta {
font-size: 14px;
margin: 0;
}
.author {
color: $white-dark;
font-style: italic;
}
}
}
@media (max-width: 600px) {
.section-articles {
grid-template-columns: repeat(1, 1fr);
}
} }

View file

@ -11,3 +11,62 @@
} }
} }
} }
@mixin posts {
.section.posts {
.inner {
display: grid;
grid-gap: 1rem;
grid-template-columns: repeat(2, 1fr);
margin: 40px 0;
a {
color: $white-light;
text-decoration: none;
}
article {
background: $bg60;
border-radius: 5px;
color: $white;
display: flex;
flex-flow: column;
height: 100%;
padding: 20px 40px;
transition: background .2s;
&:hover {
background: $bg50;
}
h1 {
color: $white;
display: flex;
font-size: 18px;
font-weight: 400;
margin: 0 0 10px 0;
min-height: 65px;
text-align: center;
span {
margin: auto;
}
}
p.description {
color: $white-dark;
flex: 1;
font-size: 16px;
margin: 20px 0;
}
p.meta {
color: $white-dark;
font-size: 14px;
margin: 0;
text-align: center;
}
}
}
}
@media (max-width: 900px) {
main {
.section.articles.inner {
grid-template-columns: repeat(1, 1fr);
}
}
}
}

View file

@ -54,4 +54,5 @@ hr {
main { main {
width: 100vw; width: 100vw;
margin: 60px 0 0 0;
} }

View file

@ -49,7 +49,6 @@
} }
main { main {
margin: 60px 0 0 0;
.latest { .latest {
color: $white-dark; color: $white-dark;
display: block; display: block;
@ -66,54 +65,11 @@ main {
} }
} }
} }
.section.projects .inner { .section.projects {
display: grid;
grid-gap: 1rem;
grid-template-columns: repeat(4, 1fr);
margin: 40px 0;
a {
color: $white-light;
text-decoration: none;
}
article {
background: $bg60;
border-radius: 5px;
color: $white;
display: flex;
flex-flow: column;
height: max-content;
padding: 20px;
transition: background .2s;
&:hover {
background: $bg70;
}
h1 {
color: $white;
font-size: 18px;
font-weight: 400;
margin: 0;
text-align: center;
}
p.meta {
color: $white-dark;
font-size: 15px;
margin: 0;
text-align: center;
span.status {
/*&::before {
content: '·';
margin-right: 9px;
}*/
}
}
}
}
.section.articles {
margin: 0 auto;
.inner { .inner {
display: grid; display: grid;
grid-template-columns: repeat(2, 1fr);
grid-gap: 1rem; grid-gap: 1rem;
grid-template-columns: repeat(4, 1fr);
margin: 40px 0; margin: 40px 0;
a { a {
color: $white-light; color: $white-light;
@ -126,39 +82,28 @@ main {
display: flex; display: flex;
flex-flow: column; flex-flow: column;
height: 100%; height: 100%;
padding: 20px; padding: 20px 40px;
transition: background .2s; transition: background .2s;
&:hover { &:hover {
background: $bg70; background: $bg50;
p.description {
max-height: none;
}
} }
h1 { h1 {
color: $white;
font-size: 18px; font-size: 18px;
font-weight: 400; font-weight: 400;
margin: 0 0 10px 0; margin: 0;
min-height: 65px;
text-align: center; text-align: center;
color: $white;
}
p.description {
color: $white-dark;
margin: 20px 0;
flex: 1;
} }
p.meta { p.meta {
color: $white-dark; color: $white-dark;
font-size: 14px; font-size: 14px;
margin: 0; margin: 0;
text-align: center; text-align: center;
span.author {
font-style: italic;
}
} }
} }
} }
} }
@include posts;
} }
@ -167,9 +112,6 @@ main {
.section.projects.inner { .section.projects.inner {
grid-template-columns: repeat(2, 1fr); grid-template-columns: repeat(2, 1fr);
} }
.section.articles.inner {
grid-template-columns: repeat(1, 1fr);
}
} }
} }
@media (max-width: 600px) { @media (max-width: 600px) {

View file

@ -5,32 +5,21 @@
{{ define "main" }} {{ define "main" }}
<main> <main>
<div class="container"> <div class="container">
<section class="section-articles"> <section class="section posts">
{{ range .Pages }} <div class="section posts inner">
<a href="{{ .Permalink }}"> {{ range .Pages }}
<article> <a href="{{ .Permalink }}">
<h1>{{ .Title }}</h1> <article>
{{ if eq .Params.type "project" }} <h1><span>{{ .Title }}</span></h1>
<p class="" title="last change: {{ .Date.Format "2 Jan 2006" }}"> {{ with .Description }}<p class="description">{{ . }}</p>{{ end }}
{{ with .Params.activetime }}<span class="date">{{ . }}</span>{{ end }} <p class="meta" title="{{ .Date.Format "2 Jan 2006, 15:04 MST" }}">
{{ with .Params.status }}<span class="status">{{ . }}</span>{{ end }} <span class="date">{{ .Date.Format "2 January 2006" }}</span>
</p> <span class="author">{{ with .Params.author }}by {{ end }}{{ .Params.author }}</span>
{{ end }} </p>
{{ if ne .Params.type "project" }} </article>
<p class="meta" title="{{ .Date.Format "2 Jan 2006, 15:04 MST" }}"> </a>
<span class="date">{{ .Date.Format "2 January 2006" }}</span> {{ end }}
{{ with .Params.author }}<span class="author">by {{ .Params.author }}</span>{{ end }} </div>
</p>
{{ end }}
{{ with .Description }}
<p>{{ . }}</p>
{{ end }}
{{ with .Params.featured_image }}
<img src="{{ . | relURL }}" loading="lazy" alt="">
{{ end }}
</article>
</a>
{{ end }}
</section> </section>
</div> </div>
</main> </main>

View file

@ -44,15 +44,15 @@
</div> </div>
</section> </section>
<hr> <hr>
<section class="section articles"> <section class="section posts">
<span class="latest"> <span class="latest">
latest <a href="{{ "/blog" | relURL }}">posts</a> latest <a href="{{ "/blog" | relURL }}">posts</a>
</span> </span>
<div class="section articles inner"> <div class="section posts inner">
{{ range first 4 (where .Site.RegularPages "Type" "post") }} {{ range first 4 (where .Site.RegularPages "Type" "post") }}
<a href="{{ .Permalink }}"> <a href="{{ .Permalink }}">
<article> <article>
<h1>{{ .Title }}</h1> <h1><span>{{ .Title }}</span></h1>
{{ with .Description }}<p class="description">{{ . }}</p>{{ end }} {{ with .Description }}<p class="description">{{ . }}</p>{{ end }}
<p class="meta" title="{{ .Date.Format "2 Jan 2006, 15:04 MST" }}"> <p class="meta" title="{{ .Date.Format "2 Jan 2006, 15:04 MST" }}">
<span class="date">{{ .Date.Format "2 January 2006" }}</span> <span class="date">{{ .Date.Format "2 January 2006" }}</span>