-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathRecentBlogPosts.astro
More file actions
84 lines (73 loc) · 1.95 KB
/
RecentBlogPosts.astro
File metadata and controls
84 lines (73 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
---
import { Icon } from 'astro-icon';
import { formatDate } from '../utils/date';
import { Post } from './BlogPost.astro';
export interface Props {
posts: Post[];
}
const { posts } = Astro.props;
---
<div
class="waves blue-waves section bg-blue-light flex flex-wrap justify-center"
>
<div class="section-content lg:mb-8 lg:mt-16">
<div class="flex flex-wrap justify-center">
<div class="flex flex-wrap items-center justify-between mb-8 w-full">
<h3 class="text-4xl text-navy">Ahoy - advice and insights ahead!</h3>
<a href="/blog/" class="btn btn-red mt-4 w-full lg:mt-0 lg:w-auto">
See more insights
</a>
</div>
<div
class="grid grid-cols-1 gap-1 justify-center mb-4 w-full lg:grid-cols-3"
>
{
posts.map((post, index) => (
<div
data-aos="flip-down"
data-aos-delay={index * 200}
class="bg-white flex flex-col px-8 py-16 rounded"
>
<div class="flex mb-4">
<Icon class="h-auto mr-4 w-10" name="fish" />
{formatDate(post.frontmatter.date)}
</div>
<a
class="
blog-link
block
font-bold
flex-grow
leading-8
min-h-24
my-2
text-navy text-2xl
hover:text-red
"
href={`/blog/${post.frontmatter.slug}/`}
>
{post.frontmatter.title}
</a>
<div class="attribution bottom-0 mb-4">
By {post.frontmatter.author.name}
</div>
</div>
))
}
</div>
</div>
</div>
</div>
<style lang="scss">
.blog-link {
@apply text-navy;
&:active,
&:visited {
@apply text-navy;
}
&:hover,
&:focus {
@apply text-red;
}
}
</style>