Put title before instance name, fix empty webhook title trailing dash

This commit is contained in:
jvyden 2022-06-10 04:34:17 -04:00
commit f169236613
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278

View file

@ -25,20 +25,23 @@
} }
Model.IsMobile = Model.Request.IsMobile(); Model.IsMobile = Model.Request.IsMobile();
string title;
if (Model.Title == string.Empty)
{
title = ServerConfiguration.Instance.Customization.ServerName;
}
else
{
title = $"{Model.Title} - {ServerConfiguration.Instance.Customization.ServerName}";
}
} }
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
@if (Model.Title == string.Empty) <title>@title</title>
{
<title>@ServerConfiguration.Instance.Customization.ServerName</title>
}
else
{
<title>@ServerConfiguration.Instance.Customization.ServerName - @Model.Title</title>
}
<link rel="stylesheet" type="text/css" href="~/css/styles.css"> <link rel="stylesheet" type="text/css" href="~/css/styles.css">
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/fomantic-ui@2.8.8/dist/semantic.min.css"> <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/fomantic-ui@2.8.8/dist/semantic.min.css">
@ -52,7 +55,7 @@
@* Embed Stuff *@ @* Embed Stuff *@
<meta name="theme-color" data-react-helmet="true" content="#008cff"> <meta name="theme-color" data-react-helmet="true" content="#008cff">
<meta content="@ServerConfiguration.Instance.Customization.ServerName - @Model.Title" property="og:title"> <meta content="@title" property="og:title">
@if (!string.IsNullOrEmpty(Model.Description)) @if (!string.IsNullOrEmpty(Model.Description))
{ {
<meta content="@Model.Description" property="og:description"> <meta content="@Model.Description" property="og:description">