diff --git a/routers/home.go b/routers/home.go index eddff28ee..50e1a2b2a 100644 --- a/routers/home.go +++ b/routers/home.go @@ -132,6 +132,7 @@ func RenderRepoSearch(ctx *context.Context, opts *RepoSearchOptions) { keyword := strings.Trim(ctx.Query("q"), " ") topicOnly := ctx.QueryBool("topic") + ctx.Data["TopicOnly"] = topicOnly repos, count, err = models.SearchRepository(&models.SearchRepoOptions{ Page: page, @@ -155,6 +156,7 @@ func RenderRepoSearch(ctx *context.Context, opts *RepoSearchOptions) { pager := context.NewPagination(int(count), opts.PageSize, page, 5) pager.SetDefaultParams(ctx) + pager.AddParam(ctx, "topic", "TopicOnly") ctx.Data["Page"] = pager ctx.HTML(200, opts.TplName)