mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
311e102223
Allow content that is not markdown and does not need to be rendered to exists in the content directory. Currently any valid html or xml document can exist. Templates are applied to these documents as well. If you need to have content that doesn't have templates or AbsUrlify like operations, then continue to put this content in static and it will be copied over.
50 lines
1 KiB
Go
50 lines
1 KiB
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", p.FileName)
|
|
if p.IsRenderable() {
|
|
fmt.Fprintf(out, " (renderer: markdown)")
|
|
} else {
|
|
fmt.Fprintf(out, " (renderer: n/a)")
|
|
}
|
|
if s.Tmpl != nil {
|
|
fmt.Fprintf(out, " (layout: %s, exists: %t)", p.Layout(), s.Tmpl.Lookup(p.Layout()) != nil)
|
|
}
|
|
fmt.Fprintf(out, "\n")
|
|
fmt.Fprintf(out, " canonical => ")
|
|
if s.Target == nil {
|
|
fmt.Fprintf(out, "%s\n\n", "!no target specified!")
|
|
continue
|
|
}
|
|
|
|
trns, err := s.Target.Translate(p.OutFile)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
fmt.Fprintf(out, "%s\n", trns)
|
|
|
|
if s.Alias == nil {
|
|
continue
|
|
}
|
|
|
|
for _, alias := range p.Aliases {
|
|
aliasTrans, err := s.Alias.Translate(alias)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
fmt.Fprintf(out, " %s => %s\n", alias, aliasTrans)
|
|
}
|
|
fmt.Fprintln(out)
|
|
}
|
|
return
|
|
}
|