You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nikita-tokarch-uk/frontend/templates/blog.go.tmpl

72 lines
1.9 KiB

<!doctype html>
<html lang="en_us">
<!-- render head -->
{{ template "head.go.tmpl" . }}
<body>
<section id="this-is-blog" class="root-container blog-container">
<!-- render menu -->
<div class="menu-container">
{{ template "menu.go.tmpl" . }}
</div>
<!-- render top pagination -->
{{ if (gt .Pagination.Page 1) }}
<div class="pagination-container-top">
<ul>
{{ if (gt .Pagination.Page 1) }}
<li>
<a href="{{ getBlogURL }}?page={{ sub .Pagination.Page }}">{{ sub .Pagination.Page }}</a>
</li>
{{ end }}
<li>
{{ .Pagination.Page }} ←
</li>
{{ if (lt .Pagination.Page .Pagination.Total) }}
<li>
<a href="{{ getBlogURL }}?page={{ add .Pagination.Page }}">{{ add .Pagination.Page }}</a>
</li>
{{ end }}
</ul>
</div>
{{ end }}
<!-- render posts -->
<div class="posts-container">
{{ range .Posts }}
{{ template "post.go.tmpl" . }}
{{ end }}
</div>
<!-- render bottom pagination -->
{{ if (gt .Pagination.Total 1) }}
<div class="pagination-container-bottom">
<ul>
{{ if (gt .Pagination.Page 1) }}
<li>
<a href="{{ getBlogURL }}?page={{ sub .Pagination.Page }}">{{ sub .Pagination.Page }}</a>
</li>
{{ end }}
<li>
{{ .Pagination.Page }} ←
</li>
{{ if (lt .Pagination.Page .Pagination.Total) }}
<li>
<a href="{{ getBlogURL }}?page={{ add .Pagination.Page }}">{{ add .Pagination.Page }}</a>
</li>
{{ end }}
</ul>
</div>
{{ end }}
</section>
</body>
</html>