diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-01-25 17:08:18 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-01-25 17:14:03 +0100 |
commit | ae5a45be6f0ee4d5c52b38fd28b22b55d9cd7b2d (patch) | |
tree | b2f59970a4dc0841f0013de70b8ad3b1de69fac2 /hugolib | |
parent | 4d912e2aad39bfe8d76672cf53b01317792e02c5 (diff) |
hugolib: Remove unused code
Diffstat (limited to 'hugolib')
-rw-r--r-- | hugolib/fileInfo.go | 4 | ||||
-rw-r--r-- | hugolib/hugo_sites.go | 6 | ||||
-rw-r--r-- | hugolib/menu.go | 7 | ||||
-rw-r--r-- | hugolib/page.go | 4 | ||||
-rw-r--r-- | hugolib/page_bundler_capture.go | 3 | ||||
-rw-r--r-- | hugolib/page_bundler_handlers.go | 8 | ||||
-rw-r--r-- | hugolib/page_collections.go | 12 | ||||
-rw-r--r-- | hugolib/site.go | 58 | ||||
-rw-r--r-- | hugolib/site_test.go | 5 |
9 files changed, 2 insertions, 105 deletions
diff --git a/hugolib/fileInfo.go b/hugolib/fileInfo.go index 14dd8dbf9..582d2be8c 100644 --- 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 index f4042eb3e..c52aec813 100644 --- 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 index ad421cd88..81c136405 100644 --- 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 index b4ec96565..e7c3ad1cd 100644 --- 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 index 5574329de..34a1be5fb 100644 --- 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 index c91d3f082..19e48ea7d 100644 --- 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 index 03b606955..3bdb4d9ce 100644 --- 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 index 208edc9e9..0dbf84a07 100644 --- 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 index de28a82eb..c157ee6d2 100644 --- 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>" ) |