未验证 提交 82d5eec7 编写于 作者: J JJ Kasper 提交者: GitHub

Add identifier for Next.js AMP pages (#7485)

上级 3245a573
......@@ -496,7 +496,10 @@ export async function renderToHTML(
if (amphtml && html) {
// 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)
if (renderOpts.ampValidator) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册