diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 2f9172fa5fc..bae02421148 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -43,7 +43,7 @@ jobs: - run: | yarn install - run: | - yarn build --prefix-paths + PATH_PREFIX=${{ github.event.repository.name }} yarn build --prefix-paths - run: | cp -r assets/ public/static diff --git a/README.md b/README.md index d0f69834d0e..6d1b34d6da9 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +## 如果是之前 clone 或 Fork 的朋友 vercel 显示 404 可能需要更新下代码 +

diff --git a/gatsby-config.js b/gatsby-config.js index d35081f1382..63e7796eed6 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -1,5 +1,5 @@ module.exports = { - pathPrefix: '/', // Change to `/running_page` when running on github pages + pathPrefix: process.env.PATH_PREFIX || '/', siteMetadata: { siteTitle: 'Running Page', siteUrl: 'https://yihong.run', diff --git a/vercel.json b/vercel.json deleted file mode 100644 index c501cca8ee8..00000000000 --- a/vercel.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "rewrites": [{ "source": "/(.*)", "destination": "/index.html" }] -}