Paging #4
|
|
@ -164,11 +164,11 @@ func (b *Builder) renderPostListWithCategories(bctx buildContext, ctx context.Co
|
|||
if page == 2 {
|
||||
prevURL = "/posts/"
|
||||
} else {
|
||||
prevURL = fmt.Sprintf("/posts/page/%d/", page-1)
|
||||
prevURL = fmt.Sprintf("/posts/%d/", page-1)
|
||||
}
|
||||
}
|
||||
if page < totalPages {
|
||||
nextURL = fmt.Sprintf("/posts/page/%d/", page+1)
|
||||
nextURL = fmt.Sprintf("/posts/%d/", page+1)
|
||||
}
|
||||
|
||||
pl := postListData{
|
||||
|
|
@ -184,7 +184,7 @@ func (b *Builder) renderPostListWithCategories(bctx buildContext, ctx context.Co
|
|||
if page == 1 {
|
||||
paths = []string{"", "/posts"}
|
||||
} else {
|
||||
paths = []string{fmt.Sprintf("/posts/page/%d", page)}
|
||||
paths = []string{fmt.Sprintf("/posts/%d", page)}
|
||||
}
|
||||
|
||||
for _, path := range paths {
|
||||
|
|
@ -423,16 +423,16 @@ func (b *Builder) renderCategoryPages(ctx buildContext, goCtx context.Context) e
|
|||
if page == 2 {
|
||||
prevURL = basePath + "/"
|
||||
} else {
|
||||
prevURL = fmt.Sprintf("%s/page/%d/", basePath, page-1)
|
||||
prevURL = fmt.Sprintf("%s/%d/", basePath, page-1)
|
||||
}
|
||||
}
|
||||
if page < totalPages {
|
||||
nextURL = fmt.Sprintf("%s/page/%d/", basePath, page+1)
|
||||
nextURL = fmt.Sprintf("%s/%d/", basePath, page+1)
|
||||
}
|
||||
|
||||
path := basePath
|
||||
if page > 1 {
|
||||
path = fmt.Sprintf("%s/page/%d", basePath, page)
|
||||
path = fmt.Sprintf("%s/%d", basePath, page)
|
||||
}
|
||||
|
||||
data := categorySingleData{
|
||||
|
|
|
|||
Loading…
Reference in a new issue