@@ -23,6 +23,12 @@ export interface StructuredDataOptions {
2323 logoUrl ?: string ;
2424}
2525
26+ export interface BrandingOptions {
27+ siteName ?: string ;
28+ brandReplacement ?: string ;
29+ twitterHandle ?: string ;
30+ }
31+
2632export interface CodeData {
2733 myDomain : string ;
2834 notionUrl : string ;
@@ -35,6 +41,7 @@ export interface CodeData {
3541 optionImage : ImageOptions ;
3642 pageMetadata : Record < string , PageMetadata > ;
3743 structuredData : StructuredDataOptions ;
44+ branding : BrandingOptions ;
3845}
3946
4047function getId ( url : string ) : string {
@@ -60,6 +67,7 @@ export default function code(data: CodeData): string {
6067 optionImage,
6168 pageMetadata,
6269 structuredData,
70+ branding,
6371 } = data ;
6472 let url = myDomain . replace ( "https://" , "" ) . replace ( "http://" , "" ) ;
6573 if ( url . slice ( - 1 ) === "/" ) url = url . slice ( 0 , url . length - 1 ) ;
@@ -103,6 +111,14 @@ ${slugs
103111 const ORGANIZATION_NAME = '${ structuredData ?. organizationName || "" } ';
104112 const LOGO_URL = '${ structuredData ?. logoUrl || "" } ';
105113
114+ /*
115+ * Step 3.3: branding configuration (optional)
116+ * Replace Notion branding with your own and add social media handles
117+ */
118+ const SITE_NAME = '${ branding ?. siteName || "" } ';
119+ const BRAND_REPLACEMENT = '${ branding ?. brandReplacement || "" } ';
120+ const TWITTER_HANDLE = '${ branding ?. twitterHandle || "" } ';
121+
106122 /* Step 4: enter a Google Font name, you can choose from https://fonts.google.com */
107123 const GOOGLE_FONT = '${ googleFont || "" } ';
108124
@@ -355,11 +371,21 @@ ${slugs
355371 return;
356372 }
357373 }
358- if (MY_DOMAIN !== '') {
359- if (element.getAttribute('property') === 'og:site_name') {
374+ // Set og:site_name - use SITE_NAME if configured, otherwise MY_DOMAIN (Issue #18)
375+ if (element.getAttribute('property') === 'og:site_name') {
376+ if (SITE_NAME !== '') {
377+ element.setAttribute('content', SITE_NAME);
378+ } else if (MY_DOMAIN !== '') {
360379 element.setAttribute('content', MY_DOMAIN);
361380 }
362381 }
382+ // Replace 'Notion' branding in meta content (Issue #18)
383+ if (BRAND_REPLACEMENT !== '') {
384+ const content = element.getAttribute('content');
385+ if (content && content.includes('Notion')) {
386+ element.setAttribute('content', content.replace(/Notion/g, BRAND_REPLACEMENT));
387+ }
388+ }
363389 if (pageTitle !== '') {
364390 if (element.getAttribute('property') === 'og:title'
365391 || element.getAttribute('name') === 'twitter:title') {
@@ -405,6 +431,12 @@ ${slugs
405431 element.append(\`<link rel="canonical" href="\${canonicalUrl}">\`, { html: true });
406432 element.append(\`<meta name="robots" content="index, follow">\`, { html: true });
407433
434+ // Add Twitter/X meta tags for social cards (Issue #19)
435+ if (TWITTER_HANDLE !== '') {
436+ element.append(\`<meta name="twitter:site" content="\${TWITTER_HANDLE}">\`, { html: true });
437+ element.append(\`<meta name="twitter:creator" content="\${TWITTER_HANDLE}">\`, { html: true });
438+ }
439+
408440 // Add JSON-LD structured data for rich search results (Issue #10)
409441 if (STRUCTURED_DATA_ENABLED) {
410442 const pageTitle = this.metadata.title || PAGE_TITLE;
0 commit comments