Refactor RSS button/code

This commit is contained in:
Krem 2025-10-07 19:04:51 +02:00
parent 655d43265f
commit d52f2b02c2
6 changed files with 20 additions and 5 deletions

View File

@ -1,6 +1,5 @@
---
import Social from "@components/common/Social.astro";
import { FiRss } from 'react-icons/fi';
---
<footer class="glass container lg:my-4 lg:rounded-lg intersect:animate-fadeUp opacity-0">
@ -19,13 +18,11 @@ import { FiRss } from 'react-icons/fi';
links={{
//facebook: "https://www.facebook.com/",
github: "https://www.github.com/Kremtastic",
rss: "/rss.xml",
//instagram: "https://www.instagram.com/",
linkedIn: "https://www.linkedin.com/in/kristian-emil-takvam-70a475215/",
}}
/>
<a href="/rss.xml" target="_blank" rel="noopener" class="text-orange-500 hover:text-orange-400">
<FiRss size={24} />
</a>
</div>
</div>

View File

@ -12,6 +12,7 @@ import {
FaTiktok,
FaGlobe,
FaYoutube,
FaRss,
} from "react-icons/fa";
interface Props {
@ -154,6 +155,20 @@ const iconClass =
</a>
</li>
)}
{links.rss && (
<li class={liClass}>
<a
class={iconClass}
aria-label="RSS"
href={links.rss}
target="_blank"
rel="noopener noreferrer nofollow"
>
<span class="sr-only">RSS</span>
<FaRss className="w-6 h-6" />
</a>
</li>
)}
{links.youtube && (
<li class={liClass}>
<a

View File

@ -21,6 +21,7 @@ const social = z.object({
pinterest: z.string().optional(),
tiktok: z.string().optional(),
website: z.string().optional(),
rss: z.string().optional(),
youtube: z.string().optional(),
});

View File

@ -1,7 +1,7 @@
import { getEntry, getCollection, type CollectionKey } from "astro:content";
import type { GenericEntry } from "@/types";
export const getIndex = async (collection: CollectionKey): Promise<GenericEntry> => {
export const getIndex = async (collection: CollectionKey): Promise<GenericEntry | undefined> => {
const index = await getEntry(collection, "-index");
return index;
}

View File

@ -35,6 +35,7 @@ export type SocialLinks = {
tiktok?: string;
website?: string;
youtube?: string;
rss?: string;
}
export type EntryReference = {

1
tsconfig.tsbuildinfo Normal file

File diff suppressed because one or more lines are too long