Skip to content

Commit

Permalink
Rename zeit/og-image to vercel/og-image (vercel#119)
Browse files Browse the repository at this point in the history
- Rename `now` CLI to `vercel` CLI
- Rename `now.json` to `vercel.json`
- Rename `.nowignore` to `.vercelignore`
- Rename `zeit/og-image` to `vercel/og-image`

https://vercel.com/blog/zeit-is-now-vercel
  • Loading branch information
styfle authored May 27, 2020
1 parent 76fb629 commit bbd8b8b
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.now
.vercel
node_modules
api/dist
public/dist
Expand Down
2 changes: 1 addition & 1 deletion .nowignore → .vercelignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.github
node_modules
api/dist
public/dist
CONTRIBUTING.md
README.md
Dockerfile
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

There are two pieces to `og-image` that are worth noting before you begin development.

1. The backend image generator located in [/api/index.ts](https://github.com/zeit/og-image/blob/master/api/index.ts)
2. The frontend inputs located in [/web/index.ts](https://github.com/zeit/og-image/blob/master/web/index.ts)
1. The backend image generator located in [/api/index.ts](https://github.com/vercel/og-image/blob/master/api/index.ts)
2. The frontend inputs located in [/web/index.ts](https://github.com/vercel/og-image/blob/master/web/index.ts)

Vercel handles [routing](https://github.com/zeit/og-image/blob/master/now.json#L6) in an elegate way for us so deployment is easy.
Vercel handles [routing](https://github.com/vercel/og-image/blob/master/vercel.json#L6) in an elegate way for us so deployment is easy.

To start hacking, do the following:

1. Clone this repo with `git clone https://github.com/zeit/og-image`
1. Clone this repo with `git clone https://github.com/vercel/og-image`
2. Change directory with `cd og-image`
3. Run `yarn` or `npm install` to install all dependencies
4. Run locally with `now dev` and visit [localhost:3000](http://localhost:3000) (if nothing happens, run `npm install -g now`)
5. If necessary, edit the `exePath` in [options.ts](https://github.com/zeit/og-image/blob/master/api/_lib/options.ts) to point to your local Chrome executable
4. Run locally with `vercel dev` and visit [localhost:3000](http://localhost:3000) (if nothing happens, run `npm install -g vercel`)
5. If necessary, edit the `exePath` in [options.ts](https://github.com/vercel/og-image/blob/master/api/_lib/options.ts) to point to your local Chrome executable

Now you're ready to start local development!

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# [Open Graph Image as a Service](https://og-image.now.sh)

<a href="https://twitter.com/zeithq/status/1092587111985881088">
<img align="right" src="https://raw.githubusercontent.com/zeit/og-image/master/public/tweet.png" height="300" />
<a href="https://twitter.com/vercel/status/1092587111985881088">
<img align="right" src="https://raw.githubusercontent.com/vercel/og-image/master/public/tweet.png" height="300" />
</a>

Serverless service that generates dynamic Open Graph images that you can embed in your `<meta>` tags.
Expand Down Expand Up @@ -54,10 +54,10 @@ 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/zeit/og-image/blob/master/CONTRIBUTING.md) for more info)
5. Hobby plan users will need to remove all configuration inside `now.json` besides `rewrites`
6. Run locally with `now dev` and visit [localhost:3000](http://localhost:3000) (if nothing happens, run `npm install -g now`)
7. Deploy to the cloud by running `now` and you'll get a unique URL
4. Make changes by swapping out images, changing colors, etc (see [contributing](https://github.com/vercel/og-image/blob/master/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 push

If you are using a paid plan, you can do a one-click deploy with the button below.
Expand Down
2 changes: 1 addition & 1 deletion api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { parseRequest } from './_lib/parser';
import { getScreenshot } from './_lib/chromium';
import { getHtml } from './_lib/template';

const isDev = process.env.NOW_REGION === 'dev1';
const isDev = process.env.VERCEL_REGION === 'dev1';
const isHtmlDebug = process.env.OG_HTML_DEBUG === '1';

export default async function handler(req: IncomingMessage, res: ServerResponse) {
Expand Down
6 changes: 3 additions & 3 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<body>
<div class="container">
<div class="wrapper">
<a href="https://github.com/zeit/og-image" class="github-corner" aria-label="View source on GitHub">
<a href="https://github.com/vercel/og-image" class="github-corner" aria-label="View source on GitHub">
<svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true">
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
<path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
Expand All @@ -29,8 +29,8 @@ <h1>Open Graph Image as a Service</h1>
<h2>What is this?</h2>
<p>This is a service that generates dynamic <a href="http://ogp.me">Open Graph</a> images that you can embed in your <code>&lt;meta&gt;</code> tags.</p>
<p>For each keystroke, headless chromium is used to render an HTML page and take a screenshot of the result which gets cached.</p>
<p>Find out how this works and deploy your own image generator by visiting <a href="https://github.com/zeit/og-image">GitHub</a>.</p>
<footer>Proudly hosted on <a href="https://vercel.com/now">▲Vercel</a></footer>
<p>Find out how this works and deploy your own image generator by visiting <a href="https://github.com/vercel/og-image">GitHub</a>.</p>
<footer>Proudly hosted on <a href="https://vercel.com">▲Vercel</a></footer>
</div>
</div>
</div>
Expand Down
1 change: 0 additions & 1 deletion now.json → vercel.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"regions": ["all"],
"public": true,
"functions": {
"api/**": {
"memory": 3008
Expand Down

0 comments on commit bbd8b8b

Please sign in to comment.