不需要修改WordPress就可以使用使用.
<a href="http://react.wordpress.femirror.com/">WordPress 背景示範</a>
賬号 guest 密碼 guest (會定時清理資料庫和媒體庫)
<a href="http://rw.femirror.com/">React 前台示範</a>
<a href="https://github.com/tyaqing/react-wordpress#%E7%89%B9%E6%80%A7">特性</a>
1 使用WordPress做内容管理,React重寫前端.
2 使用dva建構React項目,dva内置React全家桶.
3 使用少部分antd元件,為後期更疊.
<a href="https://github.com/tyaqing/react-wordpress#%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E">使用說明</a>
首頁的幻燈片是讀取有特色圖頁面的資料
導航會依照有文章的分類自動生成
<a href="https://github.com/tyaqing/react-wordpress#%E8%B0%83%E8%AF%95">調試</a>
$ npm install
$ npm start
如果顯示缺失dll.js 檔案請執行
$ npm run build:dll
<a href="https://github.com/tyaqing/react-wordpress#%E6%9E%84%E5%BB%BA">建構</a>
$ npm run build
<a href="https://github.com/tyaqing/react-wordpress#%E9%83%A8%E7%BD%B2">部署</a>
<a href="https://github.com/tyaqing/react-wordpress#nginx">Nginx</a>
<a href="https://github.com/tyaqing/react-wordpress#%E8%B7%A8%E5%9F%9F%E9%97%AE%E9%A2%98">跨域問題</a>
我是使用nginx做API代理,配置如下
location /api/ {
proxy_pass http://react.wordpress.femirror.com/;
}
<a href="https://github.com/tyaqing/react-wordpress#%E8%B7%AF%E7%94%B1%E9%97%AE%E9%A2%98">路由問題</a>
在正式環境下重新整理可能會出現路由重定向問題,配置以下内容即可
location / {
try_files $uri /index.html;