From b8743339e01a172cd032266d3dd31fdb6b4355bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Sat, 16 Feb 2019 22:24:42 +0100 Subject: [PATCH] Remove unused --- hugolib/hugo_sites.go | 12 ------------ hugolib/multilingual.go | 4 ---- hugolib/page_composite.go | 3 +-- hugolib/page_composite_output.go | 8 +------- hugolib/pagecollections.go | 28 ++++------------------------ hugolib/site.go | 10 ---------- 6 files changed, 6 insertions(+), 59 deletions(-) diff --git a/hugolib/hugo_sites.go b/hugolib/hugo_sites.go index d3642909be9..db6b9c4402c 100644 --- a/hugolib/hugo_sites.go +++ b/hugolib/hugo_sites.go @@ -698,22 +698,10 @@ func (h *HugoSites) Pages() page.Pages { return h.Sites[0].AllPages() } -func (h *HugoSites) findPagesByKindNotIn(kind string, inPages page.Pages) page.Pages { - return h.Sites[0].findPagesByKindNotIn(kind, inPages) -} - func (h *HugoSites) findPagesByKindIn(kind string, inPages page.Pages) page.Pages { return h.Sites[0].findPagesByKindIn(kind, inPages) } -func (h *HugoSites) findAllPagesByKind(kind string) page.Pages { - return h.findPagesByKindIn(kind, h.Sites[0].AllPages()) -} - -func (h *HugoSites) findAllPagesByKindNotIn(kind string) page.Pages { - return h.findPagesByKindNotIn(kind, h.Sites[0].AllPages()) -} - func (h *HugoSites) findPagesByShortcode(shortcode string) page.Pages { var pages page.Pages for _, s := range h.Sites { diff --git a/hugolib/multilingual.go b/hugolib/multilingual.go index a0d2f8850f3..daec19c8cf2 100644 --- a/hugolib/multilingual.go +++ b/hugolib/multilingual.go @@ -78,10 +78,6 @@ func newMultiLingualFromSites(cfg config.Provider, sites ...*Site) (*Multilingua } -func newMultiLingualForLanguage(language *langs.Language) *Multilingual { - languages := langs.Languages{language} - return &Multilingual{Languages: languages, DefaultLang: language} -} func (ml *Multilingual) enabled() bool { return len(ml.Languages) > 1 } diff --git a/hugolib/page_composite.go b/hugolib/page_composite.go index 5af7467dab3..cf4eb76b547 100644 --- a/hugolib/page_composite.go +++ b/hugolib/page_composite.go @@ -854,8 +854,7 @@ Loop: p.source.posMainContent = next.Pos } - // TODO(bep) page - if false { // !p.s.shouldBuild(p) { + if !p.s.shouldBuild(p) { // Nothing more to do. return nil } diff --git a/hugolib/page_composite_output.go b/hugolib/page_composite_output.go index 466dafd1179..9697969e233 100644 --- a/hugolib/page_composite_output.go +++ b/hugolib/page_composite_output.go @@ -114,10 +114,6 @@ func newPageContentProvider(p *pageState) func(f output.Format) (*pageContentPro } -type contentInitStatus struct { - summarySet bool -} - type pageContentProvider struct { f output.Format @@ -126,8 +122,7 @@ type pageContentProvider struct { // TODO(bep) page // Configuration - enableInlineShortcodes bool - timeout time.Duration + timeout time.Duration // Lazy load dependencies mainInit *lazy.Init @@ -409,7 +404,6 @@ func splitUserDefinedSummaryAndContent(markup string, c []byte) (summary []byte, return } - summary = summary content = bytes.TrimSpace(withoutDivider) return diff --git a/hugolib/pagecollections.go b/hugolib/pagecollections.go index 637bad93076..e85a4919b7a 100644 --- a/hugolib/pagecollections.go +++ b/hugolib/pagecollections.go @@ -46,11 +46,10 @@ type PageCollections struct { headlessPages pageStatePages // Lazy initialized page collections - pages *lazyPagesFactory - allButRegularPages *lazyPagesFactory - regularPages *lazyPagesFactory - allPages *lazyPagesFactory - allRegularPages *lazyPagesFactory + pages *lazyPagesFactory + regularPages *lazyPagesFactory + allPages *lazyPagesFactory + allRegularPages *lazyPagesFactory // The index for .Site.GetPage etc. pageIndex *cache.Lazy @@ -96,11 +95,6 @@ func (c *PageCollections) AllRegularPages() page.Pages { return c.allRegularPages.get() } -func (c *PageCollections) indexPages() page.Pages { - c.checkState() - return c.allButRegularPages.get() -} - // Get initializes the index if not already done so, then // looks up the given page ref, returns nil if no value found. func (c *PageCollections) getFromCache(ref string) (page.Page, error) { @@ -158,10 +152,6 @@ func newPageCollectionsFromPages(pages pageStatePages) *PageCollections { return c.findPagesByKindInWorkPages(page.KindPage, c.workAllPages) }) - c.allButRegularPages = newLazyPagesFactory(func() page.Pages { - return c.findPagesByKindNotInWorkPages(page.KindPage, c.workAllPages) - }) - c.pageIndex = cache.NewLazy(func() (map[string]interface{}, error) { index := make(map[string]interface{}) @@ -355,16 +345,6 @@ func (*PageCollections) findFirstPageByKindIn(kind string, inPages page.Pages) p return nil } -func (*PageCollections) findPagesByKindNotIn(kind string, inPages page.Pages) page.Pages { - var pages page.Pages - for _, p := range inPages { - if p.Kind() != kind { - pages = append(pages, p) - } - } - return pages -} - // TODO(bep) page check usage func (c *PageCollections) findPagesByKind(kind string) page.Pages { return c.findPagesByKindIn(kind, c.Pages()) diff --git a/hugolib/site.go b/hugolib/site.go index 7aaf2458663..d8a3809f78b 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -1401,10 +1401,6 @@ func (s *Site) isLayoutDirEvent(e fsnotify.Event) bool { return s.BaseFs.SourceFilesystems.IsLayout(e.Name) } -func (s *Site) absContentDir() string { - return s.PathSpec.AbsPathify(s.PathSpec.ContentDir) -} - func (s *Site) isContentDirEvent(e fsnotify.Event) bool { return s.BaseFs.IsContent(e.Name) } @@ -1741,12 +1737,6 @@ func (s *Site) resetBuildState() { }*/ } -// TODO(bep) page -func (s *Site) layouts(p *pageState) ([]string, error) { - panic("fix me") - // return s.layoutHandler.For(p.createLayoutDescriptor(), p.perOutputCurrent.f) -} - func (s *Site) errorCollator(results <-chan error, errs chan<- error) { var errors []error for e := range results {