Add meta content to admin config page
This commit is contained in:
parent
4946b0d262
commit
a063d0d29b
@ -30,6 +30,7 @@ import AdminLink from './AdminLink';
|
||||
import ScoreCardContainer from '@/components/ScoreCardContainer';
|
||||
import { DEFAULT_CATEGORY_KEYS, getHiddenCategories } from '@/category';
|
||||
import { AI_AUTO_GENERATED_FIELDS_ALL } from '@/photo/ai';
|
||||
import clsx from 'clsx/lite';
|
||||
|
||||
export default function AdminAppConfigurationClient({
|
||||
// Storage
|
||||
@ -49,11 +50,17 @@ export default function AdminAppConfigurationClient({
|
||||
// Content
|
||||
locale,
|
||||
hasLocale,
|
||||
domain,
|
||||
hasDomain,
|
||||
hasNavTitle,
|
||||
hasNavCaption,
|
||||
metaTitle,
|
||||
isMetaTitleConfigured,
|
||||
metaDescription,
|
||||
isMetaDescriptionConfigured,
|
||||
navTitle,
|
||||
hasNavTitle,
|
||||
navCaption,
|
||||
hasNavCaption,
|
||||
pageAbout,
|
||||
hasPageAbout,
|
||||
// AI
|
||||
hasOpenaiBaseUrl,
|
||||
@ -119,6 +126,15 @@ export default function AdminAppConfigurationClient({
|
||||
simplifiedView?: boolean
|
||||
isAnalyzingConfiguration?: boolean
|
||||
}) {
|
||||
const renderContent = (content?: ReactNode) => content
|
||||
? <div className={clsx(
|
||||
'my-1 px-2 py-1',
|
||||
'bg-dim rounded-lg',
|
||||
)}>
|
||||
{content}
|
||||
</div>
|
||||
: null;
|
||||
|
||||
const renderEnvVars = (variables: string[]) =>
|
||||
<div className="pt-1 flex flex-col gap-1">
|
||||
{variables.map(variable =>
|
||||
@ -294,10 +310,11 @@ export default function AdminAppConfigurationClient({
|
||||
icon={<BiPencil size={16} />}
|
||||
>
|
||||
<ChecklistRow
|
||||
title={`Configure language: ${locale}`}
|
||||
title="Configure language"
|
||||
status={hasLocale}
|
||||
optional
|
||||
>
|
||||
{renderContent(locale)}
|
||||
Store in environment variable
|
||||
(check README for
|
||||
{' '}
|
||||
@ -314,6 +331,7 @@ export default function AdminAppConfigurationClient({
|
||||
title="Configure domain"
|
||||
status={hasDomain}
|
||||
>
|
||||
{renderContent(domain)}
|
||||
Store in environment variable
|
||||
(used in explicit share urls, seen in nav if no title is defined):
|
||||
{renderEnvVars(['NEXT_PUBLIC_DOMAIN'])}
|
||||
@ -323,6 +341,7 @@ export default function AdminAppConfigurationClient({
|
||||
status={isMetaTitleConfigured}
|
||||
showWarning
|
||||
>
|
||||
{renderContent(metaTitle)}
|
||||
Store in environment variable
|
||||
(seen in search results and browser tab):
|
||||
{renderEnvVars(['NEXT_PUBLIC_META_TITLE'])}
|
||||
@ -333,6 +352,7 @@ export default function AdminAppConfigurationClient({
|
||||
status={isMetaDescriptionConfigured}
|
||||
optional
|
||||
>
|
||||
{renderContent(metaDescription)}
|
||||
Store in environment variable
|
||||
(seen in search results):
|
||||
{renderEnvVars(['NEXT_PUBLIC_META_DESCRIPTION'])}
|
||||
@ -342,6 +362,7 @@ export default function AdminAppConfigurationClient({
|
||||
status={hasNavTitle}
|
||||
optional
|
||||
>
|
||||
{hasNavTitle && renderContent(navTitle)}
|
||||
Store in environment variable (replaces domain in nav):
|
||||
{renderEnvVars(['NEXT_PUBLIC_NAV_TITLE'])}
|
||||
</ChecklistRow>
|
||||
@ -350,6 +371,7 @@ export default function AdminAppConfigurationClient({
|
||||
status={hasNavCaption}
|
||||
optional
|
||||
>
|
||||
{hasNavCaption && renderContent(navCaption)}
|
||||
Store in environment variable (seen in nav, under title):
|
||||
{renderEnvVars(['NEXT_PUBLIC_NAV_CAPTION'])}
|
||||
</ChecklistRow>
|
||||
@ -358,6 +380,7 @@ export default function AdminAppConfigurationClient({
|
||||
status={hasPageAbout}
|
||||
optional
|
||||
>
|
||||
{hasPageAbout && renderContent(pageAbout)}
|
||||
Store in environment variable (seen in sidebar):
|
||||
{renderEnvVars(['NEXT_PUBLIC_PAGE_ABOUT'])}
|
||||
</ChecklistRow>
|
||||
|
||||
@ -350,15 +350,21 @@ export const APP_CONFIGURATION = {
|
||||
// Content
|
||||
locale: APP_LOCALE,
|
||||
hasLocale: Boolean(process.env.NEXT_PUBLIC_LOCALE),
|
||||
domain: SITE_DOMAIN_SHORT,
|
||||
hasDomain: Boolean(
|
||||
process.env.NEXT_PUBLIC_DOMAIN ||
|
||||
// Legacy environment variable
|
||||
process.env.NEXT_PUBLIC_SITE_DOMAIN,
|
||||
),
|
||||
hasNavTitle: Boolean(NAV_TITLE),
|
||||
hasNavCaption: Boolean(NAV_CAPTION),
|
||||
metaTitle: META_TITLE,
|
||||
isMetaTitleConfigured: IS_META_TITLE_CONFIGURED,
|
||||
metaDescription: META_DESCRIPTION,
|
||||
isMetaDescriptionConfigured: IS_META_DESCRIPTION_CONFIGURED,
|
||||
navTitle: NAV_TITLE,
|
||||
hasNavTitle: Boolean(NAV_TITLE),
|
||||
navCaption: NAV_CAPTION,
|
||||
hasNavCaption: Boolean(NAV_CAPTION),
|
||||
pageAbout: PAGE_ABOUT,
|
||||
hasPageAbout: Boolean(process.env.NEXT_PUBLIC_SITE_ABOUT),
|
||||
// AI
|
||||
hasOpenaiBaseUrl: Boolean(OPENAI_BASE_URL),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user