feat: extend behavior of article for gallery posts

This commit is contained in:
Himadri Bhattacharjee
2026-05-23 07:21:08 +05:30
parent 07699f0f34
commit c1aab83499
2 changed files with 9 additions and 12 deletions

View File

@@ -388,34 +388,32 @@ article {
color: var(--air);
}
img {
margin: auto;
}
}
.gallery {
img {
break-inside: avoid;
border-radius: 1rem;
box-sizing: border-box;
width: 100%;
}
figure {
position: relative;
img, .post-link {
border-radius: 1rem;
}
column-count: if(media(width >= 768px): 2; else: 1);
column-gap: var(--small-gap);
figure+figure {
article+article {
margin-top: var(--gap);
}
article {
padding-block: 0;
}
.post-link {
position: absolute;
border-radius: 1rem;
display: grid;
place-content: center;
font-weight: 600;
@@ -572,7 +570,6 @@ nav[data-post] {
}
a {
padding-bottom: 0.2rem;
font-weight: 500;
border-bottom: 2px solid var(--foreground);

View File

@@ -11,10 +11,10 @@
<section class="gallery">
{{ $paginator := .Paginate $pages }} {{ range $index, $page := $paginator.Pages }}
<figure>
<article>
<img src="{{ .Params.image }}">
<a href="{{ .Permalink }}" aria-label="{{ .Title }}" class="post-link">{{ .Title }}</a>
</figure>
</article>
{{ end }}
</section>