feat: Add tag classes when rendering page (#395)

This commit is contained in:
Rainey 2023-04-21 03:12:11 +08:00 committed by GitHub
parent 129822d08d
commit fda0f1d6c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -103,7 +103,10 @@ export const SiteLayout: React.FC<SiteLayoutProps> = ({
)}
{site.data && <SiteHeader site={site.data} />}
<div
className={`xlog-post-id-${page.data?.id} max-w-screen-md mx-auto px-5 pt-12 relative`}
className={cn(
`xlog-post-id-${page.data?.id} max-w-screen-md mx-auto px-5 pt-12 relative`,
page.data?.tags?.map((tag) => `xlog-post-tag-${tag}`),
)}
>
{children}
</div>