@page "/docs/{Slug}"
@inject Web.Services.DocsService DocsService
@(doc?.Title ?? "Not Found")
@if (loading)
{
Loading...
}
else if (doc == null)
{
Not Found
The document "@Slug" could not be found.
← Back to Docs
}
else
{
@doc.Title
@if (!string.IsNullOrEmpty(doc.FrontmatterHtml))
{
Frontmatter
@((MarkupString)doc.FrontmatterHtml)
}
@((MarkupString)doc.HtmlContent)
}
@code {
[Parameter] public string Slug { get; set; } = "";
private Web.Models.NoteDocument? doc;
private bool loading = true;
protected override async Task OnInitializedAsync()
{
doc = await DocsService.GetNoteAsync(Slug);
loading = false;
}
}