Skip to content

Commit d132992

Browse files
committed
feat: update tag margin and increment post limit preview
1 parent 854191a commit d132992

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

src/components/news/Tag.astro

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,5 @@ const formatTag = (t: string) => {
4444
"inline-flex items-center rounded-full border px-2.5 py-0.5 align-middle text-[10px] font-medium tracking-wider uppercase transition-colors",
4545
colorClass,
4646
className,
47-
]}
47+
]}>{formatTag(name)}</a
4848
>
49-
{formatTag(name)}
50-
</a>

src/pages/news/index.astro

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ import { formatDateLong } from "@/utils/time";
55
import { countWords, minutesToRead, truncateForPreview } from "@/utils/content";
66
import { Icon } from "astro-icon/components";
77
import Tag from "@/components/news/Tag.astro";
8-
import IconButton from "@/components/IconButton.astro";
98
109
const posts = (await getCollection("posts")).sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf());
1110
1211
const postsWithMeta = posts.map((p) => {
1312
const words = countWords(p.body ?? "");
14-
const excerpt = truncateForPreview(p.body ?? "", 512);
13+
const excerpt = truncateForPreview(p.body ?? "", 700);
1514
return {
1615
...p,
1716
words,
@@ -60,7 +59,7 @@ const postsWithMeta = posts.map((p) => {
6059
</div>
6160

6261
{entry.data.tags && entry.data.tags.length > 0 && (
63-
<div class="flex flex-wrap gap-1.5">
62+
<div class="flex flex-row flex-wrap gap-0.5">
6463
{entry.data.tags.map((tag: string) => (
6564
<Tag name={tag} />
6665
))}

0 commit comments

Comments
 (0)