From 252ea96d1d359b485bae489327a8219d102f0607 Mon Sep 17 00:00:00 2001 From: Anthony Fok Date: Thu, 30 Jul 2015 01:17:10 -0600 Subject: [PATCH] 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 --- hugolib/menu.go | 7 ------- hugolib/node.go | 20 -------------------- hugolib/pagination.go | 6 ------ hugolib/pagination_test.go | 1 - hugolib/site.go | 18 ------------------ tpl/template_funcs.go | 26 -------------------------- 6 files changed, 78 deletions(-) diff --git a/hugolib/menu.go b/hugolib/menu.go index 95370062b..322e9c7d5 100644 --- a/hugolib/menu.go +++ b/hugolib/menu.go @@ -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() diff --git a/hugolib/node.go b/hugolib/node.go index ecf5e32fa..f8f8df594 100644 --- a/hugolib/node.go +++ b/hugolib/node.go @@ -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 { diff --git a/hugolib/pagination.go b/hugolib/pagination.go index 2f8d87621..acd406ed1 100644 --- a/hugolib/pagination.go +++ b/hugolib/pagination.go @@ -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 { diff --git a/hugolib/pagination_test.go b/hugolib/pagination_test.go index 635608cdd..b806a10e0 100644 --- a/hugolib/pagination_test.go +++ b/hugolib/pagination_test.go @@ -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()) diff --git a/hugolib/site.go b/hugolib/site.go index 4457e1050..b61397a99 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -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)] diff --git a/tpl/template_funcs.go b/tpl/template_funcs.go index fdf4d9f18..c3c0c50aa 100644 --- a/tpl/template_funcs.go +++ b/tpl/template_funcs.go @@ -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) - }, } }