Add yazzy link

This commit is contained in:
Carter McBride 2024-08-23 14:39:29 -06:00
parent 640a8d56fd
commit 1d1b19b336
2 changed files with 39 additions and 29 deletions

View file

@ -19,6 +19,8 @@ const categories = [
).sort(), ).sort(),
]; ];
const yazzyUrl = import.meta.env.YAZZY_URL;
const categoryCounts = categories.reduce((acc, category) => { const categoryCounts = categories.reduce((acc, category) => {
if (category === "All") { if (category === "All") {
acc[category] = feedItems.contents.length; acc[category] = feedItems.contents.length;
@ -125,11 +127,6 @@ const categoriesSelectorCss = categories
> >
<h1 class="">Carter's RSS Feeds</h1> <h1 class="">Carter's RSS Feeds</h1>
<hr class="flex-grow h-px border-0 border-b-2 border-b-stone-500" /> <hr class="flex-grow h-px border-0 border-b-2 border-b-stone-500" />
<p>
{recentCount} recent item(s) | {feedItems.contents.length} item(s) | {
feedItems.errors.length
} error(s)
</p>
</header> </header>
<nav <nav
id="category-picker" id="category-picker"
@ -172,12 +169,6 @@ const categoriesSelectorCss = categories
{ {
"Recent-item": isRecent(item.pubIsoDate), "Recent-item": isRecent(item.pubIsoDate),
}, },
"flex flex-row gap-4 items-center",
]}
>
<a
href={item.link}
class:list={[
"w-full", "w-full",
"border-l-8", "border-l-8",
categoryColors[item.category].bl, categoryColors[item.category].bl,
@ -185,20 +176,37 @@ const categoriesSelectorCss = categories
"transition-all", "transition-all",
"active:bg-orange-300 dark:active:bg-slate-500", "active:bg-orange-300 dark:active:bg-slate-500",
"bg-orange-100 dark:bg-slate-700", "bg-orange-100 dark:bg-slate-700",
"visited:opacity-50",
"py-1 px-2", "py-1 px-2",
"rounded-xl", "rounded-xl",
]} ]}
> >
<div set:html={item.title} class="underline" /> <a
href={item.link}
rel="noopener noreferrer"
target="_blank"
set:html={item.title}
class="underline block"
/>
<div class="no-underline text-sm font-normal"> <div class="no-underline text-sm font-normal">
{[ <span>{new Date(item.pubIsoDate).toDateString()}</span>
new Date(item.pubIsoDate).toDateString(), <span>|</span>
item.feedName, <span>{item.feedName}</span>
item.category, <span>|</span>
].join(" | ")} <span>{item.category}</span>
</div> {Boolean(yazzyUrl) ? (
<>
<span>|</span>
<a
href={`${yazzyUrl}/${item.link}`}
class="underline"
target="_blank"
rel="noopener noreferrer"
>
yazzy
</a> </a>
</>
) : null}
</div>
</li> </li>
)) ))
} }
@ -220,6 +228,8 @@ const categoriesSelectorCss = categories
<li> <li>
<a <a
href="https://github.com/carterworks/rss-reader" href="https://github.com/carterworks/rss-reader"
target="_blank"
rel="noopener noreferrer"
class="underline cursor-pointer">Github</a class="underline cursor-pointer">Github</a
> >
</li> </li>

View file

@ -208,7 +208,7 @@ export default {
"'Segoe UI Symbol'", "'Segoe UI Symbol'",
"'Noto Color Emoji'", "'Noto Color Emoji'",
], ],
} },
}, },
}, },
}; };