mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
610c06e658
This provides an abstraction over how files are processed by Hugo. This allows for alternatives like CMS systems or Dropbox, etc.
30 lines
528 B
Go
30 lines
528 B
Go
package hugolib
|
|
|
|
import (
|
|
"fmt"
|
|
"io"
|
|
)
|
|
|
|
func (s *Site) ShowPlan(out io.Writer) (err error) {
|
|
if s.Source == nil || len(s.Source.Files()) <= 0 {
|
|
fmt.Fprintf(out, "No source files provided.\n")
|
|
}
|
|
|
|
for _, p := range s.Pages {
|
|
fmt.Fprintf(out, "%s\n", p.FileName)
|
|
fmt.Fprintf(out, " canonical => ")
|
|
if s.Target == nil {
|
|
fmt.Fprintf(out, "%s\n", "!no target specified!")
|
|
continue
|
|
}
|
|
|
|
trns, err := s.Target.Translate(p.OutFile)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
fmt.Fprintf(out, "%s\n", trns)
|
|
|
|
}
|
|
return
|
|
}
|