the website is now more lightweight

This commit is contained in:
Vrifox 2020-11-22 19:06:31 +01:00
parent 59c38330f6
commit 74929ff17a
4 changed files with 8 additions and 93 deletions

View file

@ -1,67 +0,0 @@
@import '../import/colors.scss';
@import '../import/main.scss';
@import '../import/nav.scss';
@import '../import/footer.scss';
@import '../import/include.scss';
main {
margin: 60px 0 0 0;
}
.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;
max-width: 562px;
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;
}
.meta {
font-size: 14px;
margin: 0;
}
.status {
color: $white-dark;
font-style: italic;
}
}
}
@media (max-width: 900px) {
.section-articles {
grid-template-columns: repeat(2, 1fr);
}
}
@media (max-width: 600px) {
.section-articles {
grid-template-columns: repeat(1, 1fr);
}
}

View file

@ -14,9 +14,16 @@
<article>
<h1><span>{{ .Title }}</span></h1>
{{ with .Description }}<p class="description">{{ . }}</p>{{ end }}
{{- if eq .Params.type "post" }}
<p class="meta" title="{{ .Date.Format "2 Jan 2006, 15:04 MST" }}">
<span class="date">{{ .Date.Format "2 January 2006" }}</span>
{{- with .Params.author }}<span class="author">by {{ . }}</span>{{ end }}
{{ end }}
{{- if eq .Params.type "project" }}
<p class="meta">
{{ with .Params.activetime }}<span class="date">{{ . }}</span><br />{{ end }}
{{ with .Params.status }}<span class="status">{{ . }}</span>{{ end }}
{{- end }}
</p>
</article>
</a>

View file

@ -41,7 +41,7 @@
<article>
<h1>{{ .Title }}</h1>
<p class="meta">
{{ with .Params.activetime }}<span class="date">{{ . }}</span>{{ end }}<br />
{{ with .Params.activetime }}<span class="date">{{ . }}</span><br />{{ end }}
{{ with .Params.status }}<span class="status">{{ . }}</span>{{ end }}
</p>
</article>

View file

@ -1,25 +0,0 @@
{{ define "stylesheet" }}{{ $scss := resources.Get "projects/list.scss" }}{{ $style := $scss | resources.ToCSS }}
<link rel="stylesheet" href="{{ $style.Permalink }}" type="text/css" media="screen" rel="preload" />
{{ end }}
{{ define "main" }}
<main>
<div class="container">
<section class="section-articles">
{{ range .Pages }}
<a href="{{ .Permalink }}">
<article>
<h1>{{ .Title }}</h1>
<p class="meta" 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>
{{ with .Description }}<p>{{ . }}</p>{{ end }}
<img {{ with .Params.featured_image }}src="{{ . | relURL }}"{{ end }} loading="lazy" alt="">
</article>
</a>
{{ end }}
</section>
</div>
</main>
{{ end }}