Skip to content

Commit ebc3c58

Browse files
author
Dan Costello
committed
WIP
1 parent 71236bb commit ebc3c58

File tree

4 files changed

+11
-14
lines changed

4 files changed

+11
-14
lines changed

app/(home)/page.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import Link from "next/link";
22
import Image from "next/image";
3-
import { BASE_PATH } from "@/app/utils/constants";
43

54
export default function HomePage() {
65
return (
76
<main className="flex flex-1 flex-col items-center justify-center py-20 text-center px-4">
87
<div className="mb-10 flex flex-col items-center gap-y-6">
98
<Image
10-
src={`${BASE_PATH}/logo.png`}
9+
src={`${process.env.pathPrefix}/logo.png`}
1110
alt="UserClouds Logo"
1211
width={240}
1312
height={33}

app/layout.config.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import type { BaseLayoutProps } from "fumadocs-ui/layouts/shared";
22
import Image from "next/image";
3-
import { BASE_PATH } from "@/app/utils/constants";
43

54
/**
65
* Shared layout configurations
@@ -15,7 +14,7 @@ export const baseOptions: BaseLayoutProps = {
1514
title: (
1615
<>
1716
<Image
18-
src={`${BASE_PATH}/logo.png`}
17+
src={`${process.env.pathPrefix}/logo.png`}
1918
width={160}
2019
height={22}
2120
alt="UserClouds logo"

app/utils/constants.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

next.config.mjs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
import { createMDX } from "fumadocs-mdx/next";
22
const withMDX = createMDX();
33

4-
const isProd = process.env.NODE_ENV === "production";
4+
const pathPrefix =
5+
process.env.NODE_ENV === "production"
6+
? process.env.NEXT_PUBLIC_BASE_PATH || "./"
7+
: "";
8+
59
/** @type {import('next').NextConfig} */
610
const config = {
711
reactStrictMode: true,
812
output: "export",
9-
assetPrefix: isProd ? (process.env.NEXT_PUBLIC_ASSET_PREFIX ?? "./") : "",
10-
basePath: isProd
11-
? (process.env.NEXT_PUBLIC_BASE_PATH ?? `${process.env.PWD}/out` ?? "")
12-
: "",
13+
assetPrefix: pathPrefix,
14+
env: {
15+
pathPrefix,
16+
},
1317
trailingSlash: true,
1418
images: {
1519
unoptimized: true,

0 commit comments

Comments
 (0)