Add link to articles

This commit is contained in:
kbe
2025-08-20 14:34:13 +02:00
parent 1e293852f4
commit 75d235c17e

View File

@@ -32,16 +32,18 @@
{{ range first 2 $.Site.RegularPages }}
<div class="bg-white rounded-xl overflow-hidden shadow-lg article-card">
<div class="featured-article">
{{ if .Params.featured_image }}
<img src="{{ .Params.featured_image }}" alt="{{ .Title }}" class="w-full h-64 object-cover">
{{ else }}
<img src="/assets/images/col-1.jpg" alt="{{ .Title }}" class="w-full h-64 object-cover">
{{ end }}
<a href="{{ .RelPermalink }}">
{{ if .Params.featured_image }}
<img src="{{ .Params.featured_image }}" alt="{{ .Title }}" class="w-full h-64 object-cover">
{{ else }}
<img src="/assets/images/col-1.jpg" alt="{{ .Title }}" class="w-full h-64 object-cover">
{{ end }}
</a>
</div>
<div class="p-6">
<div class="flex flex-wrap gap-2 mb-4">
{{ range first 2 .Params.categories }}
<span class="bg-blue-100 text-blue-800 text-xs font-medium px-2 py-1 rounded">{{ . }}</span>
<a href="/categories/{{ . | urlize }}" class="bg-blue-100 text-blue-800 text-xs font-medium px-2 py-1 rounded hover:underline">{{ . }}</a>
{{ end }}
</div>
<h3 class="text-xl font-bold text-gray-900 mb-3">
@@ -59,11 +61,11 @@
<div class="flex items-center justify-between">
<div class="flex items-center text-sm text-gray-500">
<img src="https://i.pravatar.cc/24" alt="{{ .Params.author }}" class="w-6 h-6 rounded-full mr-2">
<span>{{ .Params.author }}</span>
<a href="/author/{{ .Params.author | urlize }}" class="hover:underline">{{ .Params.author }}</a>
<span class="mx-2"></span>
<span>{{ .Date | time.Format "Jan 2, 2006" }}</span>
</div>
<a href="{{ .RelPermalink }}" class="text-blue-600 hover:text-blue-800 font-medium text-sm">Read more →</a>
<a href="{{ .RelPermalink }}" class="text-blue-600 hover:text-blue-800 font-medium text-sm">Lire la suite →</a>
</div>
</div>
</div>
@@ -87,15 +89,17 @@
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8 mb-12">
{{ range first 6 (after 2 $.Site.RegularPages) }}
<div class="bg-white rounded-xl overflow-hidden shadow-md article-card">
{{ if .Params.featured_image }}
<img src="{{ .Params.featured_image }}" alt="{{ .Title }}" class="w-full h-48 object-cover">
{{ else }}
<img src="/assets/images/col-1.jpg" alt="{{ .Title }}" class="w-full h-48 object-cover">
{{ end }}
<a href="{{ .RelPermalink }}">
{{ if .Params.featured_image }}
<img src="{{ .Params.featured_image }}" alt="{{ .Title }}" class="w-full h-48 object-cover">
{{ else }}
<img src="/assets/images/col-1.jpg" alt="{{ .Title }}" class="w-full h-48 object-cover">
{{ end }}
</a>
<div class="p-6">
<div class="flex flex-wrap gap-2 mb-3">
{{ range first 1 .Params.categories }}
<span class="bg-blue-100 text-blue-800 text-xs font-medium px-2 py-1 rounded">{{ . }}</span>
<a href="/categories/{{ . | urlize }}" class="bg-blue-100 text-blue-800 text-xs font-medium px-2 py-1 rounded hover:underline">{{ . }}</a>
{{ end }}
</div>
<h3 class="text-lg font-bold text-gray-900 mb-3">{{ .Title }}</h3>
@@ -110,6 +114,7 @@
</p>
<div class="flex items-center justify-between text-sm text-gray-500">
<span>{{ .Date | time.Format "Jan 2, 2006" }}</span>
<a href="{{ .RelPermalink }}" class="text-blue-600 hover:text-blue-800 font-medium text-sm">Read more →</a>
</div>
</div>
</div>