Skip to content

Commit

Permalink
Set article:published_time meta tag on the post page
Browse files Browse the repository at this point in the history
  • Loading branch information
smrtrfszm committed Jan 6, 2024
1 parent c4d184f commit 2d945f9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/pages/Post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import ImageViewer from '~/components/ImageViewer'
import { createAsync, RouteSectionProps } from '@solidjs/router'
import { Meta } from '@solidjs/meta'
import { queryPostById } from '~/data/post.data'
import { formatISO } from 'date-fns'

// eslint-disable-next-line solid/no-destructure
const PostPage: Component<RouteSectionProps> = ({ params }) => {
Expand All @@ -28,6 +29,7 @@ const PostPage: Component<RouteSectionProps> = ({ params }) => {
<Meta property="og:author" content={data()!.author!.name} />
</Show>
<Meta property="og:type" content="article" />
<Meta property="article:published_time" content={formatISO(data()!.date)} />
<Meta property="twitter:card" content="summary" />

<article class={styles.container}>
Expand Down

0 comments on commit 2d945f9

Please sign in to comment.