From 2b733ade4414b8a31ed0668e91b5307ec90c0937 Mon Sep 17 00:00:00 2001 From: Aditya Thakral Date: Mon, 7 Jun 2021 21:51:02 -0400 Subject: [PATCH] Use NEXT_PUBLIC_ prefix for base path --- .gitlab-ci.yml | 4 ++-- components/Image.tsx | 2 +- next.config.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7c9f2af0..55e2e5a6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,7 +11,7 @@ stages: - staging variables: - BASE_PATH: '/~a3thakra/csc' + NEXT_PUBLIC_BASE_PATH: '/~a3thakra/csc' install_deps: stage: .pre @@ -43,7 +43,7 @@ deploy_staging: stage: .post needs: ["staging"] script: - - 'curl -XPOST -H "Authorization: Basic $STAGING_SECRET" "https://csclub.uwaterloo.ca/$BASE_PATH"' + - 'curl -XPOST -H "Authorization: Basic $STAGING_SECRET" "https://csclub.uwaterloo.ca/~a3thakra/csc/"' only: refs: - main \ No newline at end of file diff --git a/components/Image.tsx b/components/Image.tsx index 020233d2..cc913deb 100644 --- a/components/Image.tsx +++ b/components/Image.tsx @@ -3,7 +3,7 @@ import React, { ImgHTMLAttributes } from "react"; export function Image(props: ImgHTMLAttributes) { const { src: relativeSrc = "" } = props; - let absoluteSrc = process.env.BASE_PATH ?? "/"; + let absoluteSrc = process.env.NEXT_PUBLIC_BASE_PATH ?? "/"; if (absoluteSrc.endsWith("/") && relativeSrc.startsWith("/")) { absoluteSrc += relativeSrc.slice(1); } else if (absoluteSrc.endsWith("/") || relativeSrc.startsWith("/")) { diff --git a/next.config.js b/next.config.js index 30e33dc0..0c22d34a 100644 --- a/next.config.js +++ b/next.config.js @@ -5,5 +5,5 @@ const withMDX = require("@next/mdx")({ module.exports = withMDX({ pageExtensions: ["ts", "tsx", "mdx"], trailingSlash: true, - basePath: process.env.BASE_PATH, + basePath: process.env.NEXT_PUBLIC_BASE_PATH, });