feat: add tags to shared content
This commit is contained in:
parent
64e434c6b9
commit
7216b848f4
8 changed files with 84 additions and 10 deletions
32
src/_data/json/tag-aliases.json
Normal file
32
src/_data/json/tag-aliases.json
Normal file
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"tags": [
|
||||
{
|
||||
"tag": "Eleventy",
|
||||
"aliases": ["11ty", "eleventy"]
|
||||
},
|
||||
{
|
||||
"tag": "WebDev",
|
||||
"aliases": [
|
||||
"development",
|
||||
"javascript",
|
||||
"react",
|
||||
"nextjs",
|
||||
"gatsby",
|
||||
"vue",
|
||||
"svelte",
|
||||
"angular",
|
||||
"webdev",
|
||||
"web-development",
|
||||
"web-development"
|
||||
]
|
||||
},
|
||||
{
|
||||
"tag": "Tech",
|
||||
"aliases": ["technology", "tech"]
|
||||
},
|
||||
{
|
||||
"tag": "Music",
|
||||
"aliases": ["music"]
|
||||
}
|
||||
]
|
||||
}
|
|
@ -13,10 +13,6 @@ module.exports = async function () {
|
|||
const articles = feed.feed
|
||||
return articles.reverse().map((article) => {
|
||||
const tags = article['content']['tags'].map((tag) => tag['name'])
|
||||
const shareTags = tags
|
||||
.map((tag) => `#${tag}`)
|
||||
.join(' ')
|
||||
.trim()
|
||||
return {
|
||||
url: article['content']['url'],
|
||||
title: article['content']['title'],
|
||||
|
@ -24,9 +20,8 @@ module.exports = async function () {
|
|||
? new Date(article['content']['library']['modified_date'])
|
||||
: new Date(article['content']['publication_date']),
|
||||
description: article['content']['excerpt'],
|
||||
notes: article['content']['my_notes'],
|
||||
notes: article['content']['my_notes'] || '',
|
||||
tags,
|
||||
shareTags,
|
||||
id: btoa(article['id']),
|
||||
}
|
||||
})
|
||||
|
|
Reference in a new issue