From f48610a9c6a551df5e83135f3bcd288fa290f483 Mon Sep 17 00:00:00 2001
From: Cory Dransfeldt <hi@coryd.dev>
Date: Sat, 20 Apr 2024 12:19:35 -0700
Subject: [PATCH] fix: link data

---
 config/collections/index.js | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/config/collections/index.js b/config/collections/index.js
index 119e86d7..df991c90 100644
--- a/config/collections/index.js
+++ b/config/collections/index.js
@@ -49,7 +49,7 @@ export const tagMap = (collection) => {
   const tags = {}
   const collectionData = collection.getAll()[0]
   const posts = collectionData.data.collections.posts
-  const links = collectionData.data.links
+  const links = collectionData.data.collections.links
   if (posts) {
     posts.forEach((post) => {
       const url = post.url.includes('http') ? post.url : `https://coryd.dev${post.url}`
@@ -58,6 +58,13 @@ export const tagMap = (collection) => {
         .trim()
       if (tagString) tags[url] = tagString.replace(/\s+/g,' ')
     })
+    links.forEach((link) => {
+      const url = link.data.link
+      const tagString = [...new Set(link.data.tags.map((tag) => tagAliases[tag.toLowerCase()]))]
+        .join(' ')
+        .trim()
+      if (tagString) tags[url] = tagString.replace(/\s+/g,' ')
+    })
   }
   return tags
 }