@using Microsoft.Extensions.Configuration
@model IEnumerable<VmArticleMini>
@inject IConfiguration _configuration
@{
//var htmlParse = new HtmlParser();
}
@foreach (var item in Model)
{
<div class="article shadow layui-anim layui-anim-upbit">
@if (!string.IsNullOrEmpty(item.MainImage))
{
<div class="article-left">
<img data-src="@item.MainImage" class="lazy" alt="@item.Title" src="@(_configuration["CDNBaseAddress"])/loaders/puff.svg"/>
</div>
<div class="article-right">
<div class="article-title">
<a asp-action="Read" asp-controller="Article" asp-route-id="@item.Id" data-pjax>@item.Title</a>
</div>
<div class="article-abstract">
@Html.Raw(item.Introduction)
</div>
</div>
}
else
{
<div class="article-right" style="width:100%">
<div class="article-title">
<a asp-action="Read" asp-controller="Article" asp-route-id="@item.Id" data-pjax>@item.Title</a>
</div>
<div class="article-abstract">
@Html.Raw(item.Introduction)
</div>
</div>
}
<div class="clear"></div>
<div class="article-footer">
<span>
<i class="fa fa-clock-o"></i>
<time class="timeago" datetime="@item.CreateTime">@item.CreateTime</time>
</span>
<span class="article-author"><i class="fa fa-user"></i> @item.Author.Name</span>
@foreach (var tag in item.Tags)
{
<span><i class="fa fa-tag"></i> <a asp-action="Index" asp-controller="Article" asp-route-tag="@tag" data-pjax>@tag</a></span>
}
<span class="article-viewinfo"><i class="fa fa-eye"></i> @item.ViewCount</span>
<span class="article-viewinfo"><i class="fa fa-commenting"></i> @item.CommentCount</span>
</div>
</div>
}