如何在React-Snap中制作多语言网站

时间:2018-11-27 16:05:49

标签: reactjs seo react-component react-helmet react-snap

我有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"
          ]
      }
    }
}

0 个答案:

没有答案