Commit graph

15 commits

Author SHA1 Message Date
JTaylor0196
f7baa56792
update example Deploy button URLs (#48842)
### What?
Updates Deploy button URLs for all listed examples here:
https://github.com/vercel/next.js/tree/canary/examples

### Why?
The Deploy URLs are currently broken and result in a failed clone
attempt on Vercel.

### How?
The URLs have been changed from https://vercel.com/new/git/external?… to
-> https://vercel.com/new/clone?…
(Last updated
[here](8eaabe2fb0)
in 2021)
2023-04-26 13:31:44 -04:00
Marcos Bérgamo
c3e5caf110
docs(examples): improve DX while copying command to create new project (#38410)
* docs(examples): improve DX while copy command to create new project

* chore: apply code review

Co-authored-by: Marcos Bérgamo <Marcos.Bergamo@refinitiv.com>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-07-26 21:57:48 -05:00
Steven
57dcc9d329
Update pnpm create next-app for latest pnpm 6 and 7 (#37254)
This command changed in pnpm [6.32.13](https://github.com/pnpm/pnpm/releases/tag/v6.32.13) and [7.1.1](https://github.com/pnpm/pnpm/releases/tag/v7.1.1) so lets update it since its been a few weeks and we can expect pnpm users to update more regularly than npm users.

- Fixes https://github.com/vercel/next.js/pull/37240 
- Fixes https://github.com/vercel/next.js/pull/37045
- Fixes https://github.com/vercel/next.js/pull/37032
- Fixes https://github.com/vercel/next.js/pull/36602
- Fixes https://github.com/vercel/next.js/pull/36496
2022-05-27 21:21:40 +00:00
Tom
3e178bb801
add pnpm link to docs (#37221)
## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)


Co-authored-by: Steven <steven@ceriously.com>
2022-05-27 15:46:38 -04:00
Steven
9f9214abe5
Updated create-next-app docs to include pnpm usage (#35755)
This PR updates the docs and examples for `create-next-app` to include pnpm usage.

The following script was used to update every example README:

```js
const fs = require('fs')
const examples = fs.readdirSync('./examples')

for (let example of examples) {
    const filename = `./examples/${example}/README.md`
    const markdown = fs.readFileSync(filename, 'utf8')
    const regex = new RegExp(`^yarn create next-app --example (.*)$`, 'gm')
    const output = markdown.replace(regex, (yarn, group) => {
        const pnpm = `pnpm create next-app -- --example ${group}`
        return `${yarn}\n# or\n${pnpm}`
    })
    fs.writeFileSync(filename, output)
}
```
2022-03-30 21:03:21 +00:00
Hassan El Mghari
33aa51ab26
Change README structure in examples (#35349)
Changed the README structure in all examples to take out the Stackblitz button and include it as a link instead using a [bash script](https://gist.github.com/Nutlope/a8f3556a5a401e32a8c6278b782ebf8a/revisions).

I also added the Vercel deploy button to 15 READMEs that didn't have it.
2022-03-16 21:39:26 +00:00
Dominic Elm
d2caaeab64
docs: add 'Open in StackBlitz' buttons to various examples (#25853)
This PR adds a `Preview` section and a `Open in StackBlitz` button to various examples. I have tested all examples and omitted the ones that require third party API keys, or didn't work. Some examples don't work locally either.

Here's an example:
![image](https://user-images.githubusercontent.com/12571019/121027783-88971280-c7a7-11eb-851a-0ad30cf74b42.png)

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [x] Examples updated
- [ ] Telemetry added. In case of a feature if it's used or not.

## Documentation / Examples

- [x] Make sure the linting passes
2021-06-08 20:45:02 +00:00
Luis Alvarez D
e28fd50441
Include utm_source on example links to vercel.com (#21305) 2021-01-19 07:28:54 +00:00
Luc Leray
8eaabe2fb0
Fix deploy buttons URLs (#20834)
Fix all deploy button URLs in the Next.js repo to follow the following format:
```
https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/<EXAMPLE_NAME>&project-name=<EXAMPLE_NAME>&repository-name=<EXAMPLE_NAME>
```

The detailed docs for the Deploy Button can be found here: https://vercel.com/docs/more/deploy-button.

Also updates legacy Vercel import flow URLs (starting with vercel.com/import or with vercel.com/new/project), to use the new vercel.com/new URLs.

---

For example, for the `hello-world` example:

The URL is https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/hello-world&project-name=hello-world&repository-name=hello-world

And the deploy button looks like this:
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/hello-world&project-name=hello-world&repository-name=hello-world)

---

For reference, I used the following regexes to search for the incorrect URLs

```
\(https://vercel.com/import/git\?s=https://github.com/vercel/next.js/tree/canary/examples/(.*)\)
\(https://vercel.com/import/git\?c=1&s=https://github.com/vercel/next.js/tree/canary/examples/([^&]*)(.*)\)
\(https://vercel.com/import/project\?template=https://github.com/vercel/next.js/tree/canary/examples/(.*)\)
https://vercel.com/import/git
https://vercel.com/import/select-scope
https://vercel.com/import
https://vercel.com/new/project
```
2021-01-07 01:40:29 +00:00
NorbertLuszkiewicz
c03d4931de
Simplify example usage instructions (#16678)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-08-29 22:22:02 -04:00
Joe Haddad
b7e17e09e5
Update references to zeit/next.js (#13463) 2020-05-27 17:51:11 -04:00
Jimmy Merritello
001230e0a8
Add Route as Modal Page Example (#12945)
### Add dynamic routes to _with-route-as-modal_ example

This PR adds [dynamic routes](https://nextjs.org/docs/routing/dynamic-routes), [getStaticPaths](https://nextjs.org/docs/basic-features/data-fetching#getstaticpaths-static-generation), and [getStaticProps](https://nextjs.org/docs/basic-features/data-fetching#getstaticprops-static-generation) to the **with-route-as-modal** example. This change might also clear up some confusion here on https://github.com/zeit/next.js/issues/11971

Additionally this PR makes sure each modal route is also a modal **page.**

This is an important distinction and makes sure the experience is the same should the URL (route) be shared as a link. In other words, `index.js` need not be the only "entrypoint" to browsing the website.

With the additions in this PR, each post page is an actual page, so if you were to share the link for **Post 3** you'd get this:

<img src="https://user-images.githubusercontent.com/7191639/82058282-25ad7780-968a-11ea-94f1-9b4a36abccf9.png" width="200px" />

(clickable outer region brings you back to the 'gallery')

**Update:** I have also included the `pathname` to signal the difference in which page component is rendered

Rather than this (previously):

<img src="https://user-images.githubusercontent.com/7191639/82058199-0878a900-968a-11ea-97d2-e9e20c9267fc.png" width="200px" />

I have used a similar approach [here 🔗](https://hashiconf.com/digital-june/schedule/the-hitchhikers-guide-to-terraform-your-infrastructure)
2020-05-27 21:22:33 +00:00
JJ Kasper
1f6ce106ae
Update codeload and deploy links for org rename (#13141)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-05-27 14:11:39 -04:00
Tim Neutkens
483bd3ddda
Rename ZEIT to Vercel (#12075)
* Find/replace

* Update more URLs

* More rename

* Fix remaining examples

* More updates

* Update create-next-app

* Update remaining text

* Update

Co-authored-by: Shu Uesugi <shu@chibicode.com>
2020-04-21 11:47:12 +02:00
Hugo Morosini
226387694b
added "with-route-as-modal" example (#11473)
* added "with-route-as-modal" exemple

extra space missing in style.css

oops

linted

* Use Link and removed unrequired imports

Co-authored-by: Luis Alvarez <luis@zeit.co>
2020-03-31 14:10:55 -05:00