added github link support

This commit is contained in:
Oliver Bryan
2025-09-28 22:03:39 +01:00
parent 364fea5904
commit fd3c92caef
3 changed files with 48 additions and 1 deletions

View File

@@ -9,6 +9,7 @@ export interface Props {
slug: string;
image?: string | null;
url?: string;
github?: string;
hidden: boolean;
};
}
@@ -30,6 +31,15 @@ const { metadata } = Astro.props;
color: var(--ayu-blue-600);
border-color: var(--ayu-blue-600);
}
.github {
color: var(--ayu-green-500);
border: none;
}
.github:hover {
color: var(--ayu-green-500);
text-decoration: underline;
}
</style>
<Layout
@@ -54,7 +64,26 @@ const { metadata } = Astro.props;
<div class="w-24 h-24 mb-4 border border-ayu-gutter rounded" />
)
}
<p class="text-sm text-ayu-gutter mb-2">{metadata.date}</p>
<p class="text-sm text-ayu-gutter mb-2">
{metadata.date}
{
metadata.github && (
<>
{" "}
-{" "}
<a
href={metadata.github}
target="_blank"
rel="noopener noreferrer"
class="github"
>
GitHub
</a>
</>
)
}
</p>
{
metadata.url ? (
@@ -73,6 +102,22 @@ const { metadata } = Astro.props;
<p class="text-center text-md text-ayu-gutter mt-8 mb-4">
projects/{metadata.slug} - {metadata.date}
{
metadata.github && (
<>
{" "}
-{" "}
<a
href={metadata.github}
target="_blank"
rel="noopener noreferrer"
class="github"
>
GitHub
</a>
</>
)
}
</p>
</div>
</Layout>

View File

@@ -9,6 +9,7 @@ export const metadata = {
slug: "glimpse",
image: "/glimpse-icon.svg",
url: "https://glimpse.ob248.com",
github: "https://github.com/hex248/glimpse",
hidden: false,
};
---

View File

@@ -8,6 +8,7 @@ export const metadata = {
slug: "wiskatron",
image: "/wiskatron-icon.svg",
url: "https://wiskatron.oliverbryan.com",
github: "https://github.com/hex248/wiskatron",
hidden: false,
};
---