next/previous article/project section rewritten

This commit is contained in:
Vrifox 2020-09-22 14:10:53 +02:00
parent 8f44f2d329
commit fb24b7e480
7 changed files with 46 additions and 97 deletions

View file

@ -54,58 +54,38 @@
} }
.section-articles { .section-articles {
margin: 20px auto; margin: 20px auto -50px auto;
display: grid; display: grid;
grid-template-columns: repeat(2, 1fr); grid-template-columns: repeat(2, 1fr);
grid-gap: 1rem; grid-gap: 1rem;
max-width: 720px; max-width: 720px;
a {
color: rgb(255, 255, 255);
text-decoration: none;
}
article { article {
background: rgb(60, 60, 90);
color: rgb(255, 255, 255); color: rgb(255, 255, 255);
padding: 20px; margin: 20px 0;
border-radius: 5px; border-radius: 5px;
display: flex; display: flex;
flex-flow: column; flex-flow: column;
height: max-content; height: max-content;
transition: background .2s; transition: background .2s;
img {
order: -1;
max-width: calc(100% + 40px);
border-radius: 5px;
margin: -20px -20px 20px -20px;
background: rgb(80, 80, 120);
object-fit: cover;
max-height: 170px;
}
h1 {
margin-top: 0px;
}
a { a {
color: rgb(255, 255, 255); margin: 10px 0;
} }
a:hover { a:hover {
text-decoration: underline; text-decoration: underline;
} }
.meta {
margin: 0;
} }
.author { .previous-article {
font-style: italic; text-align: right;
color: rgb(200, 200, 230);
}
}
article:hover {
background: rgb(70, 70, 105);
} }
} }
@media (max-width: 600px) { .section-articles::after {
.section-articles { content: '';
grid-template-columns: repeat(1, 1fr); position: absolute;
} width: 100vw;
background: rgb(50, 50, 75);
height: 230px;
left: 0;
z-index: -10;
} }
@import '../partials/footer'; @import '../partials/footer';

View file

@ -8,6 +8,8 @@
html { html {
scrollbar-width: thin; scrollbar-width: thin;
scrollbar-color: rgb(255, 130, 130) rgb(60, 60, 90); scrollbar-color: rgb(255, 130, 130) rgb(60, 60, 90);
overflow-x: hidden;
overflow-y: scroll;
} }
body { body {
background: rgb(40, 40, 60); background: rgb(40, 40, 60);
@ -15,7 +17,6 @@ body {
margin: 0; margin: 0;
font-family: PoppinsLatin, Monaco, Lucida Console, monospace; font-family: PoppinsLatin, Monaco, Lucida Console, monospace;
display: grid; display: grid;
overflow-x: hidden;
} }
a { a {
color: rgb(255, 130, 130); color: rgb(255, 130, 130);

View file

@ -3,7 +3,7 @@ languageCode: en-us
title: vrifox.cc title: vrifox.cc
enableRobotsTXT: true enableRobotsTXT: true
params: params:
version: 2020-09-21 version: 2020-09-22
menu: menu:
main: main:
- identifier: blog - identifier: blog

View file

@ -36,34 +36,14 @@
</article> </article>
</section> </section>
<section class="section-articles"> <section class="section-articles">
{{ with .PrevInSection }} <article class="next-article">
<a href="{{ .Permalink }}"> {{ with .NextInSection }}<span>{{ if eq .Params.type "project" }}next project{{ end }}{{ if ne .Params.type "project" }}next article{{ end }}</span>
<article> <a href="{{ .Permalink }}">{{ .Title }}</a>{{ end }}
<h1>{{ .Title }}</h1>
<p class="meta" title="{{ .Date.Format "2 Jan 2006, 15:04 MST" }}"><span class="date">{{ .Date.Format "2 January 2006" }}</span> <span class="author">{{ with .Params.author }}by{{ end}} {{ .Params.author }}</span></p>
{{ with .Description }}
<p>{{ . }}</p>
{{ end }}
{{ with .Params.featured_image }}
<img src="{{ . | relURL }}">
{{ end }}
</article> </article>
</a> <article class="previous-article">
{{ end }} {{ with .PrevInSection }}<span>{{ if eq .Params.type "project" }}previous project{{ end }}{{ if ne .Params.type "project" }}previous article{{ end }}</span>
{{ with .NextInSection }} <a href="{{ .Permalink }}">{{ .Title }}</a>{{ end }}
<a href="{{ .Permalink }}">
<article>
<h1>{{ .Title }}</h1>
<p class="meta" title="{{ .Date.Format "2 Jan 2006, 15:04 MST" }}"><span class="date">{{ .Date.Format "2 January 2006" }}</span> <span class="author">{{ with .Params.author }}by{{ end }} {{ .Params.author }}</span></p>
{{ with .Description }}
<p>{{ . }}</p>
{{ end }}
{{ with .Params.featured_image }}
<img src="{{ . | relURL }}">
{{ end }}
</article> </article>
</a>
{{ end }}
</section> </section>
</div> </div>
</main> </main>

View file

@ -13,7 +13,7 @@
</section> </section>
<h1>latest <a href="{{ "/blog" | relURL }}">posts</a></h1> <h1>latest <a href="{{ "/blog" | relURL }}">posts</a></h1>
<section class="section-articles"> <section class="section-articles">
{{ range first 3 (where .Site.RegularPages "Type" "post") }} {{ range first 2 (where .Site.RegularPages "Type" "post") }}
<a href="{{ .Permalink }}"> <a href="{{ .Permalink }}">
<article> <article>
<h1>{{ .Title }}</h1> <h1>{{ .Title }}</h1>

View file

@ -7,15 +7,16 @@
html { html {
scrollbar-width: thin; scrollbar-width: thin;
scrollbar-color: #ff8282 #3c3c5a; } scrollbar-color: #ff8282 #3c3c5a;
overflow-x: hidden;
overflow-y: scroll; }
body { body {
background: #28283c; background: #28283c;
color: #f0f0ff; color: #f0f0ff;
margin: 0; margin: 0;
font-family: PoppinsLatin, Monaco, Lucida Console, monospace; font-family: PoppinsLatin, Monaco, Lucida Console, monospace;
display: grid; display: grid; }
overflow-x: hidden; }
a { a {
color: #ff8282; color: #ff8282;
@ -104,48 +105,34 @@ nav {
background: #464669; } background: #464669; }
.section-articles { .section-articles {
margin: 20px auto; margin: 20px auto -50px auto;
display: grid; display: grid;
grid-template-columns: repeat(2, 1fr); grid-template-columns: repeat(2, 1fr);
grid-gap: 1rem; grid-gap: 1rem;
max-width: 720px; } max-width: 720px; }
.section-articles a {
color: white;
text-decoration: none; }
.section-articles article { .section-articles article {
background: #3c3c5a;
color: white; color: white;
padding: 20px; margin: 20px 0;
border-radius: 5px; border-radius: 5px;
display: flex; display: flex;
flex-flow: column; flex-flow: column;
height: max-content; height: max-content;
transition: background .2s; } transition: background .2s; }
.section-articles article img {
order: -1;
max-width: calc(100% + 40px);
border-radius: 5px;
margin: -20px -20px 20px -20px;
background: #505078;
object-fit: cover;
max-height: 170px; }
.section-articles article h1 {
margin-top: 0px; }
.section-articles article a { .section-articles article a {
color: white; } margin: 10px 0; }
.section-articles article a:hover { .section-articles article a:hover {
text-decoration: underline; } text-decoration: underline; }
.section-articles article .meta { .section-articles .previous-article {
margin: 0; } text-align: right; }
.section-articles article .author {
font-style: italic;
color: #c8c8e6; }
.section-articles article:hover {
background: #464669; }
@media (max-width: 600px) { .section-articles::after {
.section-articles { content: '';
grid-template-columns: repeat(1, 1fr); } } position: absolute;
width: 100vw;
background: #32324b;
height: 230px;
left: 0;
z-index: -10; }
footer { footer {
background: #1e1e2d; background: #1e1e2d;

View file

@ -7,15 +7,16 @@
html { html {
scrollbar-width: thin; scrollbar-width: thin;
scrollbar-color: #ff8282 #3c3c5a; } scrollbar-color: #ff8282 #3c3c5a;
overflow-x: hidden;
overflow-y: scroll; }
body { body {
background: #28283c; background: #28283c;
color: #f0f0ff; color: #f0f0ff;
margin: 0; margin: 0;
font-family: PoppinsLatin, Monaco, Lucida Console, monospace; font-family: PoppinsLatin, Monaco, Lucida Console, monospace;
display: grid; display: grid; }
overflow-x: hidden; }
a { a {
color: #ff8282; color: #ff8282;