Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,19 @@ import { createMDX } from "fumadocs-mdx/next";

const withMDX = createMDX();

const isProd = process.env.NODE_ENV === "production";
const isGitHubPages = process.env.PAGES_BASE_PATH !== undefined;
const basePath = isProd && isGitHubPages ? process.env.PAGES_BASE_PATH : "";
const BASE_PATH = "/docs/hardware";

/** @type {import('next').NextConfig} */
const config = {
output: "export",
trailingSlash: true,
reactStrictMode: true,
...(basePath && {
basePath: basePath,
assetPrefix: basePath,
}),
images: {
unoptimized: true,
},
basePath: BASE_PATH,
env: {
NEXT_PUBLIC_BASE_PATH: basePath,
NEXT_PUBLIC_BASE_PATH: BASE_PATH,
},
};

Expand Down
3 changes: 3 additions & 0 deletions public/_redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/ /docs/hardware/ 301
/docs/hardware/_next/* /_next/:splat 200
/docs/hardware/* /:splat 200
2 changes: 1 addition & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const rubik = Rubik({
});

const baseUrl =
process.env.NEXT_PUBLIC_BASE_URL || "https://hardware.absmach.eu";
process.env.NEXT_PUBLIC_BASE_URL || "https://absmach.eu/docs/hardware";

export const metadata: Metadata = {
metadataBase: new URL(baseUrl),
Expand Down
2 changes: 1 addition & 1 deletion src/app/robots.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { MetadataRoute } from "next";

const baseUrl =
process.env.NEXT_PUBLIC_BASE_URL || "https://hardware.absmach.eu";
process.env.NEXT_PUBLIC_BASE_URL || "https://absmach.eu/docs/hardware";

export const dynamic = "force-static";

Expand Down
2 changes: 1 addition & 1 deletion src/app/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { MetadataRoute } from "next";
import { source } from "@/lib/source";

const baseUrl =
process.env.NEXT_PUBLIC_BASE_URL || "https://hardware.absmach.eu";
process.env.NEXT_PUBLIC_BASE_URL || "https://absmach.eu/docs/hardware";

export const dynamic = "force-static";

Expand Down
Loading