diff options
author | Albert Nigmatzianov <albertnigma@gmail.com> | 2016-11-07 02:10:32 +0300 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2016-11-07 02:10:32 +0300 |
commit | 85a2d81e3c1f62b561e6c2715cc406446879d09e (patch) | |
tree | 3ed54195fb0f8283082827a4890a138fca25504d /hugolib | |
parent | 4b4ab4755339a8c1d034be1f75b323d585dac1df (diff) |
commands, tpl: Get rid of repeating viper accesses
* all: Delete some blank lines
* commands, tpl: Get rid of repeating viper accesses
Diffstat (limited to 'hugolib')
-rw-r--r-- | hugolib/config.go | 1 | ||||
-rw-r--r-- | hugolib/handler_page.go | 1 | ||||
-rw-r--r-- | hugolib/page.go | 1 | ||||
-rw-r--r-- | hugolib/site.go | 3 |
4 files changed, 0 insertions, 6 deletions
diff --git a/hugolib/config.go b/hugolib/config.go index 94477b75a..e6d28051e 100644 --- a/hugolib/config.go +++ b/hugolib/config.go @@ -22,7 +22,6 @@ import ( // LoadGlobalConfig loads Hugo configuration into the global Viper. func LoadGlobalConfig(relativeSourcePath, configFilename string) error { - if relativeSourcePath == "" { relativeSourcePath = "." } diff --git a/hugolib/handler_page.go b/hugolib/handler_page.go index c71936954..45e34973d 100644 --- a/hugolib/handler_page.go +++ b/hugolib/handler_page.go @@ -105,7 +105,6 @@ func (h mmarkHandler) PageConvert(p *Page, t tpl.Template) HandledResult { } func commonConvert(p *Page, t tpl.Template) HandledResult { - if p.rendered { panic(fmt.Sprintf("Page %q already rendered, does not need conversion", p.BaseFileName())) } diff --git a/hugolib/page.go b/hugolib/page.go index 7d7c22fd9..de7391599 100644 --- a/hugolib/page.go +++ b/hugolib/page.go @@ -584,7 +584,6 @@ func (p *Page) permalink() (*url.URL, error) { if err != nil { return nil, err } - // fmt.Printf("have a section override for %q in section %s → %s\n", p.Title, p.Section, permalink) } else { if len(pSlug) > 0 { permalink = helpers.URLPrep(viper.GetBool("uglyURLs"), path.Join(dir, p.Slug+"."+p.Extension())) diff --git a/hugolib/site.go b/hugolib/site.go index 6940d74bf..1a6c50fce 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -917,7 +917,6 @@ func (s *SiteInfo) SitemapAbsURL() string { } func (s *Site) initializeSiteInfo() { - var ( lang *helpers.Language = s.Language languages helpers.Languages @@ -1980,7 +1979,6 @@ func (s *Site) renderSectionLists(prepare bool) error { } if n.paginator != nil { - paginatePath := helpers.Config().GetString("paginatePath") // write alias for page 1 @@ -2029,7 +2027,6 @@ func (s *Site) renderSectionLists(prepare bool) error { } func (s *Site) renderHomePage(prepare bool) error { - n := s.newHomeNode(prepare, 0) if prepare { return nil |