32 lines
847 B
Text
32 lines
847 B
Text
---
|
|
import { getCollection } from "astro:content";
|
|
import PostLayout from "../../layouts/PostLayout.astro";
|
|
|
|
export async function getStaticPaths() {
|
|
const repos = await getCollection("git");
|
|
return repos.map((repo) => ({
|
|
params: { slug: repo.slug },
|
|
props: { repo },
|
|
}));
|
|
}
|
|
|
|
const { repo } = Astro.props;
|
|
const { Content } = await repo.render();
|
|
const cloneCommand = `git clone https://git.barrettruth.com/${repo.slug}.git`;
|
|
const githubUrl = `https://github.com/barrett-ruth/${repo.slug}`;
|
|
---
|
|
|
|
<PostLayout frontmatter={repo.data} post={repo}>
|
|
<Fragment slot="head">
|
|
<link rel="stylesheet" href="/styles/git.css" />
|
|
</Fragment>
|
|
|
|
<div class="clone-line">
|
|
<code><span class="prompt">> </span>{cloneCommand}</code>
|
|
</div>
|
|
|
|
<br />
|
|
<div><a href={githubUrl}>source code</a></div>
|
|
|
|
<Content />
|
|
</PostLayout>
|