From e2852b481a8ee950a5e43355988edd31995b9531 Mon Sep 17 00:00:00 2001 From: Eddy Zhou Date: Wed, 29 May 2024 22:38:49 -0700 Subject: [PATCH] please --- .github/workflows/build_and_deploy.yml | 13 ++++---- .github/workflows/preview.yml | 13 ++++---- next.config.js | 43 +++++--------------------- 3 files changed, 19 insertions(+), 50 deletions(-) diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index 8509b61..ff3aa93 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -11,20 +11,19 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Use Node.js 21 + - name: Use Node.js 22 uses: actions/setup-node@v3 with: - node-version: '21' - - - name: Install dependencies - run: npm install + node-version: '22' - name: Run export - run: npm run export + run: | + npm install + npm run export - name: Deploy to GitHub Pages if: success() - uses: peaceiris/actions-gh-pages@v3 + uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./out diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index ea99280..e524eba 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -13,19 +13,18 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - - name: Set up Node.js + - name: Set up Node.js 22 uses: actions/setup-node@v3 with: - node-version: '21' # Specify the version of Node.js you need - - - name: Install dependencies - run: npm install + node-version: '22' # Specify the version of Node.js you need - name: Run export - run: npm run export + run: | + npm install + npm run export - name: Deploy to GitHub Pages Preview - uses: peaceiris/actions-gh-pages@v3 + uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./out diff --git a/next.config.js b/next.config.js index d94d926..a426202 100644 --- a/next.config.js +++ b/next.config.js @@ -1,40 +1,11 @@ -// Original Next.js config +const withNextra = require("nextra")({ + theme: "nextra-theme-docs", + themeConfig: "./theme.config.tsx", +}); + module.exports = { - reactStrictMode: true, - output: 'export', + ...withNextra(), images: { - // output: export doesn't support Next.js image optimization unoptimized: true, }, - // Next.js doesn't support trailing slashes in basePath - // This config needs to be in sync with export-images.config.js - basePath: (process.env.WEBSITE_BASE_PATH || '').replace(/\/$/, ""), - webpack: (config) => { - // Add Typescript support - // Reference: https://www.altogic.com/blog/nextjs-typescript - config.resolve.extensions.push(".ts", ".tsx"); - return config; - }, - eslint: { - dirs: [ - 'pages', - 'src', - 'app', - 'components', - 'lib', - 'theme.config.jsx', - "tailwind.config.js", - "next.config.js", - "postcss.config.js", - ] - } -} - -// Add Nextra config -const withNextra = require('nextra')({ - theme: 'nextra-theme-docs', - themeConfig: './theme.config.tsx', - latex: true, // LaTeX support: https://nextra.site/docs/guide/advanced/latex -}); - -module.exports = withNextra(module.exports) +};