我有http://demo.com/,http://demo.de/,http://demo.nl/和http://demo.dk/之类的多语言网站,这些网站是通过 react-snap
完成的不幸的是,SEO仅呈现demo.de
元数据
是否可以在react-snap中使用多语言网站?
index.js
const MOUNT_NODE = document.getElementById('app')
const appStructure = <Provider store={store}>
<LanguageProvider>
<ConnectedRouter history={history}>
<ThemeProvider theme={theme}>
<ABDecider>
<App />
</ABDecider>
</ThemeProvider>
</ConnectedRouter>
</LanguageProvider>
</Provider>
const render = () => {
if (MOUNT_NODE.hasChildNodes()) {
ReactDOM.hydrate(
appStructure,
MOUNT_NODE
)
} else {
ReactDOM.render(
appStructure,
MOUNT_NODE
)
}
}
package.json
"reactSnap": {
"source": "dist",
"crawl": false,
"include": [
"/",
"/friends"
]
}
}
}