delucis/astro-og-canvas

Provide examples for using `bgImage`

Open

#76 opened on Oct 13, 2024

 (1 comment) (0 reactions) (0 assignees)TypeScript (27 forks)auto 404
documentationgood first issue

Repository metrics

Stars
 (272 stars)
PR merge metrics
 (PR metrics pending)

Description

I'm struggling to use bgImage. Would you consider sharing an example of usage?

I'm not able to discover an explicit path that works. No matter what I try, I get no such file or directory. Edit: just needed ./src/path/to/image.png

What I'd like to do is pull the background image url from page frontmatter. For example, frontmatter contains:

featuredImage:
  url: '~/assets/image.png'

and in my getImageOptions() I have bgImage: {path: page.featuredImage?.url.src}, but I get [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined.

Contributor guide