Skip to content

Provide examples for using bgImage #76

@paulrudy

Description

@paulrudy

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationgood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions