-
-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #174 from chrismwilliams/fix-og-image-title
- Loading branch information
Showing
1 changed file
with
14 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,22 @@ | ||
--- | ||
title: "Example Social Image" | ||
title: "Example OG Social Image" | ||
publishDate: "27 January 2023" | ||
description: "An example post for Astro Cactus, detailing how to add a custom social image card in the frontmatter" | ||
tags: ["example", "blog", "image"] | ||
ogImage: "/social-card.png" | ||
--- | ||
|
||
## Adding your own social image card to a post | ||
## Adding your own social image to a post | ||
|
||
This post is an example of how to add a custom social image, also known as an OG image, to a blog post. | ||
By adding the optional ogImage property to the frontmatter of a post, [satori](https://github.com/vercel/satori) won't generate an image for this page. | ||
This post is an example of how to add a custom [open graph](https://ogp.me/) social image, also known as an OG image, to a blog post. | ||
By adding the optional ogImage property to the frontmatter of a post, you opt out of [satori](https://github.com/vercel/satori) automatically generating an image for this page. | ||
|
||
If you open this markdown file `src/content/post/social-image.md` you'll see the ogImage property set to an image which lives in the public folder[^1]. | ||
|
||
```yaml | ||
ogImage: "/social-card.png" | ||
``` | ||
You can view the one set for this template page [here](https://astro-cactus.chriswilliams.dev/social-card.png). | ||
[^1]: The image itself can be located anywhere you like. |