feat: add meta tags for embeds outside of blog

This commit is contained in:
Oliver Booth 2023-09-26 20:40:03 +01:00
parent 963a335287
commit d80a00e97e
Signed by: oliverbooth
GPG Key ID: E60B570D1B7557B5
1 changed files with 14 additions and 5 deletions

View File

@ -12,6 +12,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="color-scheme" content="dark">
<meta name="theme-color" content="#007EC6">
<meta property="og:image" content="@Url.Content("~/img/favicon.png")">
<meta property="twitter:image" content="@Url.Content("~/img/favicon.png")">
<meta property="og:url" content="@url">
<meta property="twitter:url" content="@url">
<meta property="twitter:card" content="summary">
@if (ViewData["Title"] != null)
{
<title>@ViewData["Title"] - Oliver Booth</title>
@ -25,17 +30,21 @@
string excerpt = BlogPostService.RenderExcerpt(post, out bool trimmed);
<meta name="title" content="@post.Title">
<meta name="description" content="@excerpt">
<meta property="og:image" content="@Url.Content("~/img/favicon.png")">
<meta property="og:title" content="@post.Title">
<meta property="og:description" content="@excerpt">
<meta property="og:type" content="article">
<meta property="og:url" content="@url">
<meta property="twitter:title" content="@post.Title">
<meta property="twitter:creator" content="@post.Author.DisplayName">
<meta property="twitter:description" content="@excerpt">
<meta property="twitter:image" content="@Url.Content("~/img/favicon.png")">
<meta property="twitter:card" content="summary">
<meta property="twitter:url" content="@url">
}
else
{
<meta name="title" content="@(ViewData["Title"] != null ? $"{ViewData["Title"]} - Oliver Booth" : "Oliver Booth")">
<meta name="description" content="Coffee enthusiast and lover of all things tech. Tech enthusiast and lover of all things coffee.">
<meta property="og:title" content="@(ViewData["Title"] != null ? $"{ViewData["Title"]} - Oliver Booth" : "Oliver Booth")">
<meta property="og:description" content="Coffee enthusiast and lover of all things tech. Tech enthusiast and lover of all things coffee.">
<meta property="twitter:title" content="@(ViewData["Title"] != null ? $"{ViewData["Title"]} - Oliver Booth" : "Oliver Booth")">
<meta property="twitter:description" content="Coffee enthusiast and lover of all things tech. Tech enthusiast and lover of all things coffee.">
}
<link rel="shortcut icon" href="/img/favicon.png" asp-append-version="true">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.1/css/bootstrap.min.css" integrity="sha512-Z/def5z5u2aR89OuzYcxmDJ0Bnd5V1cKqBEbvLOiUNWdg9PQeXVvXLI90SE4QOHGlfLqUnDNVAYyZi8UwUTmWQ==" crossorigin="anonymous" referrerpolicy="no-referrer">