Skip to content

Commit

Permalink
implement useOpenGraphImage composable on blog page
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoerdbeentjes committed Mar 1, 2023
1 parent 6aa8552 commit 3a611cf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/pages/[language]/blog/[slug]/index.query.graphql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
query BlogSlug($locale: SiteLocale, $slug: String) {
page: blogPost(locale: $locale, filter: {slug: {eq: $slug}}) {
page: blogPost(locale: $locale, filter: { slug: { eq: $slug } }) {
...page
}
}
Expand Down Expand Up @@ -165,4 +165,16 @@ fragment page on BlogPostRecord {
}
}
}
openGraphImage {
title
image {
url
}
authors {
name
image {
url
}
}
}
}
2 changes: 2 additions & 0 deletions src/pages/[language]/blog/[slug]/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@
useSeoHead(data.value.page);
useOpenGraphImage(data.value.page.openGraphImage)
const prismify = ({ body, language }) => (
prismjs.languages[language]
? prismjs.highlight(body, prismjs.languages[language], language)
Expand Down

0 comments on commit 3a611cf

Please sign in to comment.