feat: add privacy policy, remove Umami analytics, add mdx

This commit is contained in:
rzmk 2025-07-08 00:53:40 -04:00
parent a78baad41b
commit 26ef11ca4f
11 changed files with 433 additions and 26 deletions

View file

@ -20,7 +20,7 @@ export const config = {
* 4. /examples (inside /public)
* 5. all root files inside /public (e.g. /favicon.ico)
*/
'/((?!api|_next|fonts|umami|examples|[\\w-]+\\.\\w+).*)',
'/((?!api|_next|fonts|examples|[\\w-]+\\.\\w+).*)',
'/sitemap.xml',
'/payments/stripe/connect/oauth',
],
@ -38,7 +38,7 @@ export default async function middleware(req: NextRequest) {
: (default_org as string)
// Out of orgslug paths & rewrite
const standard_paths = ['/home']
const standard_paths = ['/home', '/privacy-policy']
const auth_paths = ['/login', '/signup', '/reset', '/forgot']
if (standard_paths.includes(pathname)) {
// Redirect to the same pathname with the original search params
@ -85,15 +85,15 @@ export default async function middleware(req: NextRequest) {
if (req.nextUrl.pathname.startsWith('/payments/stripe/connect/oauth')) {
const searchParams = req.nextUrl.searchParams
const orgslug = searchParams.get('state')?.split('_')[0] // Assuming state parameter contains orgslug_randomstring
// Construct the new URL with the required parameters
const redirectUrl = new URL('/payments/stripe/connect/oauth', req.url)
// Preserve all original search parameters
searchParams.forEach((value, key) => {
redirectUrl.searchParams.append(key, value)
})
// Add orgslug if available
if (orgslug) {
redirectUrl.searchParams.set('orgslug', orgslug)
@ -129,7 +129,7 @@ export default async function middleware(req: NextRequest) {
if (pathname.startsWith('/sitemap.xml')) {
let orgslug: string;
if (hosting_mode === 'multi') {
orgslug = fullhost
? fullhost.replace(`.${LEARNHOUSE_DOMAIN}`, '')