mirror of
https://git.v0l.io/Kieran/void.cat.git
synced 2025-04-09 18:29:03 +02:00
add more opengraph tags
This commit is contained in:
parent
319d30db67
commit
e5c85aec55
@ -13,22 +13,23 @@
|
||||
|
||||
@if (Model.Meta != default)
|
||||
{
|
||||
var ub = new UriBuilder(settings.SiteUrl)
|
||||
{
|
||||
Path = $"/d/{Model.Id.ToBase58()}"
|
||||
};
|
||||
|
||||
var link = ub.ToString();
|
||||
|
||||
<title>void.cat - @Model.Meta.Name</title>
|
||||
<meta name="description" content="@Model.Meta.Description"/>
|
||||
<meta property="og:site_name" content="void.cat"/>
|
||||
<meta property="og:title" content="@Model.Meta.Name"/>
|
||||
<meta property="og:description" content="@Model.Meta.Description"/>
|
||||
<meta property="og:url" content="@($"https://{Context.Request.Host}/{Model.Id.ToBase58()}")"/>
|
||||
<meta property="og:url" content="@link"/>
|
||||
|
||||
var mime = Model.Meta.MimeType;
|
||||
if (!string.IsNullOrEmpty(mime))
|
||||
{
|
||||
var ub = new UriBuilder(settings.SiteUrl)
|
||||
{
|
||||
Path = $"/d/{Model.Id.ToBase58()}"
|
||||
};
|
||||
|
||||
var link = ub.ToString();
|
||||
if (mime.StartsWith("image/"))
|
||||
{
|
||||
<meta property="og:type" content="image"/>
|
||||
@ -37,13 +38,14 @@
|
||||
}
|
||||
else if (mime.StartsWith("video/"))
|
||||
{
|
||||
<meta property="og:type" content="video"/>
|
||||
<meta property="og:type" content="video.other"/>
|
||||
<meta property="og:image" content=""/>
|
||||
<meta property="og:video" content="@link"/>
|
||||
<meta property="og:video:type" content="@mime"/>
|
||||
}
|
||||
else if (mime.StartsWith("audio/"))
|
||||
{
|
||||
<meta property="og:type" content="audio"/>
|
||||
<meta property="og:type" content="audio.other"/>
|
||||
<meta property="og:audio" content="@link"/>
|
||||
<meta property="og:audio:type" content="@mime"/>
|
||||
}
|
||||
@ -52,6 +54,7 @@
|
||||
else
|
||||
{
|
||||
<title>void.cat</title>
|
||||
<meta property="og:type" content="website"/>
|
||||
<meta name="description" content="void.cat - free, simple file sharing."/>
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user