feat: add tags to shared content

This commit is contained in:
Cory Dransfeldt 2023-09-08 12:42:44 -07:00
parent 64e434c6b9
commit 7216b848f4
No known key found for this signature in database
8 changed files with 84 additions and 10 deletions

View 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"]
}
]
}

View file

@ -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']),
}
})

View file

@ -8,7 +8,7 @@
"items": [{% for entry in entries limit: 20 -%}
{
"id": "{{ entry.url | btoa }}",
"title": "{{ entry.title | escape }}{% if share %}{{ entry.shareTags }}{%endif%}",
"title": "{{ entry.title | escape }}{% if tagMap %} {{ entry.url | tagLookup: tagMap }}{% endif %}",
"url": "{{ entry.url }}",
"content_text": "{{ entry.title }} {{ entry.url }}",
"date_published": "{{ entry.date | stringToDate | dateToRfc822 }}"

View file

@ -8,5 +8,5 @@ permalink: /feeds/share-follow.json
data:follow.posts
updated:follow.posts[0].date_published
site:site
share:true
tagMap:collections.tagMap
%}

View file

@ -17,7 +17,6 @@ meta:
image:
src: https://coryd.dev/assets/img/avatar.webp
---
{% for tag in collections.tagList %}
<span>
<a href="/tags/{{ tag }}" class="!no-underline">