Skip to content

Commit

Permalink
Remove unused
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed Feb 16, 2019
1 parent 21ab1ec commit b874333
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 59 deletions.
12 changes: 0 additions & 12 deletions hugolib/hugo_sites.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 0 additions & 4 deletions hugolib/multilingual.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
3 changes: 1 addition & 2 deletions hugolib/page_composite.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
8 changes: 1 addition & 7 deletions hugolib/page_composite_output.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ func newPageContentProvider(p *pageState) func(f output.Format) (*pageContentPro

}

type contentInitStatus struct {
summarySet bool
}

type pageContentProvider struct {
f output.Format

Expand All @@ -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
Expand Down Expand Up @@ -409,7 +404,6 @@ func splitUserDefinedSummaryAndContent(markup string, c []byte) (summary []byte,
return
}

summary = summary
content = bytes.TrimSpace(withoutDivider)

return
Expand Down
28 changes: 4 additions & 24 deletions hugolib/pagecollections.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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{})

Expand Down Expand Up @@ -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())
Expand Down
10 changes: 0 additions & 10 deletions hugolib/site.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit b874333

Please sign in to comment.