Skip to content

Commit 4d9fab7

Browse files
committed
Add tags list below the post title in archive section.
1 parent e2f7037 commit 4d9fab7

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

assets/css/extended/custom.css

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/* Structure the entry for proper link handling */
2+
.archive-entry {
3+
position: relative; /* Container for positioning */
4+
}
5+
6+
/* Remove z-index from title to allow click-through */
7+
.archive-entry-title {
8+
position: relative;
9+
margin-bottom: 0.5rem;
10+
}
11+
12+
/* Position entry-link to cover title area */
13+
.entry-link {
14+
position: absolute;
15+
top: 0;
16+
left: 0;
17+
right: 0;
18+
/* Cover title and metadata, but stop before tags */
19+
bottom: 2rem; /* Adjust this value based on your layout */
20+
z-index: 1; /* Above base content */
21+
}
22+
.archive-tags {
23+
margin-top: 0.2rem;
24+
}
25+
26+
.archive-tag {
27+
display: inline-block;
28+
padding: 0.15rem 0.5rem;
29+
margin-right: 0.2rem;
30+
margin-bottom: 0.2rem;
31+
border-radius: 0.3rem;
32+
font-size: 0.9rem;
33+
text-decoration: none;
34+
background-color: #f0f0f0;
35+
color: #666;
36+
}
37+
38+
.archive-tag:hover {
39+
background-color: #e0e0e0;
40+
color: #333;
41+
}

layouts/_default/archives.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@ <h3 class="archive-entry-title entry-hint-parent">
105105
<div class="archive-meta">
106106
{{- partial "post_meta.html" . -}}
107107
</div>
108+
{{- if .Params.tags }}
109+
<div class="archive-tags">
110+
{{- range .Params.tags }}
111+
<a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}" class="archive-tag">{{ . }}</a>
112+
{{- end }}
113+
</div>
114+
{{- end }}
108115
<a class="entry-link" aria-label="post link to {{ .Title | plainify }}" href="{{ .Permalink }}"></a>
109116
</div>
110117
{{- end }}

0 commit comments

Comments
 (0)