Compare commits

...

3 Commits

Author SHA1 Message Date
RadekSabacky 191240da2e + basepath env into image src 2025-07-08 13:48:08 +02:00
RadekSabacky 68ddf095b4 / remove /explorer from image src 2025-07-08 12:47:25 +02:00
RadekSabacky e873121cc2 / base path as env variable 2025-07-08 12:38:49 +02:00
6 changed files with 12 additions and 9 deletions
+6 -3
View File
@@ -1,11 +1,14 @@
// @ts-check // @ts-check
/** @type {import('next').NextConfig} */ /** @type {import('next').NextConfig} */
const { NEXT_PUBLIC_EXPLORER_BASEPATH } = process.env;
const nextConfig = { const nextConfig = {
reactStrictMode: true, reactStrictMode: true,
basePath: "/explorer", basePath: `/${NEXT_PUBLIC_EXPLORER_BASEPATH}`,
assetPrefix: "/explorer", assetPrefix: `/${NEXT_PUBLIC_EXPLORER_BASEPATH}`,
trailingSlash: false, trailingSlash: false,
async redirects() { async redirects() {
@@ -13,7 +16,7 @@ const nextConfig = {
// Change the basePath to /explorer // Change the basePath to /explorer
{ {
source: "/", source: "/",
destination: "/explorer", destination: `/${NEXT_PUBLIC_EXPLORER_BASEPATH}`,
basePath: false, basePath: false,
permanent: true, permanent: true,
}, },
@@ -17,7 +17,7 @@ export default async function BlogPage({
params: Promise<{ slug: string }>; params: Promise<{ slug: string }>;
}) { }) {
const { slug } = await params; const { slug } = await params;
const { NEXT_PUBLIC_EXPLORER_BASEPATH } = process.env;
try { try {
const blogArticle: BlogArticle = await import(`@/data/${slug}.json`); const blogArticle: BlogArticle = await import(`@/data/${slug}.json`);
@@ -87,7 +87,7 @@ export default async function BlogPage({
</Typography> </Typography>
</Box> </Box>
<Image <Image
src={blogArticle.image} src={`/${NEXT_PUBLIC_EXPLORER_BASEPATH}${blogArticle.image}`}
alt="blog-image" alt="blog-image"
width={120} width={120}
height={60} height={60}
@@ -10,7 +10,7 @@
}, },
"iconLight": "explorerCard", "iconLight": "explorerCard",
"iconDark": "explorerCardDark", "iconDark": "explorerCardDark",
"image": "/explorer/images/Network.webp", "image": "/images/Network.webp",
"overview": { "overview": {
"content": [ "content": [
{ {
+1 -1
View File
@@ -10,7 +10,7 @@
}, },
"iconLight": "gateway", "iconLight": "gateway",
"iconDark": "gatewayDark", "iconDark": "gatewayDark",
"image": "/explorer/images/placeholder.webp", "image": "/images/placeholder.webp",
"overview": { "overview": {
"content": [ "content": [
{ {
+1 -1
View File
@@ -10,7 +10,7 @@
}, },
"iconLight": "gateway", "iconLight": "gateway",
"iconDark": "gatewayDark", "iconDark": "gatewayDark",
"image": "/explorer/images/placeholder.webp", "image": "/images/placeholder.webp",
"overview": { "overview": {
"content": [ "content": [
{ {
+1 -1
View File
@@ -10,7 +10,7 @@
}, },
"iconLight": "stakeCard", "iconLight": "stakeCard",
"iconDark": "stakeCardDark", "iconDark": "stakeCardDark",
"image": "/explorer/images/stake-article.webp", "image": "/images/stake-article.webp",
"overview": { "overview": {
"content": [ "content": [
{ {