Landing/AstroLanding/src/layouts/BlogPost.astro
2026-07-29 13:25:44 +03:00

67 lines
1.8 KiB
Text

---
import type { CollectionEntry } from "astro:content";
import BaseHead from "@/components/BaseHead.astro";
import Footer from "@/components/Footer/Footer.astro";
import FormattedDate from "@/components/FormattedDate.astro";
import Header from "@/components/Header/Header.astro";
import ContactForm from "@/components/ContactForm/ContactForm.astro";
import { getLangFromUrl, useTranslations } from "@/i18n/utils";
import { Image } from "astro:assets";
import "@/styles/index.css";
type Props = CollectionEntry<"blog">["data"];
const { title, description, pubDate, updatedDate, heroImage } = Astro.props;
const lang = getLangFromUrl(Astro.url);
const t = useTranslations(lang);
---
<html lang={lang}>
<head>
<BaseHead title={title} description={description} />
</head>
<body class="blog-post-page">
<Header />
<main>
<article>
<div class="hero-image">
{
heroImage && (
<Image src={heroImage} alt={title} class="hero-image__media" />
)
}
</div>
<div class="prose">
<div class="title">
<div class="date">
<FormattedDate date={pubDate} />
{
updatedDate && (
<div class="last-updated-on">
Last updated on
<FormattedDate date={updatedDate} />
</div>
)
}
</div>
<h1>{title}</h1>
<hr />
</div>
<slot />
<div class="blog-nav-wrap">
<a class="blog-nav-link bottom" href="/blog"
>{t("blog.read_more")}</a
>
</div>
</div>
</article>
</main>
<section class="content container" id="contact-us">
<ContactForm />
</section>
<Footer />
</body>
</html>