diff --git a/src/components/LeetCodeDifficulty.astro b/src/components/LeetCodeDifficulty.astro index 19f6908a..0140e876 100644 --- a/src/components/LeetCodeDifficulty.astro +++ b/src/components/LeetCodeDifficulty.astro @@ -37,7 +37,7 @@ const getDifficultyCssClass: (difficulty: string) => string = ( @apply border-2; @apply border-difficulty-#{$difficulty}; @apply text-difficulty-#{$difficulty}; - @apply hover:bg-transparent; + @apply hover:bg-site-bg; @apply hover:border-difficulty-#{$difficulty}-hover; @apply hover:text-difficulty-#{$difficulty}-hover; } diff --git a/src/components/post/PostHeader.astro b/src/components/post/PostHeader.astro new file mode 100644 index 00000000..26604aa9 --- /dev/null +++ b/src/components/post/PostHeader.astro @@ -0,0 +1,52 @@ +--- +import type { CollectionEntry } from 'astro:content' +import kebabCase from 'lodash.kebabcase' + +import LeetCodeDifficulty from '@/components/LeetCodeDifficulty.astro' +import siteConfig from '@/configs/site' +import { formatDate } from '@/utils/date' + +type Props = CollectionEntry<'leetcode-solutions'>['data'] + +const { author: siteAuthor } = siteConfig +const { title, author, pubDate, tags = [], difficulty } = Astro.props + +const formattedDate = formatDate(pubDate) +--- + +