From bb26176277f8108c539e40fcbb1e024b3759ba38 Mon Sep 17 00:00:00 2001 From: protokey Date: Sun, 11 Oct 2026 00:04:44 +0400 Subject: [PATCH] feat: latest posts on the home card Co-Authored-By: Claude Opus 5.5 --- assets/css/custom.css | 22 ++++++++++++++++++++++ i18n/en.yaml | 1 + i18n/ru.yaml | 1 + layouts/partials/home/custom.html | 15 +++++++++++++++ 4 files changed, 39 insertions(+) diff --git a/assets/css/custom.css b/assets/css/custom.css index ac7c5dd..9f228c1 100644 --- a/assets/css/custom.css +++ b/assets/css/custom.css @@ -65,3 +65,25 @@ h1, h2, h3 { letter-spacing: -0.02em; } .vcard__more { display: inline-block; margin-top: 1.5rem; font-size: .9rem; color: rgba(var(--color-primary-400), 1); text-decoration: none; } .vcard__more:hover { text-decoration: underline; } + +.vcard__heading { + margin: 1.75rem 0 0; font-size: .8rem; font-weight: 600; + text-transform: uppercase; letter-spacing: .08em; + color: rgba(var(--color-neutral-400), 1); +} +.vcard__posts { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; gap: .5rem; } +.vcard__posts a { + display: flex; flex-direction: column; gap: .15rem; + padding: .6rem 1rem; border-radius: .75rem; + text-align: left; text-decoration: none; color: #fff; + background: rgba(255,255,255,.04); + border: 1px solid rgba(255,255,255,.08); + transition: background .15s, border-color .15s, transform .15s; +} +.vcard__posts a:hover { + background: rgba(var(--color-primary-600), .2); + border-color: rgba(var(--color-primary-500), .35); + transform: translateY(-1px); +} +.vcard__post-title { font-weight: 600; font-size: .95rem; line-height: 1.3; } +.vcard__post-date { font-size: .8rem; color: rgba(var(--color-neutral-400), 1); } diff --git a/i18n/en.yaml b/i18n/en.yaml index 48427cd..e138fff 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -1 +1,2 @@ moreAboutMe: "More about me →" +recentPosts: "Latest posts" diff --git a/i18n/ru.yaml b/i18n/ru.yaml index a20fe8c..386366f 100644 --- a/i18n/ru.yaml +++ b/i18n/ru.yaml @@ -1 +1,2 @@ moreAboutMe: "Подробнее обо мне →" +recentPosts: "Свежие записи" diff --git a/layouts/partials/home/custom.html b/layouts/partials/home/custom.html index 700e215..7146fc2 100644 --- a/layouts/partials/home/custom.html +++ b/layouts/partials/home/custom.html @@ -32,6 +32,21 @@ {{ end }} + {{ $posts := first 3 (where site.RegularPages "Section" "in" site.Params.mainSections).ByDate.Reverse }} + {{ with $posts }} +

{{ i18n "recentPosts" }}

+ + {{ end }} + {{ with $p.more }}{{ i18n "moreAboutMe" }}{{ end }} \ No newline at end of file