Setting Up OpenGraph Data
OpenGraph (OG) data is crucial for controlling how your web pages appear when shared on social media platforms. This guide will walk you through the process of setting up OpenGraph data for your project.
Steps to Set Up OpenGraph Data
1. Create OpenGraph Images
- Generate an image that represents your application. This could be your logo on a branded background or a screenshot of your app.
- Create two versions of this image:
opengraph-image.png
: 1200x630 pixels (optimal size for most platforms).twitter-image.png
: 1200x600 pixels (optimal for Twitter cards).
Using a Free Open Graph Image Generator
If you need help creating professional-looking Open Graph images, you can use a free online tool:
- Visit the Free Open Graph Image Generator.
- Choose a template that fits your project's style.
- Add your content, such as page title and author information.
- Generate the image and download it for use in your project.
This tool allows you to create up to 5 watermark-free images per day, which is perfect for getting started with your OpenGraph setup.
2. Add OpenGraph Images to Your Project
Place the generated images in your apps/web/app
folder.
3. Create Alt Text Files
-
Create two text files in the same
apps/web/app
folder:opengraph-image.alt.txt
twitter-image.alt.txt
-
Open your project's README file and ask ChatGPT/Claude to generate a description of your project.
-
Edit the copied content to create a concise description (1-2 sentences) that captures the essence of your project.
-
Paste this edited description into both
opengraph-image.alt.txt
andtwitter-image.alt.txt
.