import { cache, reader } from '@/lib/content/base'

export const getTags = cache(async () => reader.collections['tags'].all())

export const getTagBySlug = cache(async (slug: string) => {
  const tag = await reader.collections.tags.read(slug)
  return tag ? { ...tag, slug } : null
})
