@@ -53,7 +53,7 @@ func (p *paginationExtension) addArchivesPagination() {
5353 if err != nil {
5454 return nil , err
5555 }
56- return p .getPagination (ctx , page , total , display , prefix , suffix )
56+ return p .getPagination (ctx , page , total , display , "/" + prefix , suffix )
5757 }
5858 p .Template .AddFunc ("archivesPagination" , archivesPagination )
5959}
@@ -81,7 +81,7 @@ func (p *paginationExtension) addTagPostsPagination() {
8181 if err != nil {
8282 return nil , err
8383 }
84- return p .getPagination (ctx , page , total , display , tagPrefix .(string )+ "/" + slug , suffix )
84+ return p .getPagination (ctx , page , total , display , "/" + tagPrefix .(string )+ "/" + slug , suffix )
8585 }
8686 p .Template .AddFunc ("tagPostsPagination" , tagPostsPagination )
8787}
@@ -97,7 +97,7 @@ func (p *paginationExtension) addCategoryPostsPagination() {
9797 if err != nil {
9898 return nil , err
9999 }
100- return p .getPagination (ctx , page , total , display , categoryPrefix .(string )+ "/" + slug , suffix )
100+ return p .getPagination (ctx , page , total , display , "/" + categoryPrefix .(string )+ "/" + slug , suffix )
101101 }
102102 p .Template .AddFunc ("categoryPostsPagination" , categoryPostsPagination )
103103}
@@ -113,7 +113,7 @@ func (p *paginationExtension) addPhotosPagination() {
113113 if err != nil {
114114 return nil , err
115115 }
116- return p .getPagination (ctx , page , total , display , prefix , suffix )
116+ return p .getPagination (ctx , page , total , display , "/" + prefix , suffix )
117117 }
118118 p .Template .AddFunc ("photosPagination" , photosPagination )
119119}
@@ -129,7 +129,7 @@ func (p *paginationExtension) addJournalsPagination() {
129129 if err != nil {
130130 return nil , err
131131 }
132- return p .getPagination (ctx , page , total , display , prefix , suffix )
132+ return p .getPagination (ctx , page , total , display , "/" + prefix , suffix )
133133 }
134134 p .Template .AddFunc ("journalsPagination" , journalsPagination )
135135}
@@ -154,12 +154,12 @@ func (p *paginationExtension) getPagination(ctx context.Context, page, total, di
154154
155155 rainbow := util .RainbowPage (page + 1 , total , display )
156156
157- rainbowPages := make ([]vo.RainbowPage , len (rainbow ), len ( rainbow ) )
157+ rainbowPages := make ([]vo.RainbowPage , len (rainbow ))
158158
159159 nextPageFullPath += prefix + "/page/" + strconv .Itoa (page + 2 ) + suffix
160160
161161 if page == 1 {
162- prevPageFullPath += "/"
162+ prevPageFullPath += prefix + "/"
163163 } else {
164164 prevPageFullPath += prefix + "/page/" + strconv .Itoa (page ) + suffix
165165 }
0 commit comments