Skip to content

Commit 1a16fd9

Browse files
committed
Add creative commons configuration files and metadata
1 parent 32006d2 commit 1a16fd9

22 files changed

+1510
-985
lines changed

.cc-metadata.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Whether this GitHub repo is engineering related
2+
engineering_project: true
3+
# Name of the repository/project in English
4+
english_name: CC Open Graph Image Generator
5+
# All technologies used
6+
technologies: JavaScript
7+
# Whether this repository should be featured on the CC Open Source site
8+
featured: false
9+
# Slack channel name
10+
slack: "cc-developers"

.editorconfig

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
root = true
2+
[*]
3+
charset = utf-8
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true

.prettierrc.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
trailingComma: "es5",
3+
tabWidth: 2,
4+
semi: false,
5+
singleQuote: true,
6+
};

.vercelignore

-6
This file was deleted.

CODE_OF_CONDUCT.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Contributor Code of Conduct
2+
3+
The Creative Commons team is committed to fostering a welcoming community. This
4+
project and all other Creative Commons open source projects are governed by our
5+
[Code of Conduct][code_of_conduct]. Please report unacceptable behavior to
6+
[conduct@creativecommons.org](mailto:conduct@creativecommons.org) per our
7+
[reporting guidelines][reporting_guide].
8+
9+
For a history of updates, see the [page history here][updates].
10+
11+
[code_of_conduct]: https://opensource.creativecommons.org/community/code-of-conduct/
12+
[reporting_guide]: https://opensource.creativecommons.org/community/code-of-conduct/enforcement/
13+
[updates]: https://github.com/creativecommons/creativecommons.github.io-source/commits/master/content/community/code-of-conduct/contents.lr

CONTRIBUTING.md

+40-13
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,47 @@
1-
# Contributing
1+
# Contributing to CC Open Source
22

3-
There are two pieces to `og-image` that are worth noting before you begin development.
3+
Thank you for your interest in contributing to CC Open Source! This document is a set of guidelines to help you contribute to this project.
44

5-
1. The backend image generator located in [/api/index.ts](https://github.com/vercel/og-image/blob/main/api/index.ts)
6-
2. The frontend inputs located in [/web/index.ts](https://github.com/vercel/og-image/blob/main/web/index.ts)
5+
## Code of Conduct
76

8-
Vercel handles [routing](https://github.com/vercel/og-image/blob/main/vercel.json#L6) in an elegate way for us so deployment is easy.
7+
By participating in this project, you are expected to uphold our [Code of Conduct](https://opensource.creativecommons.org/community/code-of-conduct/).
98

10-
To start hacking, do the following:
9+
## Project Documentation
1110

12-
1. Clone this repo with `git clone https://github.com/vercel/og-image`
13-
2. Change directory with `cd og-image`
14-
3. Run `yarn` or `npm install` to install all dependencies
15-
4. Run locally with `vercel dev` and visit [localhost:3000](http://localhost:3000) (if nothing happens, run `npm install -g vercel`)
16-
5. If necessary, edit the `exePath` in [options.ts](https://github.com/vercel/og-image/blob/main/api/_lib/options.ts) to point to your local Chrome executable
11+
Please consult the [README](./README.md) and [CODEBASE](./CODEBASE.md) files at the root of this repository.
1712

18-
Now you're ready to start local development!
13+
## How to Contribute
1914

20-
You can set an environment variable to assist with debugging `export OG_HTML_DEBUG=1`. This will render the image as HTML so you can play around with your browser's dev tools before committing changes to the template.
15+
Please read the processes in our general [Contributing Code](https://opensource.creativecommons.org/contributing-code/) guidelines on the Creative Common Open Source website. It contains some general instructions that should be followed when contributing to any of the Creative Commons open-source repositories.
16+
17+
### Bugs
18+
19+
If you find a bug, please open an issue in this repository describing the bug. You can file a bug [here](https://github.com/creativecommons/og-image-generator/issues/new?template=bug_report.md). You will see a bug report template with the required information you should provide.
20+
21+
After that, don't forget to tag the issue with the "Bug" label.
22+
23+
### Proposing changes or new features
24+
25+
If you have an idea of a new feature or change to how the CC Search frontend works, please [file an issue](https://github.com/creativecommons/og-image-generator/issues/new?template=feature_request.md) so we can discuss the possibility of that change or new feature being implemented and released in the future. This lets us come to an agreement about the proposed idea before any work is done.
26+
27+
If you'd like to build a new feature but don't have a specific idea, please check our [public roadmap](https://docs.google.com/document/d/19yH2V5K4nzWgEXaZhkzD1egzrRayyDdxlzxZOTCm_pc/). Choose something from the pipeline of ideas and follow the same process as above.
28+
29+
### Pull requests
30+
31+
Before you start writing code, make sure there is an issue open. Pull requests without a link to an existing issue won't be merged. All pull requests _must_ target the `develop` branch of the repository.
32+
33+
If you want to get started contributing code to this project but don't know exactly what to work on, we compiled a good list of issues labeled as [Good first issues](https://github.com/creativecommons/og-image-generator/labels/good%20first%20issue) which are small in scope and not so complex to solve. There is also issues labeld as [Help wanted](https://github.com/creativecommons/og-image-generator/labels/help%20wanted) which can be a bit more complex but are good examples of thigns we are currently accepting help from the community.
34+
35+
Any code modifications will have to be accompanied by the appropriate unit tests. This will be checked and verified during code review. Once the Pull Reques is opened, our CI server will run the unit test suite and run a code linter to verify that the code follows the coding guidelines.
36+
37+
If you want to run the unit tests and linter on your machine, run the following commands:
38+
39+
`npm run unit` for unit tests
40+
41+
`npm run lint` for linter.
42+
43+
You can also configure your editor of choice with a ESLint plugin so you can get the linter feedback as you write code.
44+
45+
## Questions or Thoughts?
46+
47+
Talk to us on [our developer mailing list or Slack community](https://opensource.creativecommons.org/community/).

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019-2020 Vercel, Inc.
3+
Copyright (c) 2020 Creative Commons
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+10-17
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
1-
<a href="https://vercel.com/new/project?template=vercel/og-image"><img width="128" src="https://vercel.com/button" align="right"></a>
2-
3-
# [Open Graph Image as a Service](https://og-image.vercel.app)
4-
5-
<a href="https://twitter.com/vercel">
6-
<img align="right" src="https://og-image.vercel.app/tweet.png" height="300" />
7-
</a>
1+
# Open Graph Image Generator
82

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

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

13-
See the image embedded in the tweet for a real use case.
14-
15-
167
## What is an Open Graph Image?
178

189
Have you ever posted a hyperlink to Twitter, Facebook, or Slack and seen an image popup?
@@ -32,16 +23,19 @@ It looks like the following:
3223

3324
## Why use this service?
3425

35-
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.
26+
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.
3627

37-
That's where `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!
28+
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!
3829

3930
It looks like the following:
4031

4132
```html
4233
<head>
4334
<title>Hello World</title>
44-
<meta property="og:image" content="https://og-image.vercel.app/Hello%20World.png" />
35+
<meta
36+
property="og:image"
37+
content="https://cc-og-image.vercel.app/Hello%20World.png"
38+
/>
4539
</head>
4640
```
4741

@@ -56,7 +50,7 @@ You'll want to fork this repository and deploy your own image generator.
5650
3. Change directory with `cd og-image`
5751
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)
5852
5. Hobby plan users will need to remove all configuration inside `vercel.json` besides `rewrites`
59-
6. Run locally with `vercel dev` and visit [localhost:3000](http://localhost:3000) (if nothing happens, run `npm install -g vercel`)
53+
6. Run locally with `vercel dev` and visit [localhost:3000](http://localhost:3000) (if nothing happens, run `npm install -g vercel`)
6054
7. Deploy to the cloud by running `vercel` and you'll get a unique URL
6155
8. Setup [GitHub](https://vercel.com/github) to autodeploy on push
6256

@@ -66,7 +60,6 @@ If you are using a paid plan, you can do a one-click deploy with the button belo
6660

6761
Once you have an image generator that sparks joy, you can setup [automatic GitHub](https://vercel.com/github) deployments so that pushing to master will deploy to production! 🚀
6862

69-
## Authors
63+
## Credits
7064

71-
- Steven ([@styfle](https://twitter.com/styfle)) - [Vercel](https://vercel.com)
72-
- Evil Rabbit ([@evilrabbit](https://twitter.com/evilrabbit_)) - [Vercel](https://vercel.com)
65+
This is based on the lovely [Open Graph Image Generator](https://github.com/vercel/og-image) created by [Vercel](https:/vercel.com). They

api/_fonts/Inter-Bold.woff2

-93.7 KB
Binary file not shown.

api/_fonts/Inter-License.txt

-92
This file was deleted.

api/_fonts/Inter-Regular.woff2

-87.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)