diff --git a/pages/author/[pubkey].tsx b/pages/author/[pubkey].tsx index 16d53bb..1c40b99 100644 --- a/pages/author/[pubkey].tsx +++ b/pages/author/[pubkey].tsx @@ -22,6 +22,9 @@ function AuthorPageHeader({ presentation }: { presentation: AuthorPresentationAr return null } + // Extract author name from title (format: "Présentation de ") + const authorName = presentation.title.replace(/^Présentation de /, '').trim() || presentation.title + return (
@@ -35,16 +38,35 @@ function AuthorPageHeader({ presentation }: { presentation: AuthorPresentationAr />
)} -
-

- {presentation.title || t('author.presentation')} -

-

- {t('author.profileNote')} -

-
-

{presentation.content}

+
+
+

+ {authorName} +

+

+ {t('author.profileNote')} +

+ {presentation.description && ( +
+

+ {t('presentation.field.presentation')} +

+
+

{presentation.description}

+
+
+ )} + {presentation.contentDescription && ( +
+

+ {t('presentation.field.contentDescription')} +

+
+

{presentation.contentDescription}

+
+
+ )}
@@ -256,7 +278,7 @@ export default function AuthorPage(): React.ReactElement { if (typeof pubkey === 'string') { // Try to parse as new format first (hash_index_version) const urlMatch = pubkey.match(/^([a-f0-9]+)_(\d+)_(\d+)$/i) - if (urlMatch) { + if (urlMatch && urlMatch[1]) { // Extract hash ID from the format hash_index_version hashIdOrPubkey = urlMatch[1] } else { @@ -274,7 +296,7 @@ export default function AuthorPage(): React.ReactElement { const { presentation, series, totalSponsoring, loading, error, reload } = useAuthorData(hashIdOrPubkey || '') if (!hashIdOrPubkey) { - return null + return <> } // Get the actual pubkey from presentation