Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/creativecommons/og-image-generator
An open graph image generator for Creative Commons projects.
https://github.com/creativecommons/og-image-generator
hacktoberfest hacktoberfest2020 lambda-functions puppeteer serverless typescript
Last synced: 2 months ago
JSON representation
An open graph image generator for Creative Commons projects.
- Host: GitHub
- URL: https://github.com/creativecommons/og-image-generator
- Owner: creativecommons
- License: mit
- Created: 2020-08-31T20:05:46.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-04-01T16:44:27.000Z (10 months ago)
- Last Synced: 2024-05-01T09:40:47.653Z (9 months ago)
- Topics: hacktoberfest, hacktoberfest2020, lambda-functions, puppeteer, serverless, typescript
- Language: TypeScript
- Homepage: https://cc-og-image.vercel.app
- Size: 7.65 MB
- Stars: 29
- Watchers: 7
- Forks: 13
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Open Graph Image Generator
Serverless service that generates dynamic Open Graph images that you can embed in your `` 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`][org-coc]:
> The Creative Commons team is committed to fostering a welcoming community.
> This project and all other Creative Commons open source projects are governed
> by our [Code of Conduct][code_of_conduct]. Please report unacceptable
> behavior to [[email protected]](mailto:[email protected])
> per our [reporting guidelines][reporting_guide].[org-coc]: https://github.com/creativecommons/.github/blob/main/CODE_OF_CONDUCT.md
[code_of_conduct]: https://opensource.creativecommons.org/community/code-of-conduct/
[reporting_guide]: https://opensource.creativecommons.org/community/code-of-conduct/enforcement/## Contributing
See [`CONTRIBUTING.md`][org-contrib].
[org-contrib]: https://github.com/creativecommons/.github/blob/main/CONTRIBUTING.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 ``.The [Open Graph protocol](http://ogp.me) says you can put a `` tag in the `` of a webpage to define this image.
It looks like the following:
```html
Title
```
## 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 where `cc-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:
```html
Hello World
```
Now try changing the text `Hello%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 with `git clone URL_OF_FORKED_REPO_HERE`
3. Change directory with `cd og-image`
4. Make changes by swapping out images, changing colors, etc (see [contributing](https://github.com/vercel/og-image/blob/main/CONTRIBUTING.md) for more info)
5. Hobby plan users will need to remove all configuration inside `vercel.json` besides `rewrites`
6. Run locally with `vercel dev` and visit [localhost:3000](http://localhost:3000) (if nothing happens, run `npm install -g vercel`)
7. Deploy to the cloud by running `vercel` and you'll get a unique URL
8. Setup [GitHub](https://vercel.com/github) to autodeploy on pushIf you are using a paid plan, you can do a one-click deploy with the button below.
[![Deploy to Vercel](https://vercel.com/button)](https://vercel.com/new/project?template=vercel/og-image)
Once you have an image generator that sparks joy, you can setup [automatic GitHub](https://vercel.com/github) deployments so that pushing to main will deploy to production! 🚀
## Credits
This is a fork of the lovely [Open Graph Image Generator](https://github.com/vercel/og-image) created by [Vercel](https:/vercel.com). Special thanks to their clearly-written and reuse-friendly repository!