Skip to content

Commit beddc3a

Browse files
committed
improve semantic HTML for post-links
1 parent b925311 commit beddc3a

2 files changed

Lines changed: 17 additions & 12 deletions

File tree

assets/modules/post-link.css

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@
6161
gap: 0.4em;
6262
flex-shrink: 0;
6363
margin-left: 1em;
64+
list-style: none;
65+
padding: 0;
66+
margin: 0;
6467

6568
@media (max-width: 1000px) {
6669
display: none;
@@ -91,7 +94,7 @@
9194
font-weight: 700;
9295
display: block;
9396
color: var(--color-text);
94-
margin-bottom: 0;
97+
margin: 0;
9598
transition: color 0.3s ease;
9699
}
97100

@@ -101,6 +104,6 @@
101104
color: var(--color-text-secondary);
102105
line-height: 1.4;
103106
display: block;
104-
margin-top: 0.25rem;
107+
margin: 0.25rem 0 0 0;
105108
}
106109
}

layouts/partials/post-links.html

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,20 @@
22
{{ range (where . "Params.unlisted" "ne" true).ByDate.Reverse }} {{ $post :=
33
. }} {{ $minRead := math.Ceil (div (countwords $post.Content) 200.0) }}
44
<a class="post-link" href="{{ .Permalink | relURL }}">
5-
<span class="content">
6-
<span class="title">{{ .Title }}</span>
7-
<span class="description">
8-
{{ .Date.Format "January 2, 2006" }} {{ if gt $minRead 1 }} · {{
9-
$minRead }} min read{{ end }}
10-
</span>
11-
</span>
12-
<span class="tags">
5+
<div class="content">
6+
<h3 class="title">{{ .Title }}</h3>
7+
<p class="description">
8+
<time datetime="{{ .Date.Format "2006-01-02" }}">
9+
{{ .Date.Format "January 2, 2006" }}
10+
</time>
11+
{{ if gt $minRead 1 }} · {{ $minRead }} min read{{ end }}
12+
</p>
13+
</div>
14+
<ul class="tags">
1315
{{ range .Params.tags }}
14-
<span class="tag">{{ . }}</span>
16+
<li class="tag">{{ . }}</li>
1517
{{ end }}
16-
</span>
18+
</ul>
1719
</a>
1820
{{ end }}
1921
</nav>

0 commit comments

Comments
 (0)