shithub: hugo

Download patch

ref: fb594fc6e0b5adcbc7e5f5e40be6ac0ff4886493
parent: a6d22bcf7dd96a8dd30e7ce27cb88b45f85c2407
author: bep <[email protected]>
date: Mon Jan 26 10:26:19 EST 2015

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

--- a/commands/hugo.go
+++ b/commands/hugo.go
@@ -136,7 +136,7 @@
 	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))
 
--- a/docs/content/extras/pagination.md
+++ b/docs/content/extras/pagination.md
@@ -17,11 +17,13 @@
 
 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
 
 **A `.Paginator` is provided to help building a pager menu. This is only relevant for the templates for the home page and the list pages (sections and taxonomies).**  
@@ -90,5 +92,4 @@
 ....
 ```
 
-[^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`.
 
--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -1293,9 +1293,7 @@
 	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 {