refactor(blog): improve meta tags styling #76
2 changed files with 24 additions and 23 deletions
|
@ -40,7 +40,7 @@ export default function PostCard({ postData, className }: Props) {
|
|||
))}
|
||||
</TagList>
|
||||
<hr />
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
<div className="flex flex-wrap items-center gap-x-4">
|
||||
<div className="flex items-center gap-2 whitespace-nowrap">
|
||||
<FontAwesomeIcon icon={faCalendar} />
|
||||
{date || "Unknown date"}
|
||||
|
|
|
@ -9,37 +9,38 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
|
|||
|
||||
export default function Meta(props: { fetchedPage: PageData }) {
|
||||
return (
|
||||
<div className="text-light-text-gray dark:text-dark-text-gray">
|
||||
<div className="flex flex-wrap gap-x-4 text-light-text-gray dark:text-dark-text-gray">
|
||||
{/* posts count */}
|
||||
{props.fetchedPage.length > 0 && (
|
||||
<>
|
||||
<div className="flex flex-nowrap items-center gap-2 whitespace-nowrap">
|
||||
<FontAwesomeIcon icon={faFile} />
|
||||
|
||||
{props.fetchedPage.length} post
|
||||
{props.fetchedPage.length > 1 && "s"}{" "}
|
||||
|
||||
</>
|
||||
</div>
|
||||
)}
|
||||
{/* date */}
|
||||
<div className="flex flex-nowrap items-center gap-2 whitespace-nowrap">
|
||||
<FontAwesomeIcon icon={faCalendar} />
|
||||
|
||||
{props.fetchedPage.date || "Unknown date"}
|
||||
|
||||
</div>
|
||||
|
||||
{/* read time */}
|
||||
<div className="flex flex-nowrap items-center gap-2 whitespace-nowrap">
|
||||
<FontAwesomeIcon icon={faHourglass} />
|
||||
|
||||
{props.fetchedPage.readTime
|
||||
? props.fetchedPage.readTime + " read"
|
||||
: "unknown length"}
|
||||
|
||||
</div>
|
||||
|
||||
{/* word count */}
|
||||
<div className="flex flex-nowrap items-center gap-2 whitespace-nowrap">
|
||||
<FontAwesomeIcon icon={faBook} />
|
||||
|
||||
{props.fetchedPage.wordCount
|
||||
? props.fetchedPage.wordCount +
|
||||
" word" +
|
||||
(props.fetchedPage.wordCount > 1 && "s")
|
||||
: "unknown words"}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue