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

View File

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

View File

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