diff --git a/src/components/Footer.astro b/src/components/Footer.astro index b169767..564c2aa 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -13,4 +13,7 @@ interface Props {}
+ + diff --git a/src/components/Header.astro b/src/components/Header.astro index aeaf1ec..26686ad 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -6,6 +6,12 @@ const { pathname } = Astro.url; interface Props {} +interface NavLink { + label: string; + icon: string; + path: string; +} + const navLinks: NavLink[] = [ { label: 'Blog', icon: 'pen', path: '/' }, { label: 'About', icon: 'person', path: '/about/' }, diff --git a/src/content/config.ts b/src/content/config.ts index aefa827..2777fa4 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -1,11 +1,10 @@ import { z, defineCollection } from 'astro:content'; -import { Tag } from 'src/types'; const blogCollection = defineCollection({ schema: z.object({ title: z.string(), pubDate: z.string().transform((str: string) => new Date(str)), - tags: z.array(z.nativeEnum(Tag)), + tags: z.array(z.string()), }), }); diff --git a/src/pages/archive/[tag].astro b/src/pages/archive/[tag].astro index 255798d..030e2fc 100644 --- a/src/pages/archive/[tag].astro +++ b/src/pages/archive/[tag].astro @@ -1,20 +1,19 @@ --- import { format, add } from 'date-fns'; import { getCollection } from 'astro:content'; -import { Tag as TagEnum } from '../../types'; import Layout from '@layouts/Layout.astro'; export const prerender = false; -const { tag }: { tag?: TagEnum } = Astro.params; +const { tag }: { tag?: string } = Astro.params; const posts = await getCollection('blog', ({ data }) => { if (!tag) { return false; } - if (tag === TagEnum.all) { + if (tag === 'all') { return true; } diff --git a/src/types.ts b/src/types.ts deleted file mode 100644 index 71f5e5f..0000000 --- a/src/types.ts +++ /dev/null @@ -1,26 +0,0 @@ -// navigation links -export type NavLink = { - label: string; - icon: string; - path: string; -}; - -// blog tags -export enum Tag { - 'Apps' = 'Apps', - 'Digital Life' = 'Digital Life', - 'Gaming' = 'Gaming', - 'Learning' = 'Learning', - 'Life' = 'Life', - 'MacOS' = 'MacOS', - 'Music' = 'Music', - 'Making Stuff' = 'Making Stuff', - 'Mental Health' = 'Mental Health', - 'Movies & TV' = 'Movies & TV', - 'Programming' = 'Programming', - 'Tech' = 'Tech', - 'Tutorial' = 'Tutorial', - 'Web Dev' = 'Web Dev', - // only for filtering - all = 'all', -}