Skip to content

Commit

Permalink
Updated OG image header to allow image path from outside of static dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen-X committed Nov 16, 2024
1 parent f24a147 commit 8cf1160
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/features/social images.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ The following properties can be used to customize your link previews:
| `socialDescription` | `description` | Description to be used for preview. |
| `socialImage` | `image`, `cover` | Link to preview image. |

The `socialImage` property should contain a link to an image relative to `quartz/static`. If you have a folder for all your images in `quartz/static/my-images`, an example for `socialImage` could be `"my-images/cover.png"`.
The `socialImage` property should contain a link to an image relative to your base URL. For example, if you have an image `cover.png` in `quartz/static/`, the `socialImage` value could be `"static/cover.png"`. If your image is in `content/assets/`, then the `socialImage` value would become `"assets/cover.png"`.

> [!info] Info
>
Expand Down
2 changes: 1 addition & 1 deletion quartz/components/Head.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export default (() => {

// Override with frontmatter url if existing
if (frontmatterImgUrl) {
ogImagePath = `https://${cfg.baseUrl}/static/${frontmatterImgUrl}`
ogImagePath = `https://${cfg.baseUrl}/${frontmatterImgUrl}`
}

// Url of current page
Expand Down

0 comments on commit 8cf1160

Please sign in to comment.