hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit ae5a45be6f0ee4d5c52b38fd28b22b55d9cd7b2d
parent 4d912e2aad39bfe8d76672cf53b01317792e02c5
Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Date:   Thu, 25 Jan 2018 17:08:18 +0100

hugolib: Remove unused code

Diffstat:
Mhugolib/fileInfo.go | 4----
Mhugolib/hugo_sites.go | 6------
Mhugolib/menu.go | 7-------
Mhugolib/page.go | 4----
Mhugolib/page_bundler_capture.go | 3---
Mhugolib/page_bundler_handlers.go | 8++------
Mhugolib/page_collections.go | 12------------
Mhugolib/site.go | 58----------------------------------------------------------
Mhugolib/site_test.go | 5-----
9 files changed, 2 insertions(+), 105 deletions(-)
diff --git a/hugolib/fileInfo.go b/hugolib/fileInfo.go
@@ -103,7 +103,3 @@ func (b bundleDirType) String() string {
 
 	return ""
 }
-
-func (b bundleDirType) isBundle() bool {
-	return b > bundleNot
-}
diff --git a/hugolib/hugo_sites.go b/hugolib/hugo_sites.go
@@ -478,12 +478,6 @@ func (h *HugoSites) createMissingPages() error {
 	return nil
 }
 
-func (h *HugoSites) removePageByPathPrefix(path string) {
-	for _, s := range h.Sites {
-		s.removePageByPathPrefix(path)
-	}
-}
-
 func (h *HugoSites) removePageByPath(path string) {
 	for _, s := range h.Sites {
 		s.removePageByPath(path)
diff --git a/hugolib/menu.go b/hugolib/menu.go
@@ -46,13 +46,6 @@ type Menus map[string]*Menu
 // PageMenus is a dictionary of menus defined in the Pages.
 type PageMenus map[string]*MenuEntry
 
-// addChild adds a new child to this menu entry.
-// The default sort order will then be applied.
-func (m *MenuEntry) addChild(child *MenuEntry) {
-	m.Children = append(m.Children, child)
-	m.Children.Sort()
-}
-
 // HasChildren returns whether this menu item has any children.
 func (m *MenuEntry) HasChildren() bool {
 	return m.Children != nil
diff --git a/hugolib/page.go b/hugolib/page.go
@@ -1988,10 +1988,6 @@ func (p *Page) LanguagePrefix() string {
 	return p.Site.LanguagePrefix
 }
 
-func (p *Page) addLangPathPrefix(outfile string) string {
-	return p.addLangPathPrefixIfFlagSet(outfile, p.shouldAddLanguagePrefix())
-}
-
 func (p *Page) addLangPathPrefixIfFlagSet(outfile string, should bool) string {
 	if helpers.IsAbsURL(outfile) {
 		return outfile
diff --git a/hugolib/page_bundler_capture.go b/hugolib/page_bundler_capture.go
@@ -510,9 +510,6 @@ func (c *capturer) newFileInfo(filename string, fi os.FileInfo, tp bundleDirType
 	return newFileInfo(c.sourceSpec, c.baseDir, filename, fi, tp)
 }
 
-type singlesHandler func(fis ...*fileInfo)
-type bundlesHandler func(b *bundleDirs)
-
 type fileInfoName struct {
 	os.FileInfo
 	filename string
diff --git a/hugolib/page_bundler_handlers.go b/hugolib/page_bundler_handlers.go
@@ -182,15 +182,11 @@ type (
 		resource resource.Resource
 	}
 
-	contentHandlerChain func(h contentHandler) contentHandler
-	contentHandler      func(ctx *handlerContext) handlerResult
+	contentHandler func(ctx *handlerContext) handlerResult
 )
 
 var (
-	notHandled        handlerResult
-	noOpContenHandler = func(ctx *handlerContext) handlerResult {
-		return handlerResult{handled: true}
-	}
+	notHandled handlerResult
 )
 
 func (c *contentHandlers) parsePage(h contentHandler) contentHandler {
diff --git a/hugolib/page_collections.go b/hugolib/page_collections.go
@@ -170,18 +170,6 @@ func (c *PageCollections) addPage(page *Page) {
 	c.rawAllPages = append(c.rawAllPages, page)
 }
 
-// When we get a REMOVE event we're not always getting all the individual files,
-// so we need to remove all below a given path.
-func (c *PageCollections) removePageByPathPrefix(path string) {
-	for {
-		i := c.rawAllPages.findFirstPagePosByFilePathPrefix(path)
-		if i == -1 {
-			break
-		}
-		c.rawAllPages = append(c.rawAllPages[:i], c.rawAllPages[i+1:]...)
-	}
-}
-
 func (c *PageCollections) removePageByPath(path string) {
 	if i := c.rawAllPages.findPagePosByFilePath(path); i >= 0 {
 		c.clearResourceCacheForPage(c.rawAllPages[i])
diff --git a/hugolib/site.go b/hugolib/site.go
@@ -398,7 +398,6 @@ type siteBuilderCfg struct {
 	language        *helpers.Language
 	s               *Site
 	pageCollections *PageCollections
-	baseURL         string
 }
 
 // TODO(bep) get rid of this
@@ -1787,63 +1786,6 @@ func (s *Site) publish(statCounter *uint64, path string, r io.Reader) (err error
 	return helpers.WriteToDisk(path, r, s.Fs.Destination)
 }
 
-func (s *Site) draftStats() string {
-	var msg string
-
-	switch s.draftCount {
-	case 0:
-		return "0 draft content"
-	case 1:
-		msg = "1 draft rendered"
-	default:
-		msg = fmt.Sprintf("%d drafts rendered", s.draftCount)
-	}
-
-	if s.Cfg.GetBool("buildDrafts") {
-		return fmt.Sprintf("%d of ", s.draftCount) + msg
-	}
-
-	return "0 of " + msg
-}
-
-func (s *Site) futureStats() string {
-	var msg string
-
-	switch s.futureCount {
-	case 0:
-		return "0 future content"
-	case 1:
-		msg = "1 future rendered"
-	default:
-		msg = fmt.Sprintf("%d futures rendered", s.futureCount)
-	}
-
-	if s.Cfg.GetBool("buildFuture") {
-		return fmt.Sprintf("%d of ", s.futureCount) + msg
-	}
-
-	return "0 of " + msg
-}
-
-func (s *Site) expiredStats() string {
-	var msg string
-
-	switch s.expiredCount {
-	case 0:
-		return "0 expired content"
-	case 1:
-		msg = "1 expired rendered"
-	default:
-		msg = fmt.Sprintf("%d expired rendered", s.expiredCount)
-	}
-
-	if s.Cfg.GetBool("buildExpired") {
-		return fmt.Sprintf("%d of ", s.expiredCount) + msg
-	}
-
-	return "0 of " + msg
-}
-
 func getGoMaxProcs() int {
 	if gmp := os.Getenv("GOMAXPROCS"); gmp != "" {
 		if p, err := strconv.Atoi(gmp); err != nil {
diff --git a/hugolib/site_test.go b/hugolib/site_test.go
@@ -31,11 +31,6 @@ import (
 )
 
 const (
-	pageSimpleTitle = `---
-title: simple template
----
-content`
-
 	templateMissingFunc = "{{ .Title | funcdoesnotexists }}"
 	templateWithURLAbs  = "<a href=\"/foobar.jpg\">Going</a>"
 )