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,7 +65,8 @@ main {
} }
} }
} }
.section.projects .inner { .section.projects {
.inner {
display: grid; display: grid;
grid-gap: 1rem; grid-gap: 1rem;
grid-template-columns: repeat(4, 1fr); grid-template-columns: repeat(4, 1fr);
@ -75,50 +75,6 @@ main {
color: $white-light; color: $white-light;
text-decoration: none; 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 {
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-gap: 1rem;
margin: 40px 0;
a {
color: $white-light;
text-decoration: none;
}
article { article {
background: $bg60; background: $bg60;
border-radius: 5px; border-radius: 5px;
@ -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">
<div class="section posts inner">
{{ range .Pages }} {{ range .Pages }}
<a href="{{ .Permalink }}"> <a href="{{ .Permalink }}">
<article> <article>
<h1>{{ .Title }}</h1> <h1><span>{{ .Title }}</span></h1>
{{ if eq .Params.type "project" }} {{ with .Description }}<p class="description">{{ . }}</p>{{ end }}
<p class="" title="last change: {{ .Date.Format "2 Jan 2006" }}">
{{ with .Params.activetime }}<span class="date">{{ . }}</span>{{ end }}
{{ with .Params.status }}<span class="status">{{ . }}</span>{{ end }}
</p>
{{ end }}
{{ if ne .Params.type "project" }}
<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>
{{ with .Params.author }}<span class="author">by {{ .Params.author }}</span>{{ end }} <span class="author">{{ with .Params.author }}by {{ end }}{{ .Params.author }}</span>
</p> </p>
{{ end }}
{{ with .Description }}
<p>{{ . }}</p>
{{ end }}
{{ with .Params.featured_image }}
<img src="{{ . | relURL }}" loading="lazy" alt="">
{{ end }}
</article> </article>
</a> </a>
{{ end }} {{ end }}
</div>
</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>