mirror of
https://github.com/System-End/site.git
synced 2026-04-19 19:45:07 +00:00
as requested by @zachlatta in #hq in Slack, this deleted donate.js aka the page, and adding a redirect logic on middleware, also changed from any mdx file if there was any to the new link
22 lines
638 B
JavaScript
22 lines
638 B
JavaScript
import { NextResponse } from 'next/server'
|
|
import country from 'country-list-js'
|
|
const partners = ['gb_help_desk']
|
|
|
|
export function middleware(request) {
|
|
if (request.nextUrl.pathname.startsWith('/slack')) {
|
|
let continent = country.findByIso2(request.geo.country || 'AU').continent
|
|
if (continent === 'Oceania') {
|
|
continent = 'Australia'
|
|
}
|
|
const response = NextResponse.next()
|
|
response.cookies.set('continent', continent || '')
|
|
return response
|
|
}
|
|
|
|
if (request.nextUrl.pathname === '/donate/') {
|
|
return NextResponse.redirect('https://hackclub.com/philanthropy/');
|
|
}
|
|
|
|
return NextResponse.next();
|
|
|
|
}
|