feat: add open graph information to pages

This commit is contained in:
Stevan Freeborn
2024-04-14 16:38:50 -05:00
parent 0bc94e2a59
commit 29e83ece20
14 changed files with 120 additions and 13 deletions
+8 -2
View File
@@ -1,7 +1,12 @@
@page "/Error"
@using System.Diagnostics
<PageTitle>Error</PageTitle>
<PageTitle>@PageTitle</PageTitle>
<HeadContent>
<meta name="description" content="@Description" />
<OpenGraph PageTitle="@PageTitle" Description="@Description" />
</HeadContent>
<div class="container">
<h2>Error</h2>
@@ -19,9 +24,10 @@
{
[CascadingParameter]
private HttpContext? HttpContext { get; set; }
private string? RequestId { get; set; }
private bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
private const string PageTitle = "Error - journal";
private const string Description = "An unhandled error occurred while processing your request.";
protected override void OnInitialized() =>
RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier;