Open Graph Images
By following the convention for your social share images, you can automatically generate
This is based on Next.js Metadata File with an almost identical API, however runtime images are not supported.
You can optionally place images in the root of your
File Types
opengraph-image
Open Graph images are used by social media sites to display a website's icon when shared.
The image dimensions and type will be automatically generated from the image file.
*og-image.{png,jpg,jpeg,gif} *opengraph-image-*.{png,jpg,jpeg,gif}
pages/
├── index.vue
├── about/
│ ├── index.vue
│ └── og-image.png
<meta property="og:image" content="<site-url>/about/og-image.png" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:image:type" content="image/png" />
twitter-image
Twitter images are used by to display an image when your site is shared on Twitter.
The image dimensions and type will be automatically generated from the image file.
*twitter-image.{png,jpg,jpeg,gif}
pages/
├── index.vue
├── about/
│ ├── index.vue
│ └── twitter-image.png
<meta name="twitter:image" content="<site-url>/about/twitter-image.png" />
<meta name="twitter:image:width" content="1200" />
<meta name="twitter:image:height" content="630" />
<meta name="twitter:image:type" content="image/png" />
Providing Alternate Text
You can provide alternate text for your images by using creating a matching
For example, if you have an image
This is the alternate text for my image.
<meta property="og:image:alt" content="This is the alternate text for my image." />
Using _dir folder
It's recommended to use the
pages/
├── index.vue
├── about/
│ ├── index.vue
│ └── _dir/
│ ├── og-image.png
│ ├── og-image.txt
│ ├── twitter-image.png
│ └── twitter-image.txt
<meta property="og:image" content="<site-url>/about/_dir/og-image.png" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:image:type" content="image/png" />
<meta property="og:image:alt" content="This is the alternate text for my image." />
<meta name="twitter:image" content="<site-url>/about/_dir/twitter-image.png" />
<meta name="twitter:image:width" content="1200" />
<meta name="twitter:image:height" content="630" />
<meta name="twitter:image:type" content="image/png" />
<meta name="twitter:image:alt" content="This is the alternate text for my image." />