@@ -65,6 +65,22 @@ export const blueskySchema = socialUrlSchema(
6565 / ^ (?: (?: h t t p s : \/ \/ ) ? (?: w w w \. ) ? b s k y \. a p p \/ p r o f i l e \/ ) ? (?< value > [ \w . - ] + ) (?: \/ .* ) ? $ / ,
6666) ;
6767
68+ export const codebergSchema = socialUrlSchema (
69+ / ^ (?: (?: h t t p s : \/ \/ ) ? (?: w w w \. ) ? c o d e b e r g \. o r g \/ ) ? (?< value > [ \w - ] { 2 , } ) \/ ? $ / ,
70+ ) ;
71+
72+ export const gitlabSchema = socialUrlSchema (
73+ / ^ (?: (?: h t t p s : \/ \/ ) ? (?: w w w \. ) ? g i t l a b \. c o m \/ ) ? (?< value > [ \w - ] { 2 , } ) \/ ? $ / ,
74+ ) ;
75+
76+ export const bitbucketSchema = socialUrlSchema (
77+ / ^ (?: (?: h t t p s : \/ \/ ) ? (?: w w w \. ) ? b i t b u c k e t \. o r g \/ ) ? (?< value > [ \w - ] { 2 , } ) \/ ? $ / ,
78+ ) ;
79+
80+ export const kaggleSchema = socialUrlSchema (
81+ / ^ (?: (?: h t t p s : \/ \/ ) ? (?: w w w \. ) ? k a g g l e \. c o m \/ ) ? (?< value > [ \w - ] { 2 , } ) \/ ? $ / ,
82+ ) ;
83+
6884export const socialFieldsSchema = z . object ( {
6985 github : githubSchema ,
7086 twitter : twitterSchema ,
@@ -101,6 +117,10 @@ const PLATFORM_DOMAINS: Record<string, string> = {
101117 'youtu.be' : 'youtube' ,
102118 'hashnode.com' : 'hashnode' ,
103119 'hashnode.dev' : 'hashnode' ,
120+ 'codeberg.org' : 'codeberg' ,
121+ 'gitlab.com' : 'gitlab' ,
122+ 'bitbucket.org' : 'bitbucket' ,
123+ 'kaggle.com' : 'kaggle' ,
104124} ;
105125
106126/**
@@ -143,11 +163,14 @@ export const socialLinkInputSchema = z.object({
143163 platform : z . string ( ) . optional ( ) ,
144164} ) ;
145165
166+ export const MAX_SOCIAL_LINKS = 20 ;
167+
146168/**
147169 * Schema for socialLinks array input with auto-detection and transformation
148170 */
149171export const socialLinksInputSchema = z
150172 . array ( socialLinkInputSchema )
173+ . max ( MAX_SOCIAL_LINKS )
151174 . transform ( ( links ) =>
152175 links . map ( ( { url, platform } ) => ( {
153176 platform : platform || detectPlatformFromUrl ( url ) || 'other' ,
@@ -212,6 +235,18 @@ export function extractHandleFromUrl(
212235 case 'portfolio' :
213236 // Full URL is stored for portfolio
214237 return url ;
238+ case 'codeberg' :
239+ // https://codeberg.org/username
240+ return pathname . replace ( / ^ \/ / , '' ) || null ;
241+ case 'gitlab' :
242+ // https://gitlab.com/username
243+ return pathname . replace ( / ^ \/ / , '' ) || null ;
244+ case 'bitbucket' :
245+ // https://bitbucket.org/username
246+ return pathname . replace ( / ^ \/ / , '' ) || null ;
247+ case 'kaggle' :
248+ // https://kaggle.com/username
249+ return pathname . replace ( / ^ \/ / , '' ) || null ;
215250 default :
216251 return null ;
217252 }
0 commit comments