Skip to content

Commit ef98a9d

Browse files
committed
#3414 webpage: add more blog overview page styling
Signed-off-by: Patrizio Bekerle <[email protected]>
1 parent 466a3d1 commit ef98a9d

File tree

2 files changed

+69
-31
lines changed

2 files changed

+69
-31
lines changed
Lines changed: 61 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,14 @@
11
<template>
2-
<div>
3-
<v-card
4-
v-for="page in blogPages"
5-
:key="page.path"
6-
class="mx-auto"
7-
variant="outlined"
8-
>
9-
<v-list-item>
10-
<template v-slot:default>
11-
<div class="overline mb-4">
12-
{{ page.date }}
13-
</div>
14-
<v-list-item-title class="text-h5 mb-1">
15-
<a :href="page.path">{{ page.title }}</a>
16-
</v-list-item-title>
17-
<v-list-item-subtitle>
18-
{{ page.description }}
19-
</v-list-item-subtitle>
20-
</template>
21-
</v-list-item>
22-
</v-card>
2+
<div class="blog-index">
3+
<article v-for="page in blogPages" :key="page.path" class="blog-post">
4+
<time class="blog-date">{{ page.date }}</time>
5+
<h2 class="blog-title">
6+
<a :href="page.path" class="blog-link">{{ page.title }}</a>
7+
</h2>
8+
<p v-if="page.description" class="blog-description">
9+
{{ page.description }}
10+
</p>
11+
</article>
2312
</div>
2413
</template>
2514

@@ -36,7 +25,56 @@ onMounted(() => {
3625
</script>
3726

3827
<style scoped>
39-
.v-card {
40-
margin: 10px 0;
28+
.blog-index {
29+
max-width: 740px;
30+
margin: 0 auto;
31+
padding: 0 1.5rem;
32+
33+
h2 {
34+
padding-top: 0;
35+
}
36+
}
37+
38+
.blog-post {
39+
margin-bottom: 0.75rem;
40+
padding-bottom: 0.5rem;
41+
border-bottom: 1px solid var(--c-border, #eaecef);
42+
}
43+
44+
.blog-post:last-child {
45+
border-bottom: none;
46+
}
47+
48+
.blog-date {
49+
display: block;
50+
font-size: 0.85rem;
51+
color: var(--c-text-lighter, #7f8c8d);
52+
margin-bottom: 0.15rem;
53+
}
54+
55+
.blog-title {
56+
margin: 0 0 0.15rem;
57+
font-size: 1.35rem;
58+
font-weight: 600;
59+
line-height: 1.3;
60+
}
61+
62+
.blog-link {
63+
color: var(--c-text, #2c3e50);
64+
text-decoration: none;
65+
border-bottom: 2px solid transparent;
66+
transition: border-color 0.3s;
67+
}
68+
69+
.blog-link:hover {
70+
color: var(--c-brand, #3eaf7c);
71+
border-bottom-color: var(--c-brand, #3eaf7c);
72+
}
73+
74+
.blog-description {
75+
margin: 0;
76+
font-size: 0.95rem;
77+
line-height: 1.5;
78+
color: var(--c-text, #2c3e50);
4179
}
4280
</style>

webpage/tests/blog.spec.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,25 @@ test("blog overview page", async ({ page, config }) => {
99
).toBeVisible();
1010

1111
// Check that blog entries are displayed
12-
// There should be multiple blog post cards
13-
const blogCards = page.locator(".v-card");
14-
await expect(blogCards).not.toHaveCount(0);
12+
// There should be multiple blog post articles
13+
const blogPosts = page.locator("article.blog-post");
14+
await expect(blogPosts).not.toHaveCount(0);
1515

1616
// Check that the first blog entry has a title link
17-
const firstCard = blogCards.first();
18-
const firstLink = firstCard.locator("a");
17+
const firstPost = blogPosts.first();
18+
const firstLink = firstPost.locator("a.blog-link");
1919
await expect(firstLink).toBeVisible();
2020
await expect(firstLink).toHaveAttribute("href", /\/blog\/.+\.html/);
2121

2222
// Check that blog entries have dates
23-
const dateElement = firstCard.locator(".overline");
23+
const dateElement = firstPost.locator("time.blog-date");
2424
await expect(dateElement).toBeVisible();
2525
// Date should be in YYYY-MM-DD format
2626
await expect(dateElement).toHaveText(/\d{4}-\d{2}-\d{2}/);
2727

2828
// Verify we have at least a few blog entries (should have 80 based on generation)
29-
const cardCount = await blogCards.count();
30-
expect(cardCount).toBeGreaterThan(5);
29+
const postCount = await blogPosts.count();
30+
expect(postCount).toBeGreaterThan(5);
3131
});
3232

3333
test("blog entry - AI support", async ({ page, config }) => {

0 commit comments

Comments
 (0)