💄 Add titles to the hosted pages
This commit is contained in:
@@ -15,22 +15,13 @@
|
||||
if (Model.UserAccount != null)
|
||||
{
|
||||
pageTitle = $"About {Model.UserAccount.Nick ?? Model.UserAccount.Name}";
|
||||
if (!string.IsNullOrWhiteSpace(Model.UserAccount.Profile?.Bio))
|
||||
{
|
||||
pageDescription = Model.UserAccount.Profile.Bio;
|
||||
}
|
||||
else
|
||||
{
|
||||
pageDescription = $"Profile of {Model.UserAccount.Nick ?? Model.UserAccount.Name} on {siteName}";
|
||||
}
|
||||
pageDescription = !string.IsNullOrWhiteSpace(Model.UserAccount.Profile?.Bio) ? Model.UserAccount.Profile.Bio : $"Profile of {Model.UserAccount.Nick ?? Model.UserAccount.Name} on {siteName}";
|
||||
|
||||
ogType = "profile";
|
||||
ogImageUrl = Model.UserPictureUrl;
|
||||
ogImageUrl = Model.UserBackgroundUrl;
|
||||
if (!string.IsNullOrEmpty(ogImageUrl) && !ogImageUrl.StartsWith("http"))
|
||||
{
|
||||
ogImageUrl = $"{Request.Scheme}://{Request.Host}{ogImageUrl}";
|
||||
}
|
||||
}
|
||||
else if (Model.Site != null)
|
||||
{
|
||||
pageTitle = $"About {Model.Site.Name}";
|
||||
@@ -38,6 +29,7 @@
|
||||
{
|
||||
pageDescription = Model.Site.Description;
|
||||
}
|
||||
|
||||
ogType = "website";
|
||||
ogImageUrl = null;
|
||||
}
|
||||
@@ -46,10 +38,12 @@
|
||||
{
|
||||
pageDescription = pageDescription.Substring(0, 157) + "...";
|
||||
}
|
||||
|
||||
ViewData["Title"] = $"{pageTitle} - {siteName}";
|
||||
}
|
||||
|
||||
@section Head {
|
||||
<title>@pageTitle - @siteName</title>
|
||||
|
||||
<meta name="description" content="@pageDescription"/>
|
||||
<link rel="canonical" href="@canonicalUrl"/>
|
||||
|
||||
@@ -359,7 +353,7 @@
|
||||
<div class="flex flex-col p-5 opacity-80 text-sm">
|
||||
<p>Proudly powered by the Solar Network Pages</p>
|
||||
<p>Hosted on the Solar Network</p>
|
||||
<p class="mt-2">Networking with Cloudflare</p>
|
||||
<p class="mt-2">Network powered by Cloudflare</p>
|
||||
<p>Therefore, if the site is down, 99% is Cloudflare's fault</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,21 +8,20 @@
|
||||
var pageDescription = "A collection of posts.";
|
||||
string? ogImageUrl = null;
|
||||
var canonicalUrl = $"{Request.Scheme}://{Request.Host}{Request.Path}{Request.QueryString}";
|
||||
var siteName = Model.Publisher?.Nick ?? Model.Publisher?.Name ?? "Solar Network";
|
||||
var siteName = Model.Site?.Name ?? "Solar Network";
|
||||
|
||||
if (Model.Publisher != null)
|
||||
{
|
||||
pageTitle = $"Posts by {Model.Publisher.Nick ?? Model.Publisher.Name}";
|
||||
pageDescription = $"Browse posts written by {Model.Publisher.Nick ?? Model.Publisher.Name}.";
|
||||
pageTitle = $"Posts";
|
||||
pageDescription = $"Browse posts written by {Model.Publisher.Nick}.";
|
||||
if (Model.Publisher.Background != null)
|
||||
{
|
||||
ogImageUrl = $"{Request.Scheme}://{Request.Host}/drive/files/{Model.Publisher.Background.Id}";
|
||||
}
|
||||
}
|
||||
ViewData["Title"] = $"{pageTitle} - {siteName}";
|
||||
}
|
||||
|
||||
@section Head {
|
||||
<title>@pageTitle - @siteName</title>
|
||||
|
||||
<meta name="description" content="@pageDescription" />
|
||||
<link rel="canonical" href="@canonicalUrl" />
|
||||
|
||||
|
||||
@@ -24,10 +24,11 @@
|
||||
ogImageUrl = $"{Request.Scheme}://{Request.Host}/drive/files/{imageAttachment.Id}";
|
||||
}
|
||||
}
|
||||
ViewData["Title"] = pageTitle;
|
||||
}
|
||||
|
||||
@section Head {
|
||||
<title>@pageTitle</title>
|
||||
|
||||
@if (!string.IsNullOrWhiteSpace(pageDescription))
|
||||
{
|
||||
<meta name="description" content="@pageDescription" />
|
||||
@@ -46,10 +47,10 @@
|
||||
|
||||
@if(post != null)
|
||||
{
|
||||
<meta property="article:published_time" content="@post.CreatedAt.ToString("o", System.Globalization.CultureInfo.InvariantCulture)" />
|
||||
<meta property="article:published_time" content="@post.CreatedAt.ToString()" />
|
||||
@if (post.EditedAt.HasValue)
|
||||
{
|
||||
<meta property="article:modified_time" content="@post.EditedAt.Value.ToString("o", System.Globalization.CultureInfo.InvariantCulture)" />
|
||||
<meta property="article:modified_time" content="@post.EditedAt.Value.ToString()" />
|
||||
}
|
||||
|
||||
@foreach (var tag in post.Tags)
|
||||
|
||||
Reference in New Issue
Block a user