src/pages/index.astro 2.8 K raw
1
---
2
import { getCollection } from "astro:content";
3
import PageLayout from "@/layouts/Base";
4
import PostPreview from "@/components/blog/PostPreview";
5
import SocialList from "@/components/SocialList";
6
import { sortMDByDate } from "@/utils";
7
8
const MAX_POSTS = 10;
9
const allPosts = await getCollection("post");
10
const allPostsByDate = sortMDByDate(allPosts).slice(0, MAX_POSTS);
11
12
---
13
14
<PageLayout meta={{ title: "Home" }}>
15
	<section>
16
		<h1 class="title mb-6">Hey there!</h1>
17
		<p class="mb-4">
18
      My name is Steve, and I'm a developer, technical writer, and creator with a desire to help
19
			build the future of the web. Stay a while to see what I'm working on!
20
		</p>
21
		<SocialList />
22
	</section>
23
	<section aria-label="Blog post list" class="mt-16">
24
		<h2 class="title mb-4 text-xl">Posts</h2>
25
		<ul class="space-y-4 sm:space-y-2">
26
			{
27
				allPostsByDate.map((p) => (
28
					<li class="flex flex-col gap-x-2 sm:flex-row">
29
						<PostPreview post={p} />
30
					</li>
31
				))
32
			}
33
		</ul>
34
	</section>
35
	<section class="mt-16">
36
		<h2 class="title mb-4 text-xl">Extras</h2>
37
		<ul class="space-y-4 sm:space-y-2">
38
			<li>
39
				<a
40
          href="https://stevedylanphoto.com"
41
					target="_blank"
42
					rel="noopener noreferrer"
43
					class="cactus-link inline-block"
44
					>stevedylanphoto
45
				</a>:
46
				<p class="inline-block sm:mt-2">My personal photography portfolio</p>
47
			</li>
48
			<li>
49
				<a
50
          href="https://pinata.cloud"
51
					target="_blank"
52
					rel="noopener noreferrer"
53
					class="cactus-link inline-block"
54
					>Pinata
55
				</a>:
56
				<p class="inline-block sm:mt-2">Where I'm currently working as Head of Community</p>
57
			</li>
58
			<li>
59
				<a
60
          href="https://medium.com/@stevedsimkins"
61
					target="_blank"
62
					rel="noopener noreferrer"
63
					class="cactus-link inline-block"
64
					>Medium
65
				</a>:
66
        <p class="inline-block sm:mt-2">
67
          Technical blog posts I've written for 
68
				<a
69
            href="https://pinata.cloud"
70
					target="_blank"
71
					rel="noopener noreferrer"
72
					class="cactus-link inline-block"
73
					>Pinata
74
				</a>
75
        </p>
76
			</li>
77
			<li>
78
				<a
79
					href="https://www.markdownguide.org/"
80
					target="_blank"
81
					rel="noopener noreferrer"
82
					class="cactus-link inline-block"
83
					>Markdown
84
				</a>:
85
				<p class="inline-block sm:mt-2">Simple and easy-to-use markup language.</p>
86
			</li>
87
			<li>
88
				<a
89
					href="https://mdxjs.com/"
90
					target="_blank"
91
					rel="noopener noreferrer"
92
					class="cactus-link inline-block"
93
					>MDX
94
				</a>:
95
				<p class="inline-block sm:mt-2">Markdown for the component era.</p>
96
			</li>
97
			<li>
98
				<a
99
					href="https://github.com/vercel/satori"
100
					target="_blank"
101
					rel="noopener noreferrer"
102
					class="cactus-link inline-block"
103
					>Satori
104
				</a>:
105
				<p class="inline-block sm:mt-2">Generating png Open Graph images for blog posts</p>
106
			</li>
107
		</ul>
108
	</section>
109
</PageLayout>