Sync admin settings and media with the public landing site.

Show logo in the navbar, add image upload fields for logo/team/work/blog/gallery, and drive site chrome from settings everywhere.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-30 22:10:45 +03:30
co-authored by Cursor
parent ceac76781b
commit c33a757af4
14 changed files with 189 additions and 49 deletions
+22 -7
View File
@@ -1,16 +1,24 @@
<template>
<header class="fixed inset-x-0 top-0 z-50 border-b border-white/[0.06] bg-ink/70 backdrop-blur-md">
<div class="mx-auto flex max-w-[1500px] items-center justify-between px-6 py-4 md:px-10">
<NuxtLink to="/" class="font-display text-lg font-extrabold tracking-tight">
{{ brand }}<span class="align-super text-[0.55em] text-volt">®</span>
<NuxtLink to="/" class="flex items-center gap-3 font-display text-lg font-extrabold tracking-tight">
<img
v-if="logoSrc"
:src="logoSrc"
:alt="brand"
class="h-9 w-auto max-w-[140px] object-contain"
/>
<template v-else>
{{ brand }}<span class="align-super text-[0.55em] text-volt">®</span>
</template>
</NuxtLink>
<nav class="hidden items-center gap-6 text-sm text-ash md:flex">
<a href="#services" class="hover:text-volt">خدمات</a>
<a href="#work" class="hover:text-volt">نمونه کارها</a>
<a href="#team" class="hover:text-volt">تیم</a>
<a href="/#services" class="hover:text-volt">خدمات</a>
<a href="/#work" class="hover:text-volt">نمونه کارها</a>
<a href="/#team" class="hover:text-volt">تیم</a>
<NuxtLink to="/blog" class="hover:text-volt">بلاگ</NuxtLink>
<NuxtLink to="/gallery" class="hover:text-volt">گالری</NuxtLink>
<a href="#contact" class="text-bone hover:text-volt">تماس</a>
<a href="/#contact" class="text-bone hover:text-volt">تماس</a>
</nav>
<span class="text-xs text-ash tabular-nums" dir="ltr">{{ time }}</span>
</div>
@@ -19,9 +27,16 @@
<script setup lang="ts">
import { formatClock } from "~/utils/timezone";
import { mediaUrl } from "~/utils/media";
const props = defineProps<{
brand?: string;
logoUrl?: string | null;
timezone?: string;
}>();
const props = defineProps<{ brand?: string; timezone?: string }>();
const brand = computed(() => props.brand || "منتک");
const logoSrc = computed(() => mediaUrl(props.logoUrl));
const time = ref("");
onMounted(() => {
+5 -2
View File
@@ -10,7 +10,10 @@
</div>
<div class="grid gap-6 sm:grid-cols-2 lg:grid-cols-4">
<figure v-for="m in data.members" :key="m.name" class="group">
<div class="aspect-[3/4] bg-gradient-to-br from-smoke to-ink" />
<div
class="aspect-[3/4] bg-gradient-to-br from-smoke to-ink bg-cover bg-center"
:style="m.imageUrl ? { backgroundImage: `url(${m.imageUrl})` } : {}"
/>
<figcaption class="mt-4">
<p class="font-display text-xl font-bold group-hover:text-volt transition-colors">
{{ m.name }}
@@ -29,7 +32,7 @@ defineProps<{
tag: string;
headline: string;
body: string;
members: Array<{ name: string; role: string }>;
members: Array<{ name: string; role: string; imageUrl?: string }>;
};
}>();
</script>
+6 -3
View File
@@ -1,14 +1,17 @@
<template>
<section id="work" class="px-6 py-28 md:px-10 md:py-40">
<div class="mx-auto max-w-[1500px]">
<SectionTag index="۰۳" :title="data.tag" right="۱۴۰۲ — ۱۴۰۴" />
<SectionTag index="۰۳" :title="data.tag" right="نمونه‌کارها" />
<div class="mt-16 grid gap-6 md:grid-cols-2">
<article
v-for="p in data.items"
:key="p.n"
class="group relative overflow-hidden border border-white/[0.07] bg-coal p-6 md:p-8"
>
<div class="mb-16 aspect-[16/10] bg-gradient-to-br from-smoke to-ink" />
<div
class="mb-16 aspect-[16/10] bg-gradient-to-br from-smoke to-ink bg-cover bg-center"
:style="p.imageUrl ? { backgroundImage: `url(${p.imageUrl})` } : {}"
/>
<div class="flex items-end justify-between gap-4">
<div>
<p class="text-xs text-ash">{{ p.n }} / {{ p.year }}</p>
@@ -29,7 +32,7 @@
defineProps<{
data: {
tag: string;
items: Array<{ n: string; title: string; cat: string; year: string }>;
items: Array<{ n: string; title: string; cat: string; year: string; imageUrl?: string }>;
};
}>();
</script>
+14
View File
@@ -0,0 +1,14 @@
export async function useSiteChrome() {
const { data } = await useAsyncData("site-chrome", () => fetchPublicSite(), {
getCachedData: () => undefined,
});
return computed(() => ({
brand: data.value?.settings?.brandName || "منتک",
logoUrl: data.value?.settings?.logoUrl || "",
timezone: data.value?.settings?.timezone || "Asia/Tehran",
tagline: data.value?.settings?.tagline || "",
email: data.value?.settings?.email || "",
phone: data.value?.settings?.phone || "",
}));
}
+9 -2
View File
@@ -1,6 +1,10 @@
<template>
<article v-if="post" class="min-h-screen px-6 pb-24 pt-28 md:px-10">
<SiteNavbar brand="منتک" />
<SiteNavbar
:brand="chrome.brand"
:logo-url="chrome.logoUrl"
:timezone="chrome.timezone"
/>
<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">
@@ -15,9 +19,12 @@
</template>
<script setup lang="ts">
const chrome = await useSiteChrome();
const route = useRoute();
const slug = String(route.params.slug);
const { data: post } = await useAsyncData(`blog-${slug}`, () => fetchPublicPost(slug));
const { data: post } = await useAsyncData(`blog-${slug}`, () => fetchPublicPost(slug), {
getCachedData: () => undefined,
});
if (!post.value) {
throw createError({ statusCode: 404, statusMessage: "پست پیدا نشد" });
+12 -3
View File
@@ -1,6 +1,10 @@
<template>
<div class="min-h-screen px-6 pb-24 pt-28 md:px-10">
<SiteNavbar brand="منتک" />
<SiteNavbar
:brand="chrome.brand"
:logo-url="chrome.logoUrl"
:timezone="chrome.timezone"
/>
<div class="mx-auto max-w-[1100px]">
<h1 class="font-display text-4xl font-extrabold md:text-6xl">بلاگ</h1>
<p class="mt-4 max-w-xl text-ash">یادداشت‌هایی درباره محصول، مهندسی و ساخت نرم‌افزار.</p>
@@ -23,7 +27,12 @@
</template>
<script setup lang="ts">
const { data: posts } = await useAsyncData("blog-list", () => fetchPublicBlog());
const { data: page } = await useAsyncData("page-blog", () => fetchPage("blog"));
const chrome = await useSiteChrome();
const { data: posts } = await useAsyncData("blog-list", () => fetchPublicBlog(), {
getCachedData: () => undefined,
});
const { data: page } = await useAsyncData("page-blog", () => fetchPage("blog"), {
getCachedData: () => undefined,
});
applyPageSeo(page.value?.seo);
</script>
+12 -3
View File
@@ -1,6 +1,10 @@
<template>
<div class="min-h-screen px-6 pb-24 pt-28 md:px-10">
<SiteNavbar brand="منتک" />
<SiteNavbar
:brand="chrome.brand"
:logo-url="chrome.logoUrl"
:timezone="chrome.timezone"
/>
<div class="mx-auto max-w-[1500px]">
<h1 class="font-display text-4xl font-extrabold md:text-6xl">گالری</h1>
<p class="mt-4 max-w-xl text-ash">تصاویر منتخب از پروژه‌ها و فضای استودیو.</p>
@@ -22,7 +26,12 @@
</template>
<script setup lang="ts">
const { data: items } = await useAsyncData("gallery", () => fetchPublicGallery());
const { data: page } = await useAsyncData("page-gallery", () => fetchPage("gallery"));
const chrome = await useSiteChrome();
const { data: items } = await useAsyncData("gallery", () => fetchPublicGallery(), {
getCachedData: () => undefined,
});
const { data: page } = await useAsyncData("page-gallery", () => fetchPage("gallery"), {
getCachedData: () => undefined,
});
applyPageSeo(page.value?.seo);
</script>
+5 -1
View File
@@ -1,6 +1,10 @@
<template>
<div v-if="site">
<SiteNavbar :brand="site.settings.brandName" :timezone="site.settings.timezone" />
<SiteNavbar
:brand="site.settings.brandName"
:logo-url="site.settings.logoUrl"
:timezone="site.settings.timezone"
/>
<main>
<HeroSection :data="site.sections.hero" />
<section class="relative overflow-hidden py-16 md:py-24">
+5
View File
@@ -0,0 +1,5 @@
/** Resolve media/logo URLs for browser and SSR (relative /api/uploads/... stay as-is). */
export function mediaUrl(url?: string | null) {
if (!url) return "";
return url;
}