change link

This commit is contained in:
Kieran 2023-05-22 19:15:44 +01:00
parent e5c85aec55
commit fdb01bc438
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941

View File

@ -1,6 +1,6 @@
@using VoidCat.Model
@model VoidCat.Controllers.IndexController.IndexModel
@inject VoidSettings settings
@inject VoidSettings Settings
<!DOCTYPE html>
<html lang="en">
<head>
@ -10,43 +10,45 @@
<link rel="icon" href="/favicon.ico"/>
<link rel="apple-touch-icon" href="/logo.png"/>
<link rel="manifest" href="/manifest.json"/>
@if (Model.Meta != default)
{
var ub = new UriBuilder(settings.SiteUrl)
var ubDownload = new UriBuilder(Settings.SiteUrl)
{
Path = $"/d/{Model.Id.ToBase58()}"
};
var link = ub.ToString();
var ubView = new UriBuilder(Settings.SiteUrl)
{
Path = $"/{Model.Id.ToBase58()}"
};
<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="@link"/>
<meta property="og:url" content="@ubView"/>
var mime = Model.Meta.MimeType;
if (!string.IsNullOrEmpty(mime))
{
if (mime.StartsWith("image/"))
{
<meta property="og:type" content="image"/>
<meta property="og:image" content="@link"/>
<meta property="og:image" content="@ubDownload"/>
<meta property="og:image:type" content="@mime"/>
}
else if (mime.StartsWith("video/"))
{
<meta property="og:type" content="video.other"/>
<meta property="og:image" content=""/>
<meta property="og:video" content="@link"/>
<meta property="og:video" content="@ubDownload"/>
<meta property="og:video:type" content="@mime"/>
}
else if (mime.StartsWith("audio/"))
{
<meta property="og:type" content="audio.other"/>
<meta property="og:audio" content="@link"/>
<meta property="og:audio" content="@ubDownload"/>
<meta property="og:audio:type" content="@mime"/>
}
}
@ -57,7 +59,7 @@
<meta property="og:type" content="website"/>
<meta name="description" content="void.cat - free, simple file sharing."/>
}
@foreach (var ep in Model.Manifest.Entrypoints)
{
switch (System.IO.Path.GetExtension(ep))
@ -76,7 +78,6 @@
}
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>
</html>