diff options
author | Anthony Fok <foka@debian.org> | 2018-06-11 01:46:36 -0600 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-06-11 10:40:22 +0200 |
commit | 9717ac7dce84d004afde4edb32ad81319c7dd8a7 (patch) | |
tree | 739118f0e735069adc6b9a9014f3c1760b1340a8 | |
parent | 692ec008726b570c9b30ac3391774cbb622730cb (diff) |
commands: Create _default/baseof.html in "new theme"
Thanks to @digitalcraftsman, @bep and @rdwatters for providing the
actual content of the default baseof.html file.
Fixes #3576
-rw-r--r-- | commands/new_theme.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/commands/new_theme.go b/commands/new_theme.go index e01790dee..3a3677c85 100644 --- a/commands/new_theme.go +++ b/commands/new_theme.go @@ -80,6 +80,22 @@ func (n *newThemeCmd) newTheme(cmd *cobra.Command, args []string) error { touchFile(cfg.Fs.Source, createpath, "layouts", "_default", "list.html") touchFile(cfg.Fs.Source, createpath, "layouts", "_default", "single.html") + baseofDefault := []byte(`<html> + {{- partial "head.html" . -}} + <body> + {{- partial "header.html" . -}} + <div id="content"> + {{- block "main" . }}{{- end }} + </div> + {{- partial "footer.html" . -}} + </body> +</html> +`) + err = helpers.WriteToDisk(filepath.Join(createpath, "layouts", "_default", "baseof.html"), bytes.NewReader(baseofDefault), cfg.Fs.Source) + if err != nil { + return err + } + touchFile(cfg.Fs.Source, createpath, "layouts", "partials", "header.html") touchFile(cfg.Fs.Source, createpath, "layouts", "partials", "footer.html") |