turn verticalposts shortcode into partial

This commit is contained in:
Vri 🌈 2023-03-18 20:55:12 +01:00
parent e115ebd7ca
commit df671adc3a
Signed by: vrifox
GPG key ID: D40098E5B60B2197
10 changed files with 68 additions and 64 deletions

View file

@ -11,6 +11,7 @@
// partials // partials
@import "partials/sidebar"; @import "partials/sidebar";
@import "partials/footer"; @import "partials/footer";
@import "partials/moreposts";
@import "partials/helpers/icons.scss"; @import "partials/helpers/icons.scss";
#blog-header { #blog-header {

View file

@ -5,9 +5,6 @@
// fonts // fonts
@import "fonts/playfair"; @import "fonts/playfair";
// shortcodes
@import "shortcodes/verticalposts";
// partials // partials
@import "partials/sidebar"; @import "partials/sidebar";
@import "partials/footer"; @import "partials/footer";
@ -74,25 +71,3 @@ main > p {
margin-bottom: 8rem; margin-bottom: 8rem;
} }
} }
section {
position: relative;
h2 {
.more{
font-size: .75em;
font-weight: normal;
hyphens: none;
&::after {
content: "\27F6";
margin-left: .25em;
transition: margin .5s;
}
&:hover::after {
margin-left: .5em !important;
}
}
&:hover .more::after {
margin-left: .35em;
}
}
}

View file

@ -1,7 +1,23 @@
.verticalposts { .moreposts {
hyphens: auto; hyphens: auto;
margin-top: 4em; margin-top: 4em;
.verticalposts-wrapper { .more{
font-size: .75em;
font-weight: normal;
hyphens: none;
&::after {
content: "\27F6";
margin-left: .25em;
transition: margin .5s;
}
&:hover::after {
margin-left: .5em !important;
}
}
&:hover .more::after {
margin-left: .35em;
}
.moreposts-wrapper {
border-radius: .5em; border-radius: .5em;
display: flex; display: flex;
flex-direction: row; flex-direction: row;

View file

@ -4,5 +4,3 @@ title: "Hola 🖖"
Ich erstelle Websites und Grafiken Ich erstelle Websites und Grafiken
Zudem betreibe und betreue ich [Cozy Town](https://cozy.town) Zudem betreibe und betreue ich [Cozy Town](https://cozy.town)
{{< verticalposts header="latest-posts-heading" >}}

View file

@ -4,5 +4,3 @@ title: "Hola 🖖"
I create Websites and Graphics I create Websites and Graphics
Additinaly I host and maintain [Cozy Town](https://cozy.town) Additinaly I host and maintain [Cozy Town](https://cozy.town)
{{< verticalposts header="latest-posts-heading" >}}

View file

@ -17,8 +17,10 @@ sourcecode:
made-with: made-with:
other: "Erstellt mit " other: "Erstellt mit "
# Shortcodes # MorePosts
verticalposts-more: moreposts-heading:
other: Aus meinem Blog
moreposts-more:
other: mehr other: mehr
# Home # Home
@ -27,9 +29,6 @@ introduction-heading:
introduction-sub: introduction-sub:
other: und Informatik ist meine Leidenschaft. other: und Informatik ist meine Leidenschaft.
latest-posts-heading:
other: Aus meinem Blog
# Blog # Blog
blog-heading: blog-heading:
other: Artikel other: Artikel

View file

@ -17,8 +17,10 @@ sourcecode:
made-with: made-with:
other: "Made with " other: "Made with "
# Shortcodes # MorePosts
verticalposts-more: moreposts-heading:
other: From my Blog
moreposts-more:
other: more other: more
# Content # Content
@ -27,9 +29,6 @@ introduction-heading:
introduction-sub: introduction-sub:
other: and Computer Science is my passion. other: and Computer Science is my passion.
latest-posts-heading:
other: From my Blog
# Blog # Blog
blog-heading: blog-heading:
other: Articles other: Articles

View file

@ -7,8 +7,18 @@
<header id="blog-header"> <header id="blog-header">
<h1 class="title">{{ .Title }}</h1> <h1 class="title">{{ .Title }}</h1>
<p> <p>
<span id="blog-post-published" title="{{ i18n "blog-post-published" }} {{ .Date | time.Format "2. January 2006, 15:04 MST" }}">{{ .Date | time.Format "2. January 2006" }}</span> <span
<span id="blog-post-updated" title="{{ i18n "blog-post-updated" }} {{ .Lastmod | time.Format "2. January 2006, 15:04 MST" }}">{{ i18n "blog-post-updated" }} {{ .Lastmod | time.Format "2. January 2006" }}</span> id="blog-post-published"
title="{{ i18n "blog-post-published" }} {{ .Date | time.Format "2. January 2006, 15:04 MST" }}"
>
{{ .Date | time.Format "2. January 2006" }}
</span>
<span
id="blog-post-updated"
title="{{ i18n "blog-post-updated" }} {{ .Lastmod | time.Format "2. January 2006, 15:04 MST" }}"
>
{{ i18n "blog-post-updated" }} {{ .Lastmod | time.Format "2. January 2006" }}
</span>
</p> </p>
</header> </header>
{{ end }} {{ end }}
@ -16,5 +26,6 @@
{{- define "main" }} {{- define "main" }}
<main> <main>
{{ .Content -}} {{ .Content -}}
{{ partial "moreposts.html" . }}
</main> </main>
{{- end }} {{- end }}

View file

@ -0,0 +1,21 @@
<section class="moreposts">
<h2>{{ i18n "moreposts-heading" }}
<a href="blog/"class="more">{{ i18n "moreposts-more" }}</a>
</h2>
<div class="moreposts-wrapper">
{{ range first 10 (where .Site.RegularPages "Section" "blog") }}
<a href="{{ .Permalink }}" class="post-group">
<p class="title">{{ .Title }}</p>
<aside class="meta" title="{{ .Date | time.Format "2 Jan 2006, 15:04 MST" }}">
<span class="date">{{ .Date | time.Format "2. January 2006" }}</span>
<span class="author">
{{ with .Params.author }}
by
{{ end }}
{{ .Params.author }}
</span>
</aside>
</a>
{{ end }}
</div>
</section>

View file

@ -1,14 +0,0 @@
<section class="verticalposts">
{{ with .Get "header" }}<h2>{{ i18n . }} <a href="blog/"class="more">{{ i18n "verticalposts-more" }}</a></h2>{{ end }}
<div class="verticalposts-wrapper">
{{ range first 3 (where .Site.RegularPages "Section" "blog") }}
<a href="{{ .Permalink }}" class="post-group">
<p class="title">{{ .Title }}</p>
<aside class="meta" title="{{ .Date | time.Format "2 Jan 2006, 15:04 MST" }}">
<span class="date">{{ .Date | time.Format "2. January 2006" }}</span>
<span class="author">{{ with .Params.author }}by {{ end }}{{ .Params.author }}</span>
</aside>
</a>
{{ end }}
</div>
</section>