@using System.Net.Http.Json @using Markdig.Extensions.Yaml @using Markdig.Syntax @using YamlDotNet.Serialization @inject HttpClient httpClient @if (content == null) { } else {
@docFrontMatter.Title
Updated: @docFrontMatter.UpdatedDate.ToString("MM/dd/yyyy")
Created: @docFrontMatter.CreatedDate.ToString("MM/dd/yyyy")
@((MarkupString)Markdown.ToHtml(content, Pipeline))
} @code { [Parameter] public DocContentModel DocContentModel { get; set; } = default!; DocFrontMatterModel docFrontMatter = null!; private string? content = null; private string Filepath => $"content/docs/{DocContentModel.Content}.md"; private string GitUrl => $"{Project.GitResourcesUrl}/{Filepath}"; private MarkdownPipeline Pipeline => MarkdownFiles.Pipeline; private async Task LoadContent() { content = await MarkdownFiles.LoadMarkdown(httpClient, Filepath); return docFrontMatter = await MarkdownFiles.LoadFrontMatter(httpClient, Filepath); } protected override async Task OnParametersSetAsync() => await LoadContent(); protected override async Task OnInitializedAsync() => await LoadContent(); }