aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2024-01-26 09:11:44 -0500
committerAndrew Lee <alee14498@protonmail.com>2024-01-26 09:12:10 -0500
commit126e0c277881b16675d43b663ce8d95b51e93ea4 (patch)
treeaa6bf4418f3c4cfbcef00afb4c1d97cf046e6645
parent9df6f5038cdaa5fdb6a037c4999d974ba9f84c00 (diff)
downloadpersonal-website-126e0c277881b16675d43b663ce8d95b51e93ea4.tar.gz
personal-website-126e0c277881b16675d43b663ce8d95b51e93ea4.tar.bz2
personal-website-126e0c277881b16675d43b663ce8d95b51e93ea4.zip
Upgraded Astro and added tags
-rwxr-xr-xbun.lockbbin286413 -> 281472 bytes
-rw-r--r--package.json4
-rw-r--r--src/pages/blog/tags/[tag].astro28
3 files changed, 30 insertions, 2 deletions
diff --git a/bun.lockb b/bun.lockb
index 63d80f6..c2e9010 100755
--- a/bun.lockb
+++ b/bun.lockb
Binary files differ
diff --git a/package.json b/package.json
index 4d62368..3c8f80c 100644
--- a/package.json
+++ b/package.json
@@ -11,11 +11,11 @@
},
"dependencies": {
"@astrojs/rss": "^4.0.3",
- "@astrojs/vercel": "^6.1.3",
+ "@astrojs/vercel": "7.0.1",
"@astrojs/vue": "^4.0.8",
"@iconify-json/fa6-brands": "^1.1.18",
"@vitejs/plugin-vue": "^5.0.3",
- "astro": "^4.1.1",
+ "astro": "4.2.4",
"astro-icon": "^1.0.2",
"markdown-it": "^14.0.0",
"sanitize-html": "^2.11.0",
diff --git a/src/pages/blog/tags/[tag].astro b/src/pages/blog/tags/[tag].astro
new file mode 100644
index 0000000..8885cfa
--- /dev/null
+++ b/src/pages/blog/tags/[tag].astro
@@ -0,0 +1,28 @@
+---
+import Page from '../../../layouts/Page.astro';
+
+export async function getStaticPaths() {
+ const allPosts = await Astro.glob('../../../content/blog/*.md');
+ const uniqueTags = [...new Set(allPosts.map((post) => post.frontmatter.tags).flat())];
+
+ return uniqueTags.map((tag) => {
+ const filteredPosts = allPosts.filter((post) => post.frontmatter.tags.includes(tag));
+ return {
+ params: { tag },
+ props: { posts: filteredPosts },
+ };
+ });
+}
+
+const { tag } = Astro.params;
+const { posts } = Astro.props;
+---
+<Page title={tag}>
+ {posts.map((post) => {
+ return (
+ <div>
+ <a href={post.url}>{post.frontmatter.title}</a>
+ </div>
+ )
+ })}
+</Page>