Skip to content

Commit

Permalink
Create minimal default.md in archetype file fixes gohugoio#315
Browse files Browse the repository at this point in the history
To fix the cast error, create a minimal default.md in the archetype
folder.
  • Loading branch information
Andy Williams committed Oct 14, 2015
1 parent 4c04d71 commit 9735e0b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions commands/new.go
Expand Up @@ -163,7 +163,14 @@ func NewTheme(cmd *cobra.Command, args []string) {
touchFile(createpath, "layouts", "partials", "footer.html")

mkdir(createpath, "archetypes")
touchFile(createpath, "archetypes", "default.md")

archDefault := []byte("+++\n+++\n")

err := helpers.WriteToDisk(filepath.Join(createpath, "archetypes", "default.md"), bytes.NewReader(archDefault), hugofs.SourceFs)
if err != nil {

jww.FATAL.Fatalln(err)
}

mkdir(createpath, "static", "js")
mkdir(createpath, "static", "css")
Expand All @@ -190,7 +197,7 @@ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
`)

err := helpers.WriteToDisk(filepath.Join(createpath, "LICENSE.md"), bytes.NewReader(by), hugofs.SourceFs)
err = helpers.WriteToDisk(filepath.Join(createpath, "LICENSE.md"), bytes.NewReader(by), hugofs.SourceFs)
if err != nil {
jww.FATAL.Fatalln(err)
}
Expand Down

0 comments on commit 9735e0b

Please sign in to comment.