shithub: hugo

Download patch

ref: 252ea96d1d359b485bae489327a8219d102f0607
parent: b23b546a30df792ad2c8f0cf3ec1be30c53ba34d
author: Anthony Fok <[email protected]>
date: Wed Jul 29 21:17:10 EDT 2015

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

--- a/hugolib/menu.go
+++ b/hugolib/menu.go
@@ -19,7 +19,6 @@
 	"strings"
 
 	"github.com/spf13/cast"
-	"github.com/spf13/hugo/helpers"
 )
 
 type MenuEntry struct {
@@ -37,12 +36,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)
--- a/hugolib/node.go
+++ b/hugolib/node.go
@@ -17,8 +17,6 @@
 	"html/template"
 	"sync"
 	"time"
-
-	"github.com/spf13/hugo/helpers"
 )
 
 type Node struct {
@@ -132,24 +130,6 @@
 	Permalink template.HTML
 	Slug      string
 	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.
--- a/hugolib/pagination.go
+++ b/hugolib/pagination.go
@@ -74,12 +74,6 @@
 	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 {
--- a/hugolib/pagination_test.go
+++ b/hugolib/pagination_test.go
@@ -107,7 +107,6 @@
 
 	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())
--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -132,24 +132,6 @@
 // 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)]
 
--- a/tpl/template_funcs.go
+++ b/tpl/template_funcs.go
@@ -1356,32 +1356,6 @@
 		"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)
-		},
 	}
 
 }