mirror of
https://github.com/sergeyyarkov/yarkov.tech.git
synced 2026-10-11 10:29:21 +03:00
16 lines
427 B
Plaintext
16 lines
427 B
Plaintext
---
|
|
import ArticleLayout from "@root/layouts/article.astro";
|
|
import { fetchArticleBySlug } from "@/directus";
|
|
|
|
const { path } = Astro.params as { blog: string; path: string };
|
|
const slug = path.split("/").at(-1);
|
|
|
|
if (!slug) return Astro.redirect("/404");
|
|
|
|
const article = await fetchArticleBySlug(slug);
|
|
|
|
if (!article) return Astro.redirect("/404");
|
|
---
|
|
|
|
<ArticleLayout lang={article.languages_code.code} article={article} />
|