Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[examples] Fix next.js AMP support #20463

Merged
merged 2 commits into from
Apr 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/pages/_document.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { ServerStyleSheets } from '@material-ui/styles';
import Document, { Head, Main, NextScript } from 'next/document';
import Document, { Html, Head, Main, NextScript } from 'next/document';
import { rewriteUrlForNextExport } from 'next/dist/next-server/lib/router/rewrite-url-for-export';
import { LANGUAGES_SSR } from 'docs/src/modules/constants';
import { pathnameToLanguage } from 'docs/src/modules/utils/helpers';
Expand Down Expand Up @@ -33,7 +33,7 @@ export default class MyDocument extends Document {
const { canonical, userLanguage } = this.props;

return (
<html lang={userLanguage}>
<Html lang={userLanguage}>
<Head>
{/*
manifest.json provides metadata used when your web app is added to the
Expand Down Expand Up @@ -92,7 +92,7 @@ export default class MyDocument extends Document {
/>
<NextScript />
</body>
</html>
</Html>
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions examples/nextjs-with-typescript/pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from 'react';
import Document, { Head, Main, NextScript } from 'next/document';
import Document, { Html, Head, Main, NextScript } from 'next/document';
import { ServerStyleSheets } from '@material-ui/core/styles';
import theme from '../src/theme';

export default class MyDocument extends Document {
render() {
return (
<html lang="en">
<Html lang="en">
<Head>
{/* PWA primary color */}
<meta name="theme-color" content={theme.palette.primary.main} />
Expand All @@ -19,7 +19,7 @@ export default class MyDocument extends Document {
<Main />
<NextScript />
</body>
</html>
</Html>
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions examples/nextjs/pages/_document.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from 'react';
import Document, { Head, Main, NextScript } from 'next/document';
import Document, { Html, Head, Main, NextScript } from 'next/document';
import { ServerStyleSheets } from '@material-ui/core/styles';
import theme from '../src/theme';

export default class MyDocument extends Document {
render() {
return (
<html lang="en">
<Html lang="en">
<Head>
{/* PWA primary color */}
<meta name="theme-color" content={theme.palette.primary.main} />
Expand All @@ -19,7 +19,7 @@ export default class MyDocument extends Document {
<Main />
<NextScript />
</body>
</html>
</Html>
);
}
}
Expand Down