Commit Graph

3801 Commits

Author SHA1 Message Date
JJ Kasper 3c9da075ff Add i18n routing docs to manifest (#18264)
Follow-up to https://github.com/vercel/next.js/pull/18067 this adds the manifest item for the new docs
2020-10-27 07:12:27 +00:00
Steven 3a169fbbf0 Separate config into deviceSizes and iconSizes (#18267)
This separates the `next.config.js` property `images.sizes` into to properties: `images.deviceSizes` and `images.iconSizes`.

The purpose is for images that are not intended to take up the majority of the viewport.


Related to #18122
2020-10-26 20:07:52 +00:00
Tim Neutkens 557a0001db Update image-optimization.md 2020-10-26 18:17:26 +01:00
Tim Neutkens c381a35247 Update image-optimization.md 2020-10-26 18:13:21 +01:00
Tim Neutkens 8db23295d3 Update image-optimization.md 2020-10-26 18:12:40 +01:00
Tim Neutkens 129fb85da4 Update image-optimization.md 2020-10-26 18:07:23 +01:00
Steven ce38e4f6fe FIx image optimization docs (#18254)
Add missing links in the documentation
2020-10-26 12:51:11 -04:00
Steven 3c6f421d99 Add docs for Image Optimization (#18107)
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2020-10-24 14:53:28 +02:00
JJ Kasper d4397d8ab5 Add initial i18n documentation (#18067)
* Add initial i18n documentation

* Apply suggestions from code review

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>

* Apply suggestions from code review

Co-authored-by: Lee Robinson <me@leerob.io>

* Apply more suggestions

* rephrase a bit more

* Update doc

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Tim Neutkens <timneutkens@me.com>
2020-10-23 10:42:52 -05:00
Francisco Baio Dias 58edd0998c Fix typo in headers docs example (#18012) 2020-10-19 11:38:55 +00:00
Luis Alvarez D e05f3a9112 Capitalize Data Fetching title in docs (#18001)
Noticed that most of our mentions to Data Fetching are capitalized in both words, but the page itself wasn't. And it's not consistent with the titles in other sections
2020-10-19 01:31:40 +00:00
Greg Rickaby 5b1be2bb98 (docs) Fixes for "Migrating from Gatsby" doc (#17858)
Noticed there's an extra backslash in the example which causes an error. 

**EDIT:**

Also the promise needs to be resolved using `.toString()` before it can be returned as `content` in props.
2020-10-14 03:01:38 +00:00
José Antonio Chio 7f798215b5 Add use-npm CLI flag docs (#17803)
Related issue: https://github.com/vercel/next.js/issues/10647#issuecomment-623703149

Sometimes we have both Yarn and NPM installed and want to explicitly bootstrap an app with the CLI using NPM. Having this flag documented could help people understand the package manager behavior and select NPM if that's their preference.
2020-10-13 19:40:29 +00:00
GP f1b3818dad docs: Clarify use of getStaticProps / getServerSideProps with app / document (#17839)
Fixes https://github.com/vercel/next.js/issues/17828.

This change adds a caveat to both the "Custom `App`" and "Custom `Document`" pages about how both `getStaticProps` and `getServerSideProps` aren't supported.
2020-10-13 19:17:47 +00:00
Amir Ali d73b34c3fd Fix higherOrderComponent causing broken layout (#17812)
`higherOrderComponent(WrappedComponent)` causing the layout broken in mobile screen. 
* refer to screenshots below.


![image](https://user-images.githubusercontent.com/43801058/95730641-faaa6c80-0c97-11eb-9951-2a47b61cefad.png)
![image](https://user-images.githubusercontent.com/43801058/95730661-0138e400-0c98-11eb-9f02-b4d0676fd21b.png)

if we could make it `HOC(WrappedComponent)` it will not break the layout in mobile screen
![image](https://user-images.githubusercontent.com/43801058/95730673-04cc6b00-0c98-11eb-8782-2fa1f760f8fd.png)
2020-10-13 18:55:21 +00:00
SaintMalik 22f91bb355 Fix broken url caused in docs (#17789)
### Description

Easy navigation and easy reading for others.
2020-10-11 11:02:33 +00:00
Adebiyi Adedotun ee97bc1b20 Fix grammatical typo in docs (#17779)
A URL is correct, not An URL
2020-10-11 06:41:40 +00:00
Jashn Maloo 7dec91175c change anonymous functions to named in docs examples (#17510)
Fixes #17200
2020-10-05 21:16:47 +00:00
Lee Robinson 1659e4da61 Update migrating from Gatsby docs. (#17636)
Addresses remaining comments from https://github.com/vercel/next.js/pull/17491.
2020-10-05 20:20:26 +00:00
Lee Robinson 06a8b1ad67 Add docs on how to migrate from Gatsby. (#17491)
Addresses https://github.com/vercel/next.js/issues/17453.
2020-10-05 17:39:00 +00:00
Joris W f8aeaa479e Add missing introductory exportPathMap purpose description (#17444)
The page describing exportPathMap goes straight into an example without explaining what the config is for.
2020-10-03 14:50:37 +00:00
Yann Pringault 75a0ef9cc2 [docs] Fix typo Next.js -> TypeScript (#17561) 2020-10-02 10:27:38 -05:00
JJ Kasper 05fb9df06d Add note about priority to rewrites docs (#17535)
This adds a note about public files and pages taking higher priority over rewrites causing them to not be able to be rewritten unless the files are renamed first since this has been asked a few times. 

x-ref: https://github.com/vercel/next.js/discussions/17513
x-ref: https://github.com/vercel/next.js/discussions/9081#discussioncomment-22077
x-ref: https://github.com/vercel/next.js/discussions/9081#discussioncomment-21995
2020-10-02 07:37:46 +00:00
Lee Robinson fa244ef833 Mention favicon.ico in static file serving docs. (#17540) 2020-10-01 21:14:14 +00:00
Luis Alvarez D 816798569a Mention required version for global CSS imports in node_modules (#17506)
Fixes https://github.com/vercel/next.js/issues/17505
2020-10-01 08:58:22 +00:00
Sam Robbins c45497e1c3 Remove reference to now env example (#17341)
The example has been emptied as it is no longer the recommended way to do it so it shouldn't be linked to
2020-09-24 18:30:39 +00:00
Gergo Tolnai 8fdb93d76f Docs(api-middlewares): use typings for serialize options from @types/cookie (#17285) 2020-09-22 18:52:29 +00:00
Luis Alvarez D beeeba099b Rename exportTrailingSlash to trailingSlash in docs (#17268) 2020-09-22 12:10:10 +02:00
GH Lee 92b20c8a1e Update cdn-support-with-asset-prefix.md (#17237)
Modified paths to absolute paths.
- Deploying to Vercel
- Base path
2020-09-20 21:33:02 -05:00
Daniel Lauzon 571f8bedf7 Update trailingSlash parameter name (#17228)
Reflect the change in `trailingSlash` parameter name.

I found this because of the great warning on the build!
```
Warning: The "exportTrailingSlash" option has been renamed to "trailingSlash". Please update your next.config.js.
```
2020-09-19 19:13:26 +00:00
Dan Laugharn 5f16e063a6 Adds note about public directory (#17203)
This comes up a lot in discussions/as an issue, so added a small comment about uploading files to the public directory. I'm not sure if it is worth a deeper technical explanation as well.
2020-09-18 15:02:37 +00:00
Luis Alvarez D 4ba768e22c Add missing comma in docs example (#17129)
Including prettier changes that were done automatically after the code sample became valid.
2020-09-16 01:04:58 +00:00
JJ Kasper d3f4a4cb2a Provide resolvedUrl to getServerSideProps (#17082)
This continues off of https://github.com/vercel/next.js/pull/17081 and provides this normalized `asPath` value in the context provided to `getServerSideProps` to provide the consistent value since the request URL can vary between direct visit and client transition and the alternative requires building the URL each time manually. 

Kept this change separate from https://github.com/vercel/next.js/pull/17081 since this is addressing a separate issue and allows discussion separately. 

Closes: https://github.com/vercel/next.js/issues/16407
2020-09-14 21:01:04 +00:00
Vincent Voyer 71c5ab629e docs(babelrc): precise usage without configuring plugins (#16779) 2020-09-12 01:16:24 -04:00
Vahid Hallaji d4a8d4fc88 fix gtag syntax in measuring docs (#16933) 2020-09-12 01:15:40 -04:00
Jonathan Svenheden 6659334930 Update build time env variable link in the runtime config section (#17017)
Since [the current link](https://nextjs.org/docs/api-reference/next.config.js/environment-variables) for the build-time environment variables docs recommends the approach outlined in [this section](https://nextjs.org/docs/basic-features/environment-variables), I think the link should point there instead.
2020-09-12 04:29:18 +00:00
Joe Haddad 6ecb740415 Improve Asset Prefix Docs (#16998)
Fixes #16444
2020-09-10 13:46:37 -04:00
Joe Haddad fa9523c063 Document CSS Grid Better (#16996)
Fixes #10508
2020-09-10 13:46:14 -04:00
Joe Haddad 1ea6745106 Importing CSS from Third Party React Components (#16993) 2020-09-10 13:45:30 -04:00
Turcan Vladimir b227691942 Fix align documentation with the code (#16843) 2020-09-08 12:29:42 -04:00
Luis Alvarez D ea2df6c0c2 Update link docs to reflect changes on dynamic routing (#16634)
Closes https://github.com/vercel/next.js/issues/16633

- The docs and examples that use `as` have been updated to show how `href` can be used to get the same results
- Added new examples and provided more details on current examples for more details on how `href` can be used.

**Note:** With this change the usage of `as` becomes completely unrequired as I failed to find a good use case for it. Therefore documentation for `as` now includes: `Used for dynamic routes before Next.js 9.5.3`. But that should link to somewhere, either to a blog post or to the Upgrade Guide in our docs.
2020-09-07 16:35:30 +00:00
Luis Alvarez D b5cf3e4c94 Update dynamic-import docs (#16803)
Goals of this PR:

- Explain `import()` first without mentioning `next/dynamic`, because `next/dynamic` in our API and **Dynamic Import** is a ES feature. This should avoid a common confusion in our users thinking that one can't be used without the other.
- Mention how `next/dynamic` can be used with **Dynamic Imports** to load react components.
- Updated example to include fuzzy search using a dynamic import.

Potential change: Leave the page to be about `import()` and move `next/dynamic` to the API reference (alongside `next/link`, `next/router`, etc.)

Closes https://github.com/vercel/next.js/pull/16299
Closes https://github.com/vercel/next.js/issues/15711
2020-09-05 23:45:30 +00:00
Yichi Zhang 9e4bb5a129 Add Fast Refresh Demo (#16576)
Closes #16538 

Basically reverts #16497 and some minor changes. Also adds a link in the docs.

This reverts commit ec281df70b.
2020-09-01 23:27:57 +00:00
Luis Alvarez D f1c4cb8b3b Update preview mode docs to include API Routes (#16705)
Fixes https://github.com/vercel/next.js/issues/16661
2020-08-31 03:02:24 +00:00
Balázs Orbán d6188a8e33 Clarify sending to Google Analytics in reportWebVitals (#16664)
Clarifies #16662

Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-08-29 22:31:57 -04:00
Sam Robbins 8217597848 Add activeClassName to Link examples (#16658)
Allows people to more easily find how to style active links if they are wanting to
2020-08-28 19:03:40 +00:00
Rich Paret 5bda90f87b Include yarn instructions (#16565)
* Include yarn instructions

Yarn seems like it's encouraged elsewhere (such as in create-next-app docs), so adding this to clarify it's supported here.

* Added to a similar case

Co-authored-by: Luis Alvarez D <luis@vercel.com>
2020-08-27 21:27:34 -05:00
Christian Pena Valerio fc5f26b556 Fix github docs links (#16540)
Take care of the other links that aren't working while browsing github. Related to: #16505
2020-08-25 04:31:48 +00:00
Ondřej Chrastina a856097402 Add Kontent example (#16034)
Hello everyone!

I would like to add the example using [Kentico Kontent](https://kontent.ai) as a data source for your example.
I have tried to be consistent with the other examples and showcase the preview as well.

I have tried to keep up with [Contribution guidelines](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples).

Thank you.
2020-08-24 22:58:53 +00:00
Christian Pena Valerio c9ad33bd59 Update fast-refresh.md to fix 404 link (#16505) 2020-08-24 09:58:13 -05:00