mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
hugolib: Add expiredStats to build feedback
This commit is contained in:
parent
32c0e3fd1f
commit
673e41bf6a
1 changed files with 20 additions and 0 deletions
|
@ -1877,6 +1877,7 @@ func (s *Site) renderRobotsTXT() error {
|
|||
func (s *Site) Stats() {
|
||||
jww.FEEDBACK.Println(s.draftStats())
|
||||
jww.FEEDBACK.Println(s.futureStats())
|
||||
jww.FEEDBACK.Println(s.expiredStats())
|
||||
jww.FEEDBACK.Printf("%d pages created\n", len(s.Pages))
|
||||
jww.FEEDBACK.Printf("%d non-page files copied\n", len(s.Files))
|
||||
jww.FEEDBACK.Printf("%d paginator pages created\n", s.Info.paginationPageCount)
|
||||
|
@ -2172,6 +2173,25 @@ func (s *Site) futureStats() string {
|
|||
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 viper.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 {
|
||||
|
|
Loading…
Reference in a new issue