ref: 0167fb480317749e24a7a5feb22a8d4e475873ce
parent: da5d98e958a1e5bf3082b55d5d3ae41ac60f6490
author: bep <[email protected]>
date: Sun Oct 12 11:57:00 EDT 2014
Copy content from archetype Prior to this commit only metadata were copied from archetype on content creation. This commit includes the content if set in archetype. This is useful in situations with similar page structure. Fixes #556
--- a/create/content.go
+++ b/create/content.go
@@ -34,7 +34,7 @@
location := FindArchetype(kind)
- var by []byte
+ var by []byte
if location != "" {
by, err = ioutil.ReadFile(location)
@@ -96,7 +96,7 @@
page.Dir = viper.GetString("sourceDir")
page.SetSourceMetaData(newmetadata, parser.FormatToLeadRune(viper.GetString("MetaDataFormat")))
-
+ page.SetSourceContent(psr.Content())
if err = page.SafeSaveSourceAs(path.Join(viper.GetString("contentDir"), name)); err != nil {
return
}
@@ -119,7 +119,7 @@
for _, x := range search {
// If the new content isn't in a subdirectory, kind == "".
- // Therefore it should be excluded otherwise `is a directory`
+ // Therefore it should be excluded otherwise `is a directory`
// error will occur. github.com/spf13/hugo/issues/411
var pathsToCheck []string