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 (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
}