Skip to content

Commit

Permalink
Fix redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
MotorTruck1221 committed Dec 17, 2024
1 parent d2cc451 commit bdc196f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
11 changes: 10 additions & 1 deletion src/layouts/Layout.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
---
import { SEO } from 'astro-seo';
const { title } = Astro.props;
interface Props {
title?: string;
redirect?: {
path: string;
interval: number;
}
}
const { title, redirect } = Astro.props;
import { ClientRouter } from 'astro:transitions';
import LoadScripts from '@components/Scripts.astro';
import SettingsLoader from '@components/settings/Loader.astro';
Expand Down Expand Up @@ -51,6 +59,7 @@ import SettingsLoader from '@components/settings/Loader.astro';
]
}}
/>
{redirect !== undefined && <meta http-equiv="refresh" content=`${redirect.interval};${redirect.path}`>}
<ClientRouter fallback="animate" />
</head>
<body class="w-full h-screen min-h-screen text-[--text-color]">
Expand Down
6 changes: 2 additions & 4 deletions src/pages/gs/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ import games from "../../data/games.json";
const images = import.meta.glob<{ default: ImageMetadata }>(
'/src/assets/games/*.{jpeg,jpg,png,gif,webp}'
);
if (!GAMES_LINK) {
return Astro.redirect('/');
}
---

<Layout title="">
{!GAMES_LINK && <Layout title="" redirect={{path: '/', interval: 0}}>}
{GAMES_LINK && <Layout title="">}
<div class="w-full h-full px-[15%]">
<div class="h-[80px] w-full p-0 flex self-center transition duration-200">
<div class="flex grow items-center justify-left">
Expand Down

0 comments on commit bdc196f

Please sign in to comment.