From fdee04494b09241f7545c3a687adfabe8a5ef2c6 Mon Sep 17 00:00:00 2001 From: Cory Dransfeldt Date: Sat, 20 Apr 2024 13:36:20 -0700 Subject: [PATCH] feat: book tags --- config/collections/index.js | 9 ++++----- config/data/tag-aliases.js | 4 ++++ package.json | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/config/collections/index.js b/config/collections/index.js index cf592751..95755658 100644 --- a/config/collections/index.js +++ b/config/collections/index.js @@ -61,7 +61,7 @@ export const tagMap = (collection) => { if (tagString) tags[url] = tagString.replace(/\s+/g,' ') }) } - + if (links) { links.forEach((link) => { const url = link.data.link @@ -71,17 +71,16 @@ export const tagMap = (collection) => { if (tagString) tags[url] = tagString.replace(/\s+/g,' ') }) } - + if (books) { books.forEach((book) => { - const tagString = book.['tags']? - .map((tag) => tagAliases[tag.toLowerCase()]) + const tagString = book['tags']?.map((tag) => tagAliases[tag.toLowerCase()]) .join(' ') .trim() if (tagString) tags[book.url] = tagString.replace(/\s+/g,' ') }) } - + return tags } diff --git a/config/data/tag-aliases.js b/config/data/tag-aliases.js index b2ba16a9..22f66cf4 100644 --- a/config/data/tag-aliases.js +++ b/config/data/tag-aliases.js @@ -14,6 +14,7 @@ export default { email: '#Email', emo: '#Emo', fastmail: '#Email', + fiction: '#Fiction', gmail: '#Email', grindcore: '#Grindcore', health: '#Health', @@ -28,6 +29,7 @@ export default { mastodon: '#Mastodon', music: '#Music', nonfiction: '#NonFiction', + politics: '#Politics', privacy: '#Privacy', productivity: '#Productivity', react: '#JavaScript', @@ -39,6 +41,8 @@ export default { 'surveillance capitalism': '#SurveillanceCapitalism', 'tattoos': '#Tattoos', tech: '#Tech', + television: '#TV', technology: '#Tech', + tv: '#TV', 'web components': '#WebComponents' } \ No newline at end of file diff --git a/package.json b/package.json index bebdd4dd..4f88c981 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "coryd.dev", - "version": "12.2.10", + "version": "12.3.0", "description": "The source for my personal site. Built using 11ty.", "type": "module", "scripts": {