Initial commit
This commit is contained in:
18
src/pages/blog/[...slug].astro
Normal file
18
src/pages/blog/[...slug].astro
Normal file
@ -0,0 +1,18 @@
|
||||
---
|
||||
import { CollectionEntry, getCollection } from "astro:content";
|
||||
import BlogPost from "../../layouts/BlogPost.astro";
|
||||
|
||||
const posts = await getCollection("blog");
|
||||
type Props = CollectionEntry<"blog">;
|
||||
|
||||
const { slug } = Astro.params;
|
||||
const post = posts.find((page) => page.slug === slug);
|
||||
if (!post) {
|
||||
return Astro.redirect("/404");
|
||||
}
|
||||
const { Content } = await post.render();
|
||||
---
|
||||
|
||||
<BlogPost {...post.data}>
|
||||
<Content />
|
||||
</BlogPost>
|
37
src/pages/blog/index.astro
Normal file
37
src/pages/blog/index.astro
Normal file
@ -0,0 +1,37 @@
|
||||
---
|
||||
import BaseHead from "../../components/BaseHead.astro";
|
||||
import Header from "../../components/Header.astro";
|
||||
import { SITE_TITLE, SITE_DESCRIPTION } from "../../consts";
|
||||
import { getCollection } from "astro:content";
|
||||
import FormattedDate from "../../components/FormattedDate.astro";
|
||||
|
||||
const posts = (await getCollection("blog")).sort(
|
||||
(a, b) => a.data.pubDate.valueOf() - b.data.pubDate.valueOf()
|
||||
);
|
||||
---
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" data-theme="night">
|
||||
<head>
|
||||
<BaseHead title={SITE_TITLE} description={SITE_DESCRIPTION} />
|
||||
</head>
|
||||
<body class="block h-[100%]">
|
||||
<Header />
|
||||
<main
|
||||
class="prose prose-invert container flex flex-col items-center justify-center gap-3 sm:gap-6 px-4 py-16 text-center mx-auto min-h-[calc(100%-64px)]"
|
||||
>
|
||||
<section>
|
||||
<ul>
|
||||
{
|
||||
posts.map((post) => (
|
||||
<li>
|
||||
<FormattedDate date={post.data.pubDate} />
|
||||
<a href={`/blog/${post.slug}/`}>{post.data.title}</a>
|
||||
</li>
|
||||
))
|
||||
}
|
||||
</ul>
|
||||
</section>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
158
src/pages/index.astro
Normal file
158
src/pages/index.astro
Normal file
@ -0,0 +1,158 @@
|
||||
---
|
||||
import BaseHead from "../components/BaseHead.astro";
|
||||
import Header from "../components/Header.astro";
|
||||
import { SITE_TITLE, SITE_DESCRIPTION } from "../consts";
|
||||
|
||||
import {
|
||||
SiGithub,
|
||||
SiLinkedin,
|
||||
SiNextdotjs,
|
||||
SiPrisma,
|
||||
SiSpotify,
|
||||
SiTwitch,
|
||||
SiTwitter,
|
||||
SiYoutube,
|
||||
SiAstro,
|
||||
SiSvelte,
|
||||
SiPostgresql,
|
||||
SiRedis,
|
||||
SiRailway,
|
||||
} from "react-icons/si";
|
||||
---
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" data-theme="night">
|
||||
<head>
|
||||
<BaseHead title={SITE_TITLE} description={SITE_DESCRIPTION} />
|
||||
</head>
|
||||
<body class="block h-[100%]">
|
||||
<Header title={SITE_TITLE} />
|
||||
<main
|
||||
class="container flex flex-col items-center justify-center gap-3 sm:gap-6 px-4 py-16 text-center mx-auto min-h-[calc(100%-64px)]"
|
||||
>
|
||||
<h1 class="text-4xl font-extrabold text-white sm:text-8xl">
|
||||
Hi, I'm <span class="text-pink-500">Atridad</span>
|
||||
</h1>
|
||||
|
||||
<h2
|
||||
class="text-2xl font-extrabold tracking-tight text-white sm:text-[2rem]"
|
||||
>
|
||||
I'm a <span class="text-green-500">persian</span> -
|
||||
<span class="text-red-500">canadian</span>{" "}
|
||||
<span
|
||||
class="bg-gradient-to-r from-pink-500 to-blue-500 bg-clip-text text-transparent"
|
||||
>
|
||||
queer
|
||||
</span>{" "}
|
||||
software developer who loves making things for the web.
|
||||
</h2>
|
||||
|
||||
<h2
|
||||
class="text-xl font-extrabold tracking-tight text-white sm:text-[1.5rem]"
|
||||
>
|
||||
Pronouns: (he/<span class="text-pink-500">they</span>)
|
||||
</h2>
|
||||
|
||||
<span>
|
||||
<h2 class="mb-2 text-xl text-white sm:text-[1.5rem]">
|
||||
Places I exist:
|
||||
</h2>
|
||||
<div
|
||||
class="flex flex-row flex-wrap items-center justify-center gap-4 text-center"
|
||||
>
|
||||
<a
|
||||
href={"https://www.linkedin.com/in/atridad/"}
|
||||
target="_blank"
|
||||
aria-label="Linkedin"
|
||||
>
|
||||
<SiLinkedin className="text-2xl hover:text-pink-500 sm:text-4xl" />
|
||||
</a>
|
||||
<a
|
||||
href={"https://twitter.com/atridadl/"}
|
||||
target="_blank"
|
||||
aria-label="Twitter"
|
||||
>
|
||||
<SiTwitter className="text-2xl hover:text-pink-500 sm:text-4xl" />
|
||||
</a>
|
||||
<a
|
||||
href={"https://github.com/atridadl"}
|
||||
target="_blank"
|
||||
aria-label="Github"
|
||||
>
|
||||
<SiGithub className="text-2xl hover:text-pink-500 sm:text-4xl" />
|
||||
</a>
|
||||
<a
|
||||
href={"https://open.spotify.com/user/31v3p4oq6im7fvpqhhbju222pbr4?si=d75830b95ed94d4f"}
|
||||
target="_blank"
|
||||
aria-label="Spotify"
|
||||
>
|
||||
<SiSpotify className="text-2xl hover:text-pink-500 sm:text-4xl" />
|
||||
</a>
|
||||
<a
|
||||
href={"https://www.twitch.tv/himbothyswaggins"}
|
||||
target="_blank"
|
||||
aria-label="Twitch.tv"
|
||||
>
|
||||
<SiTwitch className="text-2xl hover:text-pink-500 sm:text-4xl" />
|
||||
</a>
|
||||
<a
|
||||
href={"https://www.youtube.com/@himbothyswaggins"}
|
||||
target="_blank"
|
||||
aria-label="YouTube"
|
||||
>
|
||||
<SiYoutube className="text-2xl hover:text-pink-500 sm:text-4xl" />
|
||||
</a>
|
||||
</div>
|
||||
</span>
|
||||
|
||||
<span>
|
||||
<h2 class="mb-2 text-xl text-white sm:text-[1.5rem]">Stuff I use:</h2>
|
||||
<div
|
||||
class="flex flex-row flex-wrap items-center justify-center gap-4 text-center"
|
||||
>
|
||||
<a href={"https://nextjs.org/"} target="_blank" aria-label="Next.js">
|
||||
<SiNextdotjs className="text-2xl hover:text-pink-500 sm:text-4xl" />
|
||||
</a>
|
||||
|
||||
<a href={"https://astro.build/"} target="_blank" aria-label="Astro">
|
||||
<SiAstro className="text-2xl hover:text-pink-500 sm:text-4xl" />
|
||||
</a>
|
||||
|
||||
<a
|
||||
href={"https://kit.svelte.dev/"}
|
||||
target="_blank"
|
||||
aria-label="SvelteKit"
|
||||
>
|
||||
<SiSvelte className="text-2xl hover:text-pink-500 sm:text-4xl" />
|
||||
</a>
|
||||
|
||||
<a
|
||||
href={"https://www.prisma.io/"}
|
||||
target="_blank"
|
||||
aria-label="Prisma"
|
||||
>
|
||||
<SiPrisma className="text-2xl hover:text-pink-500 sm:text-4xl" />
|
||||
</a>
|
||||
|
||||
<a
|
||||
href={"https://www.postgresql.org/"}
|
||||
target="_blank"
|
||||
aria-label="PostgreSQL"
|
||||
>
|
||||
<SiPostgresql
|
||||
className="text-2xl hover:text-pink-500 sm:text-4xl"
|
||||
/>
|
||||
</a>
|
||||
|
||||
<a href={"https://redis.io/"} target="_blank" aria-label="Redis">
|
||||
<SiRedis className="text-2xl hover:text-pink-500 sm:text-4xl" />
|
||||
</a>
|
||||
|
||||
<a href={"https://railway.app/"} target="_blank" aria-label="Railway">
|
||||
<SiRailway className="text-2xl hover:text-pink-500 sm:text-4xl" />
|
||||
</a>
|
||||
</div>
|
||||
</span>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
16
src/pages/rss.xml.js
Normal file
16
src/pages/rss.xml.js
Normal file
@ -0,0 +1,16 @@
|
||||
import rss from '@astrojs/rss';
|
||||
import { getCollection } from 'astro:content';
|
||||
import { SITE_TITLE, SITE_DESCRIPTION } from '../consts';
|
||||
|
||||
export async function get(context) {
|
||||
const posts = await getCollection('blog');
|
||||
return rss({
|
||||
title: SITE_TITLE,
|
||||
description: SITE_DESCRIPTION,
|
||||
site: context.site,
|
||||
items: posts.map((post) => ({
|
||||
...post.data,
|
||||
link: `/blog/${post.slug}/`,
|
||||
})),
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user