added opengraph metadata
This commit is contained in:
		
							parent
							
								
									a0e654da2d
								
							
						
					
					
						commit
						054db8cdac
					
				| @ -9,6 +9,7 @@ const ArticleSchema = new Schema({ | ||||
|         ref: 'User' | ||||
|     }, | ||||
|     slug: { type: String, index: { unique: true } }, | ||||
|     description: { type: String, required: false }, | ||||
|     image: { type: String, required: true }, | ||||
|     created_at: { type: Date, default: Date.now }, | ||||
|     updated_at: { type: Date }, | ||||
|  | ||||
| @ -171,7 +171,25 @@ | ||||
| 
 | ||||
| <svelte:head> | ||||
|     <title>{article.title} | HOWFEED.BIZ</title> | ||||
| 
 | ||||
|     <meta property="og:title" content={article.title}> | ||||
|     <meta property="og:type" content="article"> | ||||
|     <meta property="og:locale" content="en_US"> | ||||
|     <meta property="og:site_name" content="HowFeed"> | ||||
|     <meta property="og:image" content={`https://howfeed.biz/a/${article.image}`}> | ||||
|     <meta property="og:url" content={`https://howfeed.biz/a/${article.slug}`}> | ||||
|     <meta property="article:published_time" content={new Date(article.created_at).toISOString()}> | ||||
|     {#if article.updated_at} | ||||
|         <meta property="article:modified_time" content={new Date(article.updated_at).toISOString()}> | ||||
|     {/if} | ||||
|     <meta property="article:author:first_name" content={article.author.realname.split(' ')[0]}> | ||||
|     <meta property="article:author:last_name" content={article.author.realname.split(' ').slice(1)}> | ||||
|     <meta property="article:section" content={article.category.name}> | ||||
| 
 | ||||
|     <meta name="author" content={article.author.realname}> | ||||
|     {#if article.description} | ||||
|         <meta name="description" property="og:description" content={article.description}> | ||||
|     {/if} | ||||
|     {@html `<script type="application/ld+json">{ | ||||
|       "@context": "https://schema.org", | ||||
|       "@type": "BreadcrumbList", | ||||
|  | ||||
| @ -1,5 +1,5 @@ | ||||
| <!doctype html> | ||||
| <html lang='en'> | ||||
| <html lang='en' prefix='https://ogp.me/ns/article#'> | ||||
| <head> | ||||
| 	<meta charset='utf-8'> | ||||
| 	<meta name='viewport' content='width=device-width,initial-scale=1.0'> | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user