mirror of
https://github.com/netbirdio/docs.git
synced 2026-04-16 15:36:36 +00:00
Redirect static files to a prefixed path
This commit is contained in:
@@ -2,7 +2,6 @@ import nextMDX from '@next/mdx'
|
||||
import { remarkPlugins } from './mdx/remark.mjs'
|
||||
import { rehypePlugins } from './mdx/rehype.mjs'
|
||||
import { recmaPlugins } from './mdx/recma.mjs'
|
||||
import rehypeSlug from "rehype-slug";
|
||||
|
||||
const withMDX = nextMDX({
|
||||
options: {
|
||||
@@ -14,8 +13,10 @@ const withMDX = nextMDX({
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
assetPrefix: '/docs-static',
|
||||
reactStrictMode: true,
|
||||
pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'mdx'],
|
||||
experimental: {
|
||||
|
||||
10
src/middleware.js
Normal file
10
src/middleware.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
export function middleware(req) {
|
||||
if (req.nextUrl.href.includes('/docs-static/_next/'))
|
||||
return NextResponse.rewrite(
|
||||
req.nextUrl.href.replace('/docs-static/_next/', '/_next/'),
|
||||
);
|
||||
|
||||
return null;
|
||||
}
|
||||
Reference in New Issue
Block a user