mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-14 20:33:59 +02:00
create: Refactor NewContent to be testable
NewContent is refactored to use the afero.Fs interface that should allow full testing. This commit also pulls the metadata creation logic out of NewContent and into a separate function to decrease the cyclomatic complexity of NewContent.
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
bafb77172b
commit
9323707b32
@@ -110,8 +110,7 @@ func NewContent(cmd *cobra.Command, args []string) error {
|
||||
kind = contentType
|
||||
}
|
||||
|
||||
return create.NewContent(kind, createpath)
|
||||
|
||||
return create.NewContent(hugofs.SourceFs, kind, createpath)
|
||||
}
|
||||
|
||||
func doNewSite(basepath string, force bool) error {
|
||||
|
Reference in New Issue
Block a user