Use NEXT_PUBLIC_ prefix for base path
This commit is contained in:
parent
66f9d93d8e
commit
2b733ade44
|
@ -11,7 +11,7 @@ stages:
|
||||||
- staging
|
- staging
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
BASE_PATH: '/~a3thakra/csc'
|
NEXT_PUBLIC_BASE_PATH: '/~a3thakra/csc'
|
||||||
|
|
||||||
install_deps:
|
install_deps:
|
||||||
stage: .pre
|
stage: .pre
|
||||||
|
@ -43,7 +43,7 @@ deploy_staging:
|
||||||
stage: .post
|
stage: .post
|
||||||
needs: ["staging"]
|
needs: ["staging"]
|
||||||
script:
|
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:
|
only:
|
||||||
refs:
|
refs:
|
||||||
- main
|
- main
|
|
@ -3,7 +3,7 @@ import React, { ImgHTMLAttributes } from "react";
|
||||||
export function Image(props: ImgHTMLAttributes<HTMLImageElement>) {
|
export function Image(props: ImgHTMLAttributes<HTMLImageElement>) {
|
||||||
const { src: relativeSrc = "" } = props;
|
const { src: relativeSrc = "" } = props;
|
||||||
|
|
||||||
let absoluteSrc = process.env.BASE_PATH ?? "/";
|
let absoluteSrc = process.env.NEXT_PUBLIC_BASE_PATH ?? "/";
|
||||||
if (absoluteSrc.endsWith("/") && relativeSrc.startsWith("/")) {
|
if (absoluteSrc.endsWith("/") && relativeSrc.startsWith("/")) {
|
||||||
absoluteSrc += relativeSrc.slice(1);
|
absoluteSrc += relativeSrc.slice(1);
|
||||||
} else if (absoluteSrc.endsWith("/") || relativeSrc.startsWith("/")) {
|
} else if (absoluteSrc.endsWith("/") || relativeSrc.startsWith("/")) {
|
||||||
|
|
|
@ -5,5 +5,5 @@ const withMDX = require("@next/mdx")({
|
||||||
module.exports = withMDX({
|
module.exports = withMDX({
|
||||||
pageExtensions: ["ts", "tsx", "mdx"],
|
pageExtensions: ["ts", "tsx", "mdx"],
|
||||||
trailingSlash: true,
|
trailingSlash: true,
|
||||||
basePath: process.env.BASE_PATH,
|
basePath: process.env.NEXT_PUBLIC_BASE_PATH,
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue