feat: movie tags

This commit is contained in:
Cory Dransfeldt 2024-04-20 14:05:40 -07:00
parent 4132c92186
commit 5bc0c97537
No known key found for this signature in database
6 changed files with 21 additions and 7 deletions

View file

@ -51,6 +51,7 @@ export const tagMap = (collection) => {
const posts = collectionData.data.collections.posts
const links = collectionData.data.collections.links
const books = collectionData.data.books
const movies = collectionData.data.movies
if (posts) {
posts.forEach((post) => {
@ -81,6 +82,15 @@ export const tagMap = (collection) => {
})
}
if (movies) {
movies.forEach((movie) => {
const tagString = movie['tags']?.map((tag) => tagAliases[tag.toLowerCase()])
.join(' ')
.trim()
if (tagString) tags[movie.url] = tagString.replace(/\s+/g,' ')
})
}
return tags
}