♻️ Refactor custom landing page and recent articles

This commit is contained in:
Nuno Coração
2022-12-30 19:30:16 +00:00
parent 5492b63ad0
commit 889f30f41a
6 changed files with 38 additions and 40 deletions

View File

@@ -0,0 +1,11 @@
{{ $recentArticles := 5 }}
{{ $recentArticles = .Site.Params.homepage.showRecentItems }}
<section
class="relative w-screen max-w-[1600px] grid gap-4 sm:grid-cols-2 md:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5"
style="left: calc(max(-50vw,-800px) + 50%);">
{{ range first $recentArticles (.Paginate (where .Site.RegularPages "Type" "in"
.Site.Params.mainSections)).Pages }}
{{ partial "article-link-card.html" . }}
{{ end }}
</section>