--- import { formatDate } from "@lib/formatDate"; import readingTime from "@lib/readingTime"; import { lowerHumanize, upperHumanize, markdownify, slugify, } from "@lib/textConverter"; import { Image } from "astro:assets"; import { FaRegCalendarAlt, FaRegFolder, FaRegUserCircle, FaHashtag, FaRegClock, } from "react-icons/fa"; import type { GenericEntry, EntryReference } from "@/types"; interface EntryData { title: string; image?: string; imageAlt?: string; author?: EntryReference; date?: string; pubDate?: string; modDate?: string; categories?: string[]; tags?: string[]; complexity?: number; } interface Props { entry: GenericEntry; showInfo?: boolean; showImage?: boolean; showTitle?: boolean; showAuthor?: boolean; showDate?: boolean; showPubDate?: boolean; showModDate?: boolean; showReadingTime?: boolean; showCategories?: boolean; showTags?: boolean; } const { entry, showInfo = true, showImage = false, showAuthor = false, showDate = false, showPubDate = false, showModDate = false, showReadingTime = false, showCategories = false, showTags = false, }: Props = Astro.props; const { title, author, categories, tags, image, imageAlt, date, pubDate, modDate, complexity, } = entry.data as EntryData; categories?.sort((a: string, b: string) => a.localeCompare(b)); tags?.sort((a: string, b: string) => a.localeCompare(b)); ---
{ image && showImage && (
{imageAlt
) } { showInfo && (

    {author && showAuthor && (
  • {upperHumanize(author.id)}
  • )} {date && showDate && (
  • {formatDate(date)}
  • )} {pubDate && showPubDate && (
  • Published {formatDate(pubDate)}
  • )} {modDate && showModDate && (
  • Updated {formatDate(modDate)}
  • )} {complexity && complexity > 0 && showReadingTime && (
  • {readingTime(entry.body!, complexity)}
  • )} {categories && showCategories && (
  • {categories.map((category: string, index: number) => ( {upperHumanize(category)} ))}
  • )} {tags && showTags && (
  • {tags.map((tag: string, index: number) => ( {lowerHumanize(tag)} ))}
  • )}

) }