From df671adc3acab97fcbd5cd90b9c7ccfef12f8d8b Mon Sep 17 00:00:00 2001 From: vrifox Date: Sat, 18 Mar 2023 20:55:12 +0100 Subject: [PATCH] turn verticalposts shortcode into partial --- assets/scss/blog.scss | 1 + assets/scss/home.scss | 25 ------------------- .../moreposts.scss} | 20 +++++++++++++-- content/_index.de.md | 4 +-- content/_index.en.md | 4 +-- i18n/de.yaml | 9 +++---- i18n/en.yaml | 9 +++---- layouts/blog/single.html | 25 +++++++++++++------ layouts/partials/moreposts.html | 21 ++++++++++++++++ layouts/shortcodes/verticalposts.html | 14 ----------- 10 files changed, 68 insertions(+), 64 deletions(-) rename assets/scss/{shortcodes/verticalposts.scss => partials/moreposts.scss} (64%) create mode 100644 layouts/partials/moreposts.html delete mode 100644 layouts/shortcodes/verticalposts.html diff --git a/assets/scss/blog.scss b/assets/scss/blog.scss index 1a28184..f81126f 100644 --- a/assets/scss/blog.scss +++ b/assets/scss/blog.scss @@ -11,6 +11,7 @@ // partials @import "partials/sidebar"; @import "partials/footer"; +@import "partials/moreposts"; @import "partials/helpers/icons.scss"; #blog-header { diff --git a/assets/scss/home.scss b/assets/scss/home.scss index 8c0fcfa..104ffe5 100644 --- a/assets/scss/home.scss +++ b/assets/scss/home.scss @@ -5,9 +5,6 @@ // fonts @import "fonts/playfair"; -// shortcodes -@import "shortcodes/verticalposts"; - // partials @import "partials/sidebar"; @import "partials/footer"; @@ -73,26 +70,4 @@ main > p { &:last-of-type { 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; - } - } } \ No newline at end of file diff --git a/assets/scss/shortcodes/verticalposts.scss b/assets/scss/partials/moreposts.scss similarity index 64% rename from assets/scss/shortcodes/verticalposts.scss rename to assets/scss/partials/moreposts.scss index dd2a8c9..9807deb 100644 --- a/assets/scss/shortcodes/verticalposts.scss +++ b/assets/scss/partials/moreposts.scss @@ -1,7 +1,23 @@ -.verticalposts { +.moreposts { hyphens: auto; 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; display: flex; flex-direction: row; diff --git a/content/_index.de.md b/content/_index.de.md index 0f4b099..1733ede 100644 --- a/content/_index.de.md +++ b/content/_index.de.md @@ -3,6 +3,4 @@ title: "Hola 🖖" --- Ich erstelle Websites und Grafiken -Zudem betreibe und betreue ich [Cozy Town](https://cozy.town) - -{{< verticalposts header="latest-posts-heading" >}} \ No newline at end of file +Zudem betreibe und betreue ich [Cozy Town](https://cozy.town) \ No newline at end of file diff --git a/content/_index.en.md b/content/_index.en.md index 4f85561..e5222e1 100644 --- a/content/_index.en.md +++ b/content/_index.en.md @@ -3,6 +3,4 @@ title: "Hola 🖖" --- I create Websites and Graphics -Additinaly I host and maintain [Cozy Town](https://cozy.town) - -{{< verticalposts header="latest-posts-heading" >}} \ No newline at end of file +Additinaly I host and maintain [Cozy Town](https://cozy.town) \ No newline at end of file diff --git a/i18n/de.yaml b/i18n/de.yaml index fe8c4a1..02a9e24 100644 --- a/i18n/de.yaml +++ b/i18n/de.yaml @@ -17,8 +17,10 @@ sourcecode: made-with: other: "Erstellt mit " -# Shortcodes -verticalposts-more: +# MorePosts +moreposts-heading: + other: Aus meinem Blog +moreposts-more: other: mehr # Home @@ -27,9 +29,6 @@ introduction-heading: introduction-sub: other: und Informatik ist meine Leidenschaft. -latest-posts-heading: - other: Aus meinem Blog - # Blog blog-heading: other: Artikel diff --git a/i18n/en.yaml b/i18n/en.yaml index 54df862..c8c8cc2 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -17,8 +17,10 @@ sourcecode: made-with: other: "Made with " -# Shortcodes -verticalposts-more: +# MorePosts +moreposts-heading: + other: From my Blog +moreposts-more: other: more # Content @@ -27,9 +29,6 @@ introduction-heading: introduction-sub: other: and Computer Science is my passion. -latest-posts-heading: - other: From my Blog - # Blog blog-heading: other: Articles diff --git a/layouts/blog/single.html b/layouts/blog/single.html index dcf8492..1da7cc1 100644 --- a/layouts/blog/single.html +++ b/layouts/blog/single.html @@ -4,17 +4,28 @@ {{- end -}} {{- define "header" }} -
-

{{ .Title }}

-

- {{ .Date | time.Format "2. January 2006" }} - {{ i18n "blog-post-updated" }} {{ .Lastmod | time.Format "2. January 2006" }} -

-
+
+

{{ .Title }}

+

+ + {{ .Date | time.Format "2. January 2006" }} + + + {{ i18n "blog-post-updated" }} {{ .Lastmod | time.Format "2. January 2006" }} + +

+
{{ end }} {{- define "main" }}
{{ .Content -}} + {{ partial "moreposts.html" . }}
{{- end }} diff --git a/layouts/partials/moreposts.html b/layouts/partials/moreposts.html new file mode 100644 index 0000000..6af0dde --- /dev/null +++ b/layouts/partials/moreposts.html @@ -0,0 +1,21 @@ + \ No newline at end of file diff --git a/layouts/shortcodes/verticalposts.html b/layouts/shortcodes/verticalposts.html deleted file mode 100644 index 0114a15..0000000 --- a/layouts/shortcodes/verticalposts.html +++ /dev/null @@ -1,14 +0,0 @@ -
- {{ with .Get "header" }}

{{ i18n . }} {{ i18n "verticalposts-more" }}

{{ end }} - -
\ No newline at end of file