Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

An open graph image generator for Creative Commons projects.

License

NotificationsYou must be signed in to change notification settings

creativecommons/og-image-generator

Serverless service that generates dynamic Open Graph images that you can embed in your<meta> tags.

For each keystroke, headless chromium is used to render an HTML page and take a screenshot of the result which gets cached.

Code of conduct

CODE_OF_CONDUCT.md:

The Creative Commons team is committed to fostering a welcoming community.This project and all other Creative Commons open source projects are governedby ourCode of Conduct. Please report unacceptablebehavior toconduct@creativecommons.orgper ourreporting guidelines.

Contributing

SeeCONTRIBUTING.md.

What is an Open Graph Image?

Have you ever posted a hyperlink to Twitter, Facebook, or Slack and seen an image popup?How did your social network know how to "unfurl" the URL and get an image?The answer is in your<head>.

TheOpen Graph protocol says you can put a<meta> tag in the<head> of a webpage to define this image.

It looks like the following:

<head><title>Title</title><metaproperty="og:image"content="https://cc-og-image.vercel.app/Hello%20World.png"/></head>

Why use this service?

The short answer is that it would take a long time to painstakingly design an image for every single blog post and every single documentation page. And we don't want the exact same image for every blog post because that wouldn't make the article stand out when it was shared to Twitter.

That's wherecc-og-image.vercel.app comes in. We can simply pass the title of our blog post to our generator service and it will generate the image for us on the fly!

It looks like the following:

<head><title>Hello World</title><metaproperty="og:image"content="https://cc-og-image.vercel.app/Hello%20World.png"/></head>

Now try changing the textHello%20World to the title of your choosing and watch the magic happen ✨

Deploy your own

You'll want to fork this repository and deploy your own image generator.

  1. Click the fork button at the top right of GitHub
  2. Clone the repo to your local machine withgit clone URL_OF_FORKED_REPO_HERE
  3. Change directory withcd og-image
  4. Make changes by swapping out images, changing colors, etc (seecontributing for more info)
  5. Hobby plan users will need to remove all configuration insidevercel.json besidesrewrites
  6. Run locally withvercel dev and visitlocalhost:3000 (if nothing happens, runnpm install -g vercel)
  7. Deploy to the cloud by runningvercel and you'll get a unique URL
  8. SetupGitHub to autodeploy on push

If you are using a paid plan, you can do a one-click deploy with the button below.

Deploy to Vercel

Once you have an image generator that sparks joy, you can setupautomatic GitHub deployments so that pushing to main will deploy to production! 🚀

Credits

This is a fork of the lovelyOpen Graph Image Generator created byVercel. Special thanks to their clearly-written and reuse-friendly repository!

About

An open graph image generator for Creative Commons projects.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

  •  

Contributors17


[8]ページ先頭

©2009-2025 Movatter.jp