-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
109 lines (93 loc) · 4.19 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
---
layout: page
title: "Home"
pagination:
enabled: true
---
<main class="flex-grow container mx-auto px-4 flex flex-col">
<div class="flex-grow">
<div class="max-w-prose mx-auto text-center">
{% if site.homepage.welcome.title != "" %}
<!-- Welcome Message -->
<div class="py-6 px-6 mb-8">
<h2 class="text-2xl font-bold mb-2">{{ site.homepage.welcome.title }}</h2>
{% if site.homepage.welcome.subtitle %}
<p class="text-gray-700 dark:text-gray-300">
{{ site.homepage.welcome.subtitle }}
</p>
{% endif %}
</div>
{% endif %}
<div class="space-y-8 md:space-y-12">
{% for post in paginator.posts %}
<div class="flex items-start space-x-4 md:space-x-6">
<div class="flex-1">
<!-- Date, Reading Time, Category -->
<div class="flex items-center text-sm text-gray-600 dark:text-gray-400 mb-2">
<span>{{ post.date | date: "%d %b %Y" }}</span>
<span class="mx-2">•</span>
<span>{{ post.content | number_of_words | divided_by: 200 | plus: 1 }} min read</span>
<span class="mx-2">•</span>
<span>{{ post.category }}</span>
</div>
<!-- Title, Summary, Image -->
<div class="flex items-start space-x-4 md:space-x-6">
<div class="flex-1 min-w-0">
<a href="{{ post.url | relative_url }}" class="no-underline">
<h2 class="text-xl font-semibold mb-2 text-left line-clamp-2 md:line-clamp-1">{{ post.title }}</h2>
</a>
<p class="text-gray-600 dark:text-gray-400 text-justify overflow-hidden">
{% if post.description %}
<span class="line-clamp-3 md:line-clamp-4">{{ post.description }}</span>
{% else %}
<span class="line-clamp-3 md:line-clamp-4">{{ post.content | strip_html | truncate: 160 }}</span>
{% endif %}
</p>
</div>
{% if post.image %}
<a href="{{ post.url | relative_url }}" class="flex-shrink-0">
<img src="{{ post.image }}" alt="{{ post.title }}" class="w-24 h-24 md:w-32 md:h-32 object-cover rounded">
</a>
{% endif %}
</div>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
<!-- Pagination -->
{% if paginator.total_pages > 1 %}
<div class="pagination flex justify-center items-center space-x-4 mt-auto py-6">
{% if paginator.previous_page %}
<a href="{{ paginator.previous_page_path | relative_url }}" class="text-gray-700 dark:text-gray-200 hover:underline">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 19.5 8.25 12l7.5-7.5" />
</svg>
</a>
{% else %}
<span class="text-gray-400 dark:text-gray-500">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 19.5 8.25 12l7.5-7.5" />
</svg>
</span>
{% endif %}
<span class="text-gray-700 dark:text-gray-300">
{{ paginator.page }} of {{ paginator.total_pages }}
</span>
{% if paginator.next_page and paginator.page < paginator.total_pages %}
<a href="{{ paginator.next_page_path | relative_url }}" class="text-gray-700 dark:text-gray-200 hover:underline">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
<path stroke-linecap="round" stroke-linejoin="round" d="m8.25 4.5 7.5 7.5-7.5 7.5" />
</svg>
</a>
{% else %}
<span class="text-gray-400 dark:text-gray-500">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
<path stroke-linecap="round" stroke-linejoin="round" d="m8.25 4.5 7.5 7.5-7.5 7.5" />
</svg>
</span>
{% endif %}
</div>
{% endif %}
</main>