@model MyAwesomeBlog.Web.Site.Models.Posts.DetailViewModel
@{
    ViewData["Title"] = "Detail";
}

<div class="row">
    @if (Model is null)
    {
        <div class="col-md-12">
            <h1>Ops! The post you searched for does not exist</h1>
            <h2>Please, go back to the post list</h2>
        </div>
    }
    else
    {
        <div class="col-md-8">
            <h1>@Model.Title</h1>
            <p>
                <small>published on @Model.PublishDate.ToShortDateString()</small>
            </p>
            <hr />
            @if (!string.IsNullOrWhiteSpace(Model.Content))
            {
                <div>
                    @(new Microsoft.AspNetCore.Html.HtmlString(Markdown.ToHtml(Model.Content)))
                </div>
            }
        </div>
        <div class="col-md-4">
            <h2>Comments goes here...</h2>
        </div>
    }
</div>

<p>
    <a asp-action="Archive" asp-controller="Posts">View all posts</a>
</p>
