diff --git a/frontend/templates/blog.go.tmpl b/frontend/templates/blog.go.tmpl index 20c08b6..8c9a00a 100644 --- a/frontend/templates/blog.go.tmpl +++ b/frontend/templates/blog.go.tmpl @@ -13,6 +13,29 @@ {{ template "menu.go.tmpl" . }} + +{{ if (gt .Pagination.Page 1) }} +
+ +
+{{ end }} +
{{ range .Posts }} @@ -20,6 +43,29 @@ {{ end }}
+ +{{ if (gt .Pagination.Total 1) }} +
+ +
+{{ end }} + diff --git a/frontend/templates/funcs.go b/frontend/templates/funcs.go index 3315be5..16f265e 100644 --- a/frontend/templates/funcs.go +++ b/frontend/templates/funcs.go @@ -4,8 +4,17 @@ import "html/template" func UseFuncs() template.FuncMap { return template.FuncMap{ + "add": func(i int) int { + return i + 1 + }, + "sub": func(i int) int { + return i - 1 + }, "getIndexURL": func() string { return URLIndex }, + "getBlogURL": func() string { + return URLBlog + }, } } diff --git a/frontend/templates/index.go.tmpl b/frontend/templates/index.go.tmpl index ca569f2..ebbafd5 100644 --- a/frontend/templates/index.go.tmpl +++ b/frontend/templates/index.go.tmpl @@ -33,6 +33,20 @@ {{ end }} + +{{ if (gt .Pagination.Total 1) }} +
+ +
+{{ end }} +