feat: book tags

This commit is contained in:
Cory Dransfeldt 2024-04-20 13:36:20 -07:00
parent f32ae93be5
commit fdee04494b
No known key found for this signature in database
3 changed files with 9 additions and 6 deletions

View file

@ -61,7 +61,7 @@ export const tagMap = (collection) => {
if (tagString) tags[url] = tagString.replace(/\s+/g,' ') if (tagString) tags[url] = tagString.replace(/\s+/g,' ')
}) })
} }
if (links) { if (links) {
links.forEach((link) => { links.forEach((link) => {
const url = link.data.link const url = link.data.link
@ -71,17 +71,16 @@ export const tagMap = (collection) => {
if (tagString) tags[url] = tagString.replace(/\s+/g,' ') if (tagString) tags[url] = tagString.replace(/\s+/g,' ')
}) })
} }
if (books) { if (books) {
books.forEach((book) => { books.forEach((book) => {
const tagString = book.['tags']? const tagString = book['tags']?.map((tag) => tagAliases[tag.toLowerCase()])
.map((tag) => tagAliases[tag.toLowerCase()])
.join(' ') .join(' ')
.trim() .trim()
if (tagString) tags[book.url] = tagString.replace(/\s+/g,' ') if (tagString) tags[book.url] = tagString.replace(/\s+/g,' ')
}) })
} }
return tags return tags
} }

View file

@ -14,6 +14,7 @@ export default {
email: '#Email', email: '#Email',
emo: '#Emo', emo: '#Emo',
fastmail: '#Email', fastmail: '#Email',
fiction: '#Fiction',
gmail: '#Email', gmail: '#Email',
grindcore: '#Grindcore', grindcore: '#Grindcore',
health: '#Health', health: '#Health',
@ -28,6 +29,7 @@ export default {
mastodon: '#Mastodon', mastodon: '#Mastodon',
music: '#Music', music: '#Music',
nonfiction: '#NonFiction', nonfiction: '#NonFiction',
politics: '#Politics',
privacy: '#Privacy', privacy: '#Privacy',
productivity: '#Productivity', productivity: '#Productivity',
react: '#JavaScript', react: '#JavaScript',
@ -39,6 +41,8 @@ export default {
'surveillance capitalism': '#SurveillanceCapitalism', 'surveillance capitalism': '#SurveillanceCapitalism',
'tattoos': '#Tattoos', 'tattoos': '#Tattoos',
tech: '#Tech', tech: '#Tech',
television: '#TV',
technology: '#Tech', technology: '#Tech',
tv: '#TV',
'web components': '#WebComponents' 'web components': '#WebComponents'
} }

View file

@ -1,6 +1,6 @@
{ {
"name": "coryd.dev", "name": "coryd.dev",
"version": "12.2.10", "version": "12.3.0",
"description": "The source for my personal site. Built using 11ty.", "description": "The source for my personal site. Built using 11ty.",
"type": "module", "type": "module",
"scripts": { "scripts": {