Skip to content

Commit

Permalink
fix: redirect to community page doesn't trigger page reload anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
ewan-escience committed Jul 17, 2024
1 parent 94405d6 commit 826c25d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
15 changes: 15 additions & 0 deletions frontend/middleware.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// SPDX-FileCopyrightText: 2024 Ewan Cahen (Netherlands eScience Center) <e.cahen@esciencecenter.nl>
// SPDX-FileCopyrightText: 2024 Netherlands eScience Center
//
// SPDX-License-Identifier: Apache-2.0

import {NextResponse} from 'next/server'
import type {NextRequest} from 'next/server'

export function middleware(request: NextRequest) {
return NextResponse.redirect(request.url + '/software')
}

export const config = {
matcher: '/communities/:path/',
}
13 changes: 1 addition & 12 deletions frontend/next.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: 2021 - 2023 Dusan Mijatovic (dv4all)
// SPDX-FileCopyrightText: 2021 - 2023 dv4all
// SPDX-FileCopyrightText: 2022 - 2024 Ewan Cahen (Netherlands eScience Center) <e.cahen@esciencecenter.nl>
// SPDX-FileCopyrightText: 2022 - 2024 Netherlands eScience Center
// SPDX-FileCopyrightText: 2022 Ewan Cahen (Netherlands eScience Center) <e.cahen@esciencecenter.nl>
// SPDX-FileCopyrightText: 2022 Jesús García Gonzalez (Netherlands eScience Center) <j.g.gonzalez@esciencecenter.nl>
// SPDX-FileCopyrightText: 2023 - 2024 Dusan Mijatovic (Netherlands eScience Center)
//
Expand Down Expand Up @@ -39,17 +39,6 @@ module.exports = {
]
},

async redirects() {
return [
// default community redirect to software page
{
source: '/communities/:slug',
destination: '/communities/:slug/software',
permanent: true,
}
]
},

webpack(config) {
config.module.rules.push({
test: /\.svg$/i,
Expand Down

0 comments on commit 826c25d

Please sign in to comment.