diff --git a/internal/plugins/pagination.go b/internal/plugins/pagination.go index d4e93bf..3dc95ac 100644 --- a/internal/plugins/pagination.go +++ b/internal/plugins/pagination.go @@ -29,7 +29,7 @@ var twentyFifteen = PageEle{ ้กต %d`, } -func (p PageEle) Current(page, totalPage int) string { +func (p PageEle) Current(page, totalPage, totalRow int) string { return fmt.Sprintf(p.CurrentEle, page) } diff --git a/internal/theme/common/index.go b/internal/theme/common/index.go index e10553b..43e4a47 100644 --- a/internal/theme/common/index.go +++ b/internal/theme/common/index.go @@ -33,8 +33,8 @@ func (i *IndexHandle) ParseIndex(parm *IndexParams) (err error) { i.Stats = constraints.ParamError return } - i.Param.CacheKey = i.Param.getSearchKey() i.Param.ParseParams() + i.Param.CacheKey = i.Param.getSearchKey() i.GinH["title"] = i.Param.getTitle() i.GinH["search"] = i.Param.Search i.GinH["header"] = i.Param.Header diff --git a/plugin/pagination/pagination.go b/plugin/pagination/pagination.go index 4601fed..3148f77 100644 --- a/plugin/pagination/pagination.go +++ b/plugin/pagination/pagination.go @@ -6,7 +6,7 @@ import ( ) type Elements interface { - Current(page, totalPage int) string + Current(page, totalPage, totalRows int) string Prev(url string) string Next(url string) string Dots() string @@ -67,7 +67,7 @@ func (p ParsePagination) ToHtml() (html string) { for page := start; page <= end; page++ { h := "" if p.CurrentPage == page { - h = p.Current(page, p.TotalPage) + h = p.Current(page, p.TotalPage, p.TotalRaw) } else { h = p.Middle(page, p.Url(p.Path, p.Query, page)) }