From fb594fc6e0b5adcbc7e5f5e40be6ac0ff4886493 Mon Sep 17 00:00:00 2001 From: bep Date: Mon, 26 Jan 2015 15:26:19 +0100 Subject: [PATCH] Set detault for Paginate to 10 10 is a better default than 0, since no paginator pages will be created unles referenced by a `.Paginator`. See #750 --- commands/hugo.go | 2 +- docs/content/extras/pagination.md | 7 ++++--- hugolib/site.go | 4 +--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/commands/hugo.go b/commands/hugo.go index d2b4ed52a..cce37a5f9 100644 --- a/commands/hugo.go +++ b/commands/hugo.go @@ -136,7 +136,7 @@ func InitializeConfig() { viper.SetDefault("FootnoteAnchorPrefix", "") viper.SetDefault("FootnoteReturnLinkContents", "") viper.SetDefault("NewContentEditor", "") - viper.SetDefault("Paginate", 0) + viper.SetDefault("Paginate", 10) viper.SetDefault("PaginatePath", "page") viper.SetDefault("Blackfriday", new(helpers.Blackfriday)) diff --git a/docs/content/extras/pagination.md b/docs/content/extras/pagination.md index 5d27765a1..e9c28c982 100644 --- a/docs/content/extras/pagination.md +++ b/docs/content/extras/pagination.md @@ -17,10 +17,12 @@ Hugo supports pagination for the home page, sections and taxonomies. Pagination can be configured in the site configuration (e.g. `config.toml`): -* `Paginate` (default `0`) +* `Paginate` (default `10`) * `PaginatePath` (default `page`) -Setting `Paginate` to a positive value will split the list pages for the home page, sections and taxonomies into chunks of that size.[^lazy] `PaginatePath` is used to adapt the `Url` to the pages in the paginator (the default setting will produce urls on the form `/page/1/`. +Setting `Paginate` to a positive value will split the list pages for the home page, sections and taxonomies into chunks of that size. But note that the generation of the pagination pages for sections, taxonomies and home page is *lazy* -- the pages will not be created if not referenced by a `.Paginator` (see below). + + `PaginatePath` is used to adapt the `Url` to the pages in the paginator (the default setting will produce urls on the form `/page/1/`. ## List the pages @@ -90,5 +92,4 @@ The pages are built on the following form (`BLANK` means no value): .... ``` -[^lazy]: The generation of the pagination pages for sections, taxonomies and home page is *lazy* -- they will not be created if not referenced by a `.Paginator`. diff --git a/hugolib/site.go b/hugolib/site.go index 1877dbf11..80107344c 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -1293,9 +1293,7 @@ func (s *Site) Stats() { jww.FEEDBACK.Println(s.draftStats()) jww.FEEDBACK.Println(s.futureStats()) jww.FEEDBACK.Printf("%d pages created \n", len(s.Pages)) - if viper.GetInt("paginate") > 0 { - jww.FEEDBACK.Printf("%d paginator pages created \n", s.Info.paginationPageCount) - } + jww.FEEDBACK.Printf("%d paginator pages created \n", s.Info.paginationPageCount) taxonomies := viper.GetStringMapString("Taxonomies") for _, pl := range taxonomies {