Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Views/Blog/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@inject IOptionsSnapshot<BlogSettings> settings
@{
int currentPage = int.Parse(ViewContext.RouteData.Values["page"] as string ?? "0");
int pageCount = Model.ToList().Count;
}

@foreach (var post in Model)
Expand All @@ -10,7 +11,7 @@
}

<nav class="pagination container" aria-label="Pagination">
@if (Model.Any())
@if (Model.Any() && currentPage < pageCount)
{
<a rel="prev" href="@ViewData["prev"]" title="Older posts">&laquo; Older</a>
}
Expand All @@ -21,7 +22,7 @@
<br /><br />

@section Head {
@if (Model.Any())
@if (Model.Any() && currentPage < pageCount)
{
<link rel="prev" href="@ViewData["prev"]" />
}
Expand Down