File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -45,14 +45,16 @@ export function getOgUrl(
4545    const  contentTruncated  = 
4646      content . length  >  350  ? content . substring ( 0 ,  350 )  +  "..."  : content ; 
4747
48-     return  `${ pageUrl }  /api/og?title=${ page ?. title } &body= ${  
49-       post . title  
50-     }  &content =${ contentTruncated } ${ 
51-       settings ?. page_logo  ?  "&logo="   +   settings ?. page_logo  :  ""  
52-     }  `; 
48+     return  `${ pageUrl }  /api/og?title=${ encodeURIComponent (  
49+       page ? .title  
50+     ) }  &body =${ encodeURIComponent ( post . title ) } &content= ${ encodeURIComponent ( 
51+       contentTruncated  
52+     ) }  ${ settings ?. page_logo  ?  "&logo="   +   settings ?. page_logo  :  "" }  `; 
5353  } 
5454
55-   return  `${ pageUrl }  /api/og?title=${ page ?. title }  &body=${ page . description } ${  
55+   return  `${ pageUrl }  /api/og?title=${ encodeURIComponent (  
56+     page ?. title  
57+   ) }  &body=${ encodeURIComponent ( page . description  ??  "" ) } ${ 
5658    settings ?. page_logo  ? "&logo="  +  settings ?. page_logo  : ""  
5759  }  `; 
5860} 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments