feat: movie tags
This commit is contained in:
parent
4132c92186
commit
5bc0c97537
6 changed files with 21 additions and 7 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
export default {
|
||||
'11ty': '#Eleventy',
|
||||
accessibility: '#Accessibility',
|
||||
action: '#Action',
|
||||
adventure: '#Adventure',
|
||||
ai: '#AI',
|
||||
'black metal': '#BlackMetal',
|
||||
blogging: '#Blogging',
|
||||
|
@ -19,6 +21,7 @@ export default {
|
|||
grindcore: '#Grindcore',
|
||||
health: '#Health',
|
||||
'indie web': '#IndieWeb #SmallWeb',
|
||||
'horror': '#Horror',
|
||||
ios: '#iOS #Apple',
|
||||
javascript: '#JavaScript',
|
||||
'last.fm': '#Music',
|
||||
|
@ -36,6 +39,7 @@ export default {
|
|||
rss: '#RSS',
|
||||
shoegaze: '#Shoegaze',
|
||||
scifi: '#SciFi',
|
||||
'science-fiction': '#SciFi',
|
||||
'social media': '#SocialMedia',
|
||||
spotify: '#Music',
|
||||
'surveillance capitalism': '#SurveillanceCapitalism',
|
||||
|
@ -43,6 +47,7 @@ export default {
|
|||
tech: '#Tech',
|
||||
television: '#TV',
|
||||
technology: '#Tech',
|
||||
thriller: '#Thriller',
|
||||
tv: '#TV',
|
||||
'web components': '#WebComponents'
|
||||
}
|
|
@ -60,11 +60,11 @@ export default {
|
|||
return visitors(b) - visitors(a)
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
tagLookup: (url, tagMap) => {
|
||||
if (!url) return
|
||||
if (url.includes('openlibrary.org')) return `#Books #NowReading ${tagMap[url]}`
|
||||
if (url.includes('trakt.tv')) return '#Movies #Watching #Trakt'
|
||||
if (url.includes('openlibrary.org')) return `#Books #NowReading ${tagMap[url]}`.trim()
|
||||
if (url.includes('trakt.tv')) return `#Movies #Watching ${tagMap[url]}`.trim()
|
||||
return tagMap[url] || ''
|
||||
},
|
||||
|
||||
|
|
Reference in a new issue