Updated admin page to be more streamlined and added the beginning of the blogging features
This commit is contained in:
36
OpenArchival.Blazor/Components/Pages/About.razor
Normal file
36
OpenArchival.Blazor/Components/Pages/About.razor
Normal file
@@ -0,0 +1,36 @@
|
||||
@using Microsoft.Extensions.Options
|
||||
@using OpenArchival.Blazor.Config;
|
||||
|
||||
@page "/about"
|
||||
|
||||
<PageTitle>About</PageTitle>
|
||||
@if (string.IsNullOrEmpty(_htmlContent))
|
||||
{
|
||||
<p>Loading content...</p>
|
||||
}
|
||||
else
|
||||
{
|
||||
@((MarkupString)_htmlContent)
|
||||
}
|
||||
|
||||
@inject IOptions<ApplicationOptions> AppOptions;
|
||||
@code {
|
||||
private string _htmlContent = $"<h1>HTML file not found for about page. Create one at /admin/aboutpageeditor</h1>";
|
||||
|
||||
protected override async void OnInitialized()
|
||||
{
|
||||
try
|
||||
{
|
||||
using var reader = new StreamReader(AppOptions.Value.AboutPageContentLocation);
|
||||
_htmlContent = await reader.ReadToEndAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_htmlContent = $"<h1>HTML file not found for homepage. Create one at /admin/aboutpageeditor</h1>";
|
||||
}
|
||||
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user