| 
									
										
										
										
											2024-08-12 11:09:58 +08:00
										 |  |  | import { RSSFeedURL } from "@/consts/consts"; | 
					
						
							| 
									
										
										
										
											2023-12-25 17:21:39 +08:00
										 |  |  | import { Config } from "@/data/config"; | 
					
						
							| 
									
										
										
										
											2024-08-12 11:09:58 +08:00
										 |  |  | import Head from "next/head"; | 
					
						
							| 
									
										
										
										
											2023-12-25 17:21:39 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-08-12 11:09:58 +08:00
										 |  |  | type TSEOProps = { title: string; description?: string | null; coverURL?: string | null; smallTwitterCard?: boolean }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export const SEO = (props: TSEOProps) => { | 
					
						
							| 
									
										
										
										
											2023-12-25 17:21:39 +08:00
										 |  |  |   return ( | 
					
						
							| 
									
										
										
										
											2024-08-12 11:09:58 +08:00
										 |  |  |     <Head> | 
					
						
							| 
									
										
										
										
											2023-12-25 17:21:39 +08:00
										 |  |  |       <title>{props.title}</title> | 
					
						
							| 
									
										
										
										
											2024-04-03 22:08:27 +08:00
										 |  |  |       <link href={RSSFeedURL} rel="alternate" type="application/rss+xml" /> | 
					
						
							| 
									
										
										
										
											2024-08-12 11:09:58 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |       <meta content={props.coverURL ?? Config.PageCovers.websiteCoverURL} name="twitter:image" /> | 
					
						
							|  |  |  |       <meta content={props.smallTwitterCard ? "summary" : "summary_large_image"} name="twitter:card" /> | 
					
						
							|  |  |  |       <meta content={`@${Config.SocialLinks.twitter}`} name="twitter:site" /> | 
					
						
							|  |  |  |       <meta content={`@${Config.SocialLinks.twitter}`} name="twitter:creator" /> | 
					
						
							|  |  |  |       <meta content={props.title} name="twitter:title" /> | 
					
						
							|  |  |  |       <meta content={props.description ?? props.title} name="twitter:description" /> | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       <meta content={props.coverURL ?? Config.PageCovers.websiteCoverURL} name="og:image" /> | 
					
						
							|  |  |  |       <meta content={props.description ?? props.title} name="og:image:alt" /> | 
					
						
							|  |  |  |       <meta content={props.title} name="og:title" /> | 
					
						
							|  |  |  |       <meta content={props.description ?? props.title} name="og:description" /> | 
					
						
							|  |  |  |     </Head> | 
					
						
							| 
									
										
										
										
											2023-12-25 17:21:39 +08:00
										 |  |  |   ); | 
					
						
							|  |  |  | }; |