<gh_stars>0@model EntryViewModel
@{ Layout = "~/views/Layout.cshtml"; }

<hr class="plainscape">
<div class="post" style="min-height: 250px" itemscope itemtype="http://schema.org/Article">
    <h2 itemprop="headline"><a href="@Model.Url" rel="bookmark">@Model.Title</a></h2>
    <meta itemprop="author" content="Aleksey Martynov">
    <div class="postmetadata">@foreach(var block in EnumerateMetaDataBlocks()) { @block(null); }</div>
    <div itemprop="articleBody" class="entry">@Html.Raw(Model.BodyHtml)</div>
</div>

<div id="disqus_thread"></div>

@Html.Partial("~/views/PrevNext.cshtml", Model.PrevNext)
@{
    IEnumerable<RazorBlock> EnumerateMetaDataBlocks() {
        var blocks = new List<RazorBlock>();

        void AddBlock(RazorBlock block) {
            if(blocks.Count > 0)
                blocks.Add(@<text> &bull; </text>);
            blocks.Add(block);
        }

        if(Model.HasDate)
            AddBlock(@<time pubdate itemprop="datePublished" datetime="@Model.MachineDate">@Model.HumanDate</time>);

        if(!String.IsNullOrEmpty(Model.GitHubUrl))
            AddBlock(@<a href="@Model.GitHubUrl" target="_blank">View on GitHub</a>);

        if(Model.IsFossil)
            AddBlock(@<text>blog.amartynov.ru archive</text>);

        return blocks;
    }
}
