From 033b4c7ffec829325f454363ae87b866f31ba2ed Mon Sep 17 00:00:00 2001 From: Mat Jordan Date: Fri, 18 Aug 2023 11:56:10 -0400 Subject: [PATCH] Update basePath for GitHub pages. Co-authored-by: Michael B. Klein --- .github/workflows/docs.yml | 2 ++ docs/next.config.js | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index caded30..83c93e7 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -40,6 +40,8 @@ jobs: run: npm install - name: Build with Next.js run: npx --no-install next build + env: + NEXTJS_BASE_PATH: "/serverless-iiif" - name: Upload artifact uses: actions/upload-pages-artifact@v2 with: diff --git a/docs/next.config.js b/docs/next.config.js index 9f2aa7f..414e970 100644 --- a/docs/next.config.js +++ b/docs/next.config.js @@ -4,10 +4,11 @@ const withNextra = require('nextra')({ }); module.exports = withNextra({ - output: 'export', + basePath: process.env.NEXTJS_BASE_PATH || '', images: { unoptimized: true - } + }, + output: 'export' }); // If you have other Next.js configurations, you can pass them as the parameter: