feat: set basePath via config

This commit is contained in:
Mathias Schopmans
2024-03-05 09:50:27 +01:00
committed by Mathias Schopmans
parent 6dd5d5c017
commit a9561a55b4
5 changed files with 18 additions and 11 deletions

View File

@@ -1,4 +1,5 @@
{
"basePath": "/techradar",
"colors": {
"foreground": "#fff",
"background": "#173d7a",

15
next.config.js Normal file
View File

@@ -0,0 +1,15 @@
// @ts-check
const config = require("./data/config.json");
const basePath =
config.basePath && config.basePath !== "/" ? config.basePath : "";
/** @type {import("next").NextConfig} */
const nextConfig = {
basePath,
output: "export",
trailingSlash: true,
reactStrictMode: true,
};
module.exports = nextConfig;

View File

@@ -1,9 +0,0 @@
/** @type {import("next").NextConfig} */
const nextConfig = {
output: "export",
// basePath: "/techradar",
trailingSlash: true,
reactStrictMode: true,
};
export default nextConfig;

View File

@@ -6,7 +6,7 @@ import { markedHighlight } from "marked-highlight";
import path from "path";
import config from "../data/config.json";
import nextConfig from "../next.config.mjs";
import nextConfig from "../next.config.js";
import Positioner from "./positioner";
import { Flag, Item } from "@/lib/types";

View File

@@ -1,6 +1,6 @@
import { type ClassValue, clsx } from "clsx";
import config from "../../next.config.mjs";
import config from "../../next.config.js";
export function cn(...inputs: ClassValue[]) {
return clsx(inputs);