Skip to content

Commit

Permalink
[docs] Improve Next.js usage (#19075)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisweb authored and oliviertassinari committed Jan 4, 2020
1 parent baab8d5 commit 157404d
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 20 deletions.
5 changes: 0 additions & 5 deletions docs/pages/_document.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ export default class MyDocument extends Document {
return (
<html lang={userLanguage}>
<Head>
{/* Use minimum-scale=1 to enable GPU rasterization. */}
<meta
name="viewport"
content="minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no"
/>
{/*
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
Expand Down
5 changes: 5 additions & 0 deletions docs/src/modules/components/Head.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ export default function Head(props) {

return (
<NextHead>
{/* Use minimum-scale=1 to enable GPU rasterization. */}
<meta
name="viewport"
content="minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no"
/>
<title>{title}</title>
<meta name="description" content={description} />
{/* Twitter */}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="viewport" content="minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no" />
<meta name="theme-color" content="#000000" />
<!--
manifest.json provides metadata used when your web app is installed on a
Expand Down
2 changes: 1 addition & 1 deletion examples/create-react-app/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="viewport" content="minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no" />
<meta name="theme-color" content="#000000" />
<!--
manifest.json provides metadata used when your web app is installed on a
Expand Down
4 changes: 4 additions & 0 deletions examples/nextjs-with-typescript/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ export default class MyApp extends App {
<React.Fragment>
<Head>
<title>My page</title>
<meta
name="viewport"
content="minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no"
/>
</Head>
<ThemeProvider theme={theme}>
{/* CssBaseline kickstart an elegant, consistent, and simple baseline to build upon. */}
Expand Down
5 changes: 0 additions & 5 deletions examples/nextjs-with-typescript/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ export default class MyDocument extends Document {
return (
<html lang="en">
<Head>
<meta charSet="utf-8" />
<meta
name="viewport"
content="minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no"
/>
{/* PWA primary color */}
<meta name="theme-color" content={theme.palette.primary.main} />
<link
Expand Down
4 changes: 4 additions & 0 deletions examples/nextjs/pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ export default class MyApp extends App {
<React.Fragment>
<Head>
<title>My page</title>
<meta
name="viewport"
content="minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no"
/>
</Head>
<ThemeProvider theme={theme}>
{/* CssBaseline kickstart an elegant, consistent, and simple baseline to build upon. */}
Expand Down
5 changes: 0 additions & 5 deletions examples/nextjs/pages/_document.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ export default class MyDocument extends Document {
return (
<html lang="en">
<Head>
<meta charSet="utf-8" />
<meta
name="viewport"
content="minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no"
/>
{/* PWA primary color */}
<meta name="theme-color" content={theme.palette.primary.main} />
<link
Expand Down
2 changes: 1 addition & 1 deletion examples/preact/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
content="minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no"
/>
<meta name="theme-color" content="#000000" />
<!--
Expand Down
3 changes: 1 addition & 2 deletions examples/ssr/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ function renderFullPage(html, css) {
<head>
<title>My page</title>
<style id="jss-server-side">${css}</style>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<!-- Fonts to support Material Design -->
<meta name="viewport" content="minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
</head>
<body>
Expand Down

0 comments on commit 157404d

Please sign in to comment.