mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
go fmt site.go
This commit is contained in:
parent
30af267b32
commit
1b5f59b071
1 changed files with 31 additions and 31 deletions
|
@ -56,21 +56,21 @@ var DefaultTimer *nitro.B
|
||||||
//
|
//
|
||||||
// 5. The entire collection of files is written to disk.
|
// 5. The entire collection of files is written to disk.
|
||||||
type Site struct {
|
type Site struct {
|
||||||
Pages Pages
|
Pages Pages
|
||||||
Tmpl Template
|
Tmpl Template
|
||||||
Taxonomies TaxonomyList
|
Taxonomies TaxonomyList
|
||||||
Source source.Input
|
Source source.Input
|
||||||
Sections Taxonomy
|
Sections Taxonomy
|
||||||
Info SiteInfo
|
Info SiteInfo
|
||||||
Shortcodes map[string]ShortcodeFunc
|
Shortcodes map[string]ShortcodeFunc
|
||||||
Menus Menus
|
Menus Menus
|
||||||
timer *nitro.B
|
timer *nitro.B
|
||||||
Target target.Output
|
Target target.Output
|
||||||
Alias target.AliasPublisher
|
Alias target.AliasPublisher
|
||||||
Completed chan bool
|
Completed chan bool
|
||||||
RunMode runmode
|
RunMode runmode
|
||||||
params map[string]interface{}
|
params map[string]interface{}
|
||||||
draftCount int
|
draftCount int
|
||||||
futureCount int
|
futureCount int
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -353,7 +353,7 @@ func (s *Site) CreatePages() (err error) {
|
||||||
if page.IsDraft() {
|
if page.IsDraft() {
|
||||||
s.draftCount += 1
|
s.draftCount += 1
|
||||||
}
|
}
|
||||||
|
|
||||||
if page.IsFuture() {
|
if page.IsFuture() {
|
||||||
s.futureCount += 1
|
s.futureCount += 1
|
||||||
}
|
}
|
||||||
|
@ -827,7 +827,7 @@ func (s *Site) RenderSitemap() error {
|
||||||
func (s *Site) Stats() {
|
func (s *Site) Stats() {
|
||||||
jww.FEEDBACK.Println(s.draftStats())
|
jww.FEEDBACK.Println(s.draftStats())
|
||||||
jww.FEEDBACK.Println(s.futureStats())
|
jww.FEEDBACK.Println(s.futureStats())
|
||||||
jww.FEEDBACK.Printf("%d pages created \n", len(s.Pages))
|
jww.FEEDBACK.Printf("%d pages created \n", len(s.Pages))
|
||||||
|
|
||||||
taxonomies := viper.GetStringMapString("Taxonomies")
|
taxonomies := viper.GetStringMapString("Taxonomies")
|
||||||
|
|
||||||
|
@ -987,26 +987,26 @@ func (s *Site) draftStats() string {
|
||||||
|
|
||||||
if viper.GetBool("BuildDrafts") {
|
if viper.GetBool("BuildDrafts") {
|
||||||
return fmt.Sprintf("%d of ", s.draftCount) + msg
|
return fmt.Sprintf("%d of ", s.draftCount) + msg
|
||||||
}
|
}
|
||||||
|
|
||||||
return "0 of " + msg
|
return "0 of " + msg
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Site) futureStats() string {
|
func (s *Site) futureStats() string {
|
||||||
var msg string
|
var msg string
|
||||||
|
|
||||||
switch s.futureCount {
|
switch s.futureCount {
|
||||||
case 0:
|
case 0:
|
||||||
return "0 future content "
|
return "0 future content "
|
||||||
case 1:
|
case 1:
|
||||||
msg = "1 future rendered "
|
msg = "1 future rendered "
|
||||||
default:
|
default:
|
||||||
msg = fmt.Sprintf("%d future rendered", s.draftCount)
|
msg = fmt.Sprintf("%d future rendered", s.draftCount)
|
||||||
}
|
}
|
||||||
|
|
||||||
if viper.GetBool("BuildFuture") {
|
if viper.GetBool("BuildFuture") {
|
||||||
return fmt.Sprintf("%d of ", s.futureCount) + msg
|
return fmt.Sprintf("%d of ", s.futureCount) + msg
|
||||||
}
|
}
|
||||||
|
|
||||||
return "0 of " + msg
|
return "0 of " + msg
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue