diff options
author | Anthony Fok <foka@debian.org> | 2015-03-17 22:16:54 -0700 |
---|---|---|
committer | bep <bjorn.erik.pedersen@gmail.com> | 2015-03-18 11:30:37 +0100 |
commit | 8b8fb417ae065954a056ea018bd092748cc9127c (patch) | |
tree | a9160d1f6acc218bcb8728d729deaf1b532b56b3 /hugolib/pagination.go | |
parent | ca69cad8aa5d8eefbce13abd97b2b979339a458c (diff) |
More initialism corrections (golint)
Thanks to @bep's new, brilliant helpers.Deprecated() function,
the following functions or variables are transitioned to their
new names, preserving backward compatibility for v0.14
and warning the user of upcoming obsolescence in v0.15:
* .Url → .URL (for node, menu and paginator)
* .Site.BaseUrl → .Site.BaseURL
* .Site.Indexes → .Site.Taxonomies
* .Site.Recent → .Site.Pages
* getJson → getJSON
* getCsv → getCSV
* safeHtml → safeHTML
* safeCss → safeCSS
* safeUrl → safeURL
Also fix related initialisms in strings and comments.
Continued effort in fixing #959.
Diffstat (limited to 'hugolib/pagination.go')
-rw-r--r-- | hugolib/pagination.go | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/hugolib/pagination.go b/hugolib/pagination.go index b56e64f7f..5401aaa66 100644 --- a/hugolib/pagination.go +++ b/hugolib/pagination.go @@ -47,11 +47,17 @@ func (p *pager) PageNumber() int { return p.number } -// Url returns the url to the current page. -func (p *pager) Url() template.HTML { +// URL returns the URL to the current page. +func (p *pager) URL() template.HTML { return template.HTML(p.paginationURLFactory(p.PageNumber())) } +// Url is deprecated. Will be removed in 0.15. +func (p *pager) Url() template.HTML { + helpers.Deprecated("Paginator", ".Url", ".URL") + return p.URL() +} + // Pages returns the elements on this page. func (p *pager) Pages() Pages { if len(p.paginatedPages) == 0 { @@ -142,7 +148,7 @@ func (n *Node) Paginator() (*pager, error) { return } - pagers, err := paginatePages(n.Data["Pages"], n.Url) + pagers, err := paginatePages(n.Data["Pages"], n.URL) if err != nil { initError = err @@ -184,7 +190,7 @@ func (n *Node) Paginate(seq interface{}) (*pager, error) { if n.paginator != nil { return } - pagers, err := paginatePages(seq, n.Url) + pagers, err := paginatePages(seq, n.URL) if err != nil { initError = err |