Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
82d5eec7
Unverified
Commit
82d5eec7
authored
Jun 02, 2019
by
JJ Kasper
Committed by
GitHub
Jun 02, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add identifier for Next.js AMP pages (#7485)
parent
3245a573
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
render.tsx
packages/next-server/server/render.tsx
+4
-1
No files found.
packages/next-server/server/render.tsx
View file @
82d5eec7
...
@@ -496,7 +496,10 @@ export async function renderToHTML(
...
@@ -496,7 +496,10 @@ export async function renderToHTML(
if
(
amphtml
&&
html
)
{
if
(
amphtml
&&
html
)
{
// use replace to allow rendering directly to body in AMP mode
// use replace to allow rendering directly to body in AMP mode
html
=
html
.
replace
(
'__NEXT_AMP_RENDER_TARGET__'
,
docProps
.
html
)
html
=
html
.
replace
(
'__NEXT_AMP_RENDER_TARGET__'
,
`<!-- __NEXT_DATA__ -->
${
docProps
.
html
}
`
)
html
=
await
optimizeAmp
(
html
)
html
=
await
optimizeAmp
(
html
)
if
(
renderOpts
.
ampValidator
)
{
if
(
renderOpts
.
ampValidator
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment