Align seed, shared brand, and landing UI with the correct Montech Farsi name. Co-authored-by: Cursor <cursoragent@cursor.com>
46 lines
1.6 KiB
Vue
46 lines
1.6 KiB
Vue
<template>
|
|
<article v-if="post" class="min-h-screen px-6 pb-24 pt-28 md:px-10">
|
|
<SiteNavbar brand="منتک" />
|
|
<div class="mx-auto max-w-[760px]">
|
|
<NuxtLink to="/blog" class="text-sm text-ash hover:text-volt">→ بازگشت به بلاگ</NuxtLink>
|
|
<h1 class="mt-8 font-display text-3xl font-extrabold leading-tight md:text-5xl">
|
|
{{ post.title }}
|
|
</h1>
|
|
<p class="mt-4 text-sm text-ash">
|
|
{{ post.publishedAt ? new Date(post.publishedAt).toLocaleDateString("fa-IR") : "" }}
|
|
</p>
|
|
<div class="mt-10 whitespace-pre-line text-base leading-relaxed text-bone/90">{{ plainContent }}</div>
|
|
</div>
|
|
</article>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
const route = useRoute();
|
|
const slug = String(route.params.slug);
|
|
const { data: post } = await useAsyncData(`blog-${slug}`, () => fetchPublicPost(slug));
|
|
|
|
if (!post.value) {
|
|
throw createError({ statusCode: 404, statusMessage: "پست پیدا نشد" });
|
|
}
|
|
|
|
const plainContent = computed(() => {
|
|
const raw = post.value?.content || "";
|
|
return raw
|
|
.replace(/<\/p>/gi, "\n\n")
|
|
.replace(/<br\s*\/?>/gi, "\n")
|
|
.replace(/<[^>]+>/g, "")
|
|
.trim();
|
|
});
|
|
|
|
useSeoMeta({
|
|
title: post.value.seoTitle || post.value.title,
|
|
description: post.value.seoDesc || post.value.excerpt,
|
|
ogTitle: post.value.seoTitle || post.value.title,
|
|
ogDescription: post.value.seoDesc || post.value.excerpt,
|
|
ogImage: post.value.ogImage || post.value.coverUrl || undefined,
|
|
});
|
|
if (post.value.canonical) {
|
|
useHead({ link: [{ rel: "canonical", href: post.value.canonical }] });
|
|
}
|
|
</script>
|