diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro
index 0601f50..e01a9db 100644
--- a/src/layouts/BaseLayout.astro
+++ b/src/layouts/BaseLayout.astro
@@ -28,7 +28,8 @@ const {
- )
- }
-
+
+
-
-
+
+
- {frontmatter.scripts?.map(script => (
-
- ))}
-
+ {frontmatter.scripts?.map((src) => )}
+
+
diff --git a/src/pages/[category]/[slug].astro b/src/pages/[category]/[slug].astro
index b390e12..7a3a8de 100644
--- a/src/pages/[category]/[slug].astro
+++ b/src/pages/[category]/[slug].astro
@@ -24,7 +24,7 @@ const pageTitle = `${category}/${post.data.title ?? post.slug}`;
const { Content } = await post.render();
---
-
+
{pageTitle}
diff --git a/src/pages/[category]/index.astro b/src/pages/[category]/index.astro
index cf66840..436b469 100644
--- a/src/pages/[category]/index.astro
+++ b/src/pages/[category]/index.astro
@@ -2,12 +2,6 @@
import BaseLayout from "../../layouts/BaseLayout.astro";
import { getCollection } from "astro:content";
-export async function getStaticPaths() {
- const posts = await getCollection("posts");
- const categories = Array.from(new Set(posts.map((p) => p.id.split("/")[0])));
- return categories.map((category) => ({ params: { category } }));
-}
-
const category = Astro.params.category;
const title = "Barrett Ruth";
diff --git a/src/pages/git/[slug].astro b/src/pages/git/[slug].astro
index 0a4de12..460fea0 100644
--- a/src/pages/git/[slug].astro
+++ b/src/pages/git/[slug].astro
@@ -1,43 +1,24 @@
---
-import { getEntry } from "astro:content";
-import GitLayout from "../../layouts/GitLayout.astro";
+import { getCollection } from "astro:content";
+import PostLayout from "../../layouts/PostLayout.astro";
export async function getStaticPaths() {
- const res = await fetch("https://git.barrettruth.com/api/repositories");
- const json = res.ok ? await res.json() : { repositories: [] };
- const repos = (json.repositories || []).map((r) => r.replace(/\.git$/, ""));
- return repos.map((slug) => ({ params: { slug } }));
+ const repos = await getCollection("git");
+ return repos.map((repo) => ({
+ params: { slug: repo.slug },
+ props: { repo },
+ }));
}
-const { slug } = Astro.params;
-const entry = await getEntry("git", slug);
-if (!entry) return Astro.redirect("/404");
-
-const { Content } = await entry.render();
-
-const repoName = `${slug}.git`;
-let cloneCommand = "";
-try {
- const res = await fetch("https://git.barrettruth.com/api/repositories");
- const json = res.ok ? await res.json() : { repositories: [] };
- const exists = json.repositories?.includes(repoName);
- if (exists)
- cloneCommand = `git clone https://git.barrettruth.com/${repoName}`;
-} catch {}
-
-const pageTitle = `git/${entry.data.title ?? slug}`;
+const { repo } = Astro.props;
+const { Content } = await repo.render();
+const pageTitle = `git/${repo.data.title ?? repo.slug}`;
---
-
+
{pageTitle}
+
- {
- cloneCommand && (
-
- > {cloneCommand}
-
- )
- }
-
+
diff --git a/src/utils/colors.js b/src/utils/colors.js
index 1ca1177..41631f4 100644
--- a/src/utils/colors.js
+++ b/src/utils/colors.js
@@ -1,4 +1,5 @@
export function getTopicColor(topicName) {
+ console.log(topicName);
switch (topicName) {
case "software":
return "#0073e6";