Scaffold SSR site with CMS/blog/gallery/SEO admin and deploy configs for montech.ir. Co-authored-by: Cursor <cursoragent@cursor.com>
37 lines
1.4 KiB
Vue
37 lines
1.4 KiB
Vue
<template>
|
|
<article v-if="post" class="min-h-screen px-6 pb-24 pt-28 md:px-10">
|
|
<SiteNavbar brand="Montech" />
|
|
<div class="mx-auto max-w-[760px]">
|
|
<NuxtLink to="/blog" class="font-mono text-[11px] tracking-[0.22em] text-ash hover:text-volt">← BACK</NuxtLink>
|
|
<h1 class="mt-8 font-display text-4xl font-extrabold uppercase tracking-[-0.03em] md:text-6xl">
|
|
{{ post.title }}
|
|
</h1>
|
|
<p class="mt-4 font-mono text-[11px] tracking-[0.2em] text-ash">
|
|
{{ post.publishedAt ? new Date(post.publishedAt).toLocaleDateString("en-GB") : "" }}
|
|
</p>
|
|
<div class="prose-montech mt-10 space-y-4 text-base leading-relaxed text-bone/90" v-html="post.content" />
|
|
</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: "Post not found" });
|
|
}
|
|
|
|
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>
|