Remove deprecated fields and methods for v0.15

Special thanks to @bep for his guidance and
for making sure all of the Hugo themes get updated.

Fixes #1172
This commit is contained in:
Anthony Fok 2015-07-30 01:17:10 -06:00 committed by Bjørn Erik Pedersen
parent b23b546a30
commit 252ea96d1d
6 changed files with 0 additions and 78 deletions

View file

@ -19,7 +19,6 @@ import (
"strings"
"github.com/spf13/cast"
"github.com/spf13/hugo/helpers"
)
type MenuEntry struct {
@ -38,12 +37,6 @@ type Menu []*MenuEntry
type Menus map[string]*Menu
type PageMenus map[string]*MenuEntry
// Url is deprecated. Will be removed in 0.15.
func (me *MenuEntry) Url() string {
helpers.Deprecated("MenuEntry", ".Url", ".URL")
return me.URL
}
func (me *MenuEntry) AddChild(child *MenuEntry) {
me.Children = append(me.Children, child)
me.Children.Sort()

View file

@ -17,8 +17,6 @@ import (
"html/template"
"sync"
"time"
"github.com/spf13/hugo/helpers"
)
type Node struct {
@ -134,24 +132,6 @@ type URLPath struct {
Section string
}
// Url is deprecated. Will be removed in 0.15.
func (n *Node) Url() string {
helpers.Deprecated("Node", ".Url", ".URL")
return n.URL
}
// UrlPath is deprecated. Will be removed in 0.15.
func (n *Node) UrlPath() URLPath {
helpers.Deprecated("Node", ".UrlPath", ".URLPath")
return n.URLPath
}
// Url is deprecated. Will be removed in 0.15.
func (up URLPath) Url() string {
helpers.Deprecated("URLPath", ".Url", ".URL")
return up.URL
}
// Scratch returns the writable context associated with this Node.
func (n *Node) Scratch() *Scratch {
if n.scratch == nil {

View file

@ -74,12 +74,6 @@ 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 Pages on this page.
// Note: If this return a non-empty result, then PageGroups() will return empty.
func (p *Pager) Pages() Pages {

View file

@ -107,7 +107,6 @@ func doTestPages(t *testing.T, paginator *paginator) {
first := paginatorPages[0]
assert.Equal(t, template.HTML("page/1/"), first.URL())
assert.Equal(t, first.URL(), first.Url())
assert.Equal(t, first, first.First())
assert.True(t, first.HasNext())
assert.Equal(t, paginatorPages[1], first.Next())

View file

@ -132,24 +132,6 @@ type SiteInfo struct {
// linkedin
type SiteSocial map[string]string
// BaseUrl is deprecated. Will be removed in 0.15.
func (s *SiteInfo) BaseUrl() template.URL {
helpers.Deprecated("Site", ".BaseUrl", ".BaseURL")
return s.BaseURL
}
// Recent is deprecated. Will be removed in 0.15.
func (s *SiteInfo) Recent() *Pages {
helpers.Deprecated("Site", ".Recent", ".Pages")
return s.Pages
}
// Indexes is deprecated. Will be removed in 0.15.
func (s *SiteInfo) Indexes() *TaxonomyList {
helpers.Deprecated("Site", ".Indexes", ".Taxonomies")
return &s.Taxonomies
}
func (s *SiteInfo) GetParam(key string) interface{} {
v := s.Params[strings.ToLower(key)]

View file

@ -1356,32 +1356,6 @@ func init() {
"ReadDir": ReadDir,
"seq": helpers.Seq,
"getenv": func(varName string) string { return os.Getenv(varName) },
// "getJson" is deprecated. Will be removed in 0.15.
"getJson": func(urlParts ...string) interface{} {
helpers.Deprecated("Template", "getJson", "getJSON")
return GetJSON(urlParts...)
},
// "getJson" is deprecated. Will be removed in 0.15.
"getCsv": func(sep string, urlParts ...string) [][]string {
helpers.Deprecated("Template", "getCsv", "getCSV")
return GetCSV(sep, urlParts...)
},
// "safeHtml" is deprecated. Will be removed in 0.15.
"safeHtml": func(text string) template.HTML {
helpers.Deprecated("Template", "safeHtml", "safeHTML")
return SafeHTML(text)
},
// "safeCss" is deprecated. Will be removed in 0.15.
"safeCss": func(text string) template.CSS {
helpers.Deprecated("Template", "safeCss", "safeCSS")
return SafeCSS(text)
},
// "safeUrl" is deprecated. Will be removed in 0.15.
"safeUrl": func(text string) template.URL {
helpers.Deprecated("Template", "safeUrl", "safeURL")
return SafeURL(text)
},
}
}