Use NEXT_PUBLIC_ prefix for base path
This commit is contained in:
parent
66f9d93d8e
commit
2b733ade44
|
@ -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
|
|
@ -3,7 +3,7 @@ import React, { ImgHTMLAttributes } from "react";
|
|||
export function Image(props: ImgHTMLAttributes<HTMLImageElement>) {
|
||||
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("/")) {
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue