first commit
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* The set of content sections exposed in the admin panel. Each key maps to a
|
||||
* top-level key inside `dict`; editing one stores a `{ fa, en }` override that
|
||||
* the content loader merges over the in-code default. Kept dependency-free so
|
||||
* both client (sidebar, editor) and server (dashboard, API) can import it.
|
||||
*/
|
||||
export const EDITABLE_SECTIONS = [
|
||||
{ key: 'hero', label: { en: 'Hero', fa: 'هیرو' }, desc: { en: 'Headline, roles, metrics, CTAs', fa: 'تیتر، نقشها، اعداد، دکمهها' } },
|
||||
{ key: 'services', label: { en: 'Services', fa: 'خدمات' }, desc: { en: 'The six practice cards', fa: 'شش کارت خدمات' } },
|
||||
{ key: 'dataflow', label: { en: 'Data Flow', fa: 'پایپلاین داده' }, desc: { en: 'RAG pipeline diagram stages', fa: 'مراحل نمودار پایپلاین RAG' } },
|
||||
{ key: 'stack', label: { en: 'Stack', fa: 'استک' }, desc: { en: 'Tooling categories', fa: 'دستههای ابزار' } },
|
||||
{ key: 'expertise', label: { en: 'Expertise', fa: 'تخصص' }, desc: { en: 'Skill bars', fa: 'نوارهای مهارت' } },
|
||||
{ key: 'portfolio', label: { en: 'Portfolio', fa: 'نمونهکارها' }, desc: { en: 'Projects + galleries', fa: 'پروژهها و گالری' } },
|
||||
{ key: 'blog', label: { en: 'Journal', fa: 'بلاگ' }, desc: { en: 'Post cards (titles, excerpts)', fa: 'کارتهای مقاله' } },
|
||||
{ key: 'contact', label: { en: 'Contact', fa: 'تماس' }, desc: { en: 'Form copy + budgets', fa: 'متن فرم و بودجهها' } },
|
||||
{ key: 'nav', label: { en: 'Navigation', fa: 'ناوبری' }, desc: { en: 'Menu labels', fa: 'برچسبهای منو' } },
|
||||
{ key: 'footer', label: { en: 'Footer', fa: 'فوتر' }, desc: { en: 'Tagline + rights', fa: 'شعار و حقوق' } },
|
||||
{ key: 'meta', label: { en: 'SEO / Meta', fa: 'سئو' }, desc: { en: 'Title + description', fa: 'عنوان و توضیحات' } },
|
||||
] as const;
|
||||
|
||||
export type EditableSectionKey = (typeof EDITABLE_SECTIONS)[number]['key'];
|
||||
|
||||
export const EDITABLE_KEYS = EDITABLE_SECTIONS.map((s) => s.key) as EditableSectionKey[];
|
||||
|
||||
export function isEditableKey(key: string): key is EditableSectionKey {
|
||||
return (EDITABLE_KEYS as string[]).includes(key);
|
||||
}
|
||||
|
||||
export function sectionLabel(key: string): { en: string; fa: string } {
|
||||
return EDITABLE_SECTIONS.find((s) => s.key === key)?.label ?? { en: key, fa: key };
|
||||
}
|
||||
Reference in New Issue
Block a user