Skip to content

Commit

Permalink
fix(astro): add meta tags to redirect page too
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio committed Nov 20, 2024
1 parent 084ffa9 commit f6fcbc0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/astro/src/default/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
import MetaTags from '../components/MetaTags.astro';
import { getTutorial } from '../utils/content';
import { joinPaths } from '../utils/url';
Expand All @@ -9,11 +10,13 @@ const part = lesson.part && tutorial.parts[lesson.part.id];
const chapter = lesson.chapter && part?.chapters[lesson.chapter.id];
const slug = [part?.slug, chapter?.slug, lesson.slug].filter(Boolean).join('/');
const meta = lesson.data?.meta ?? {};
const redirect = joinPaths(import.meta.env.BASE_URL, `/${slug}`);
---

<!doctype html>
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<title>Redirecting to {redirect}</title>
<MetaTags slot="meta" meta={meta} />
<meta http-equiv="refresh" content=`0;url=${redirect}` />

0 comments on commit f6fcbc0

Please sign in to comment.