|
|
@ -79,7 +79,7 @@ func GetContent(siteRoot string, sites *hugolib.HugoSites) ([]Content, error) { |
|
|
|
// If ctype is empty string, "default" is used. The return value is the filename,
|
|
|
|
// If ctype is empty string, "default" is used. The return value is the filename,
|
|
|
|
// which may be modified from the title and includes the content type if other than
|
|
|
|
// which may be modified from the title and includes the content type if other than
|
|
|
|
// default, but does not include the full directory relative to the site.
|
|
|
|
// default, but does not include the full directory relative to the site.
|
|
|
|
func (ch CaddyHugo) NewContent(name, ctype string) (string, error) { |
|
|
|
func (ch *CaddyHugo) NewContent(name, ctype string) (string, error) { |
|
|
|
if filepath.Ext(name) != ".md" { |
|
|
|
if filepath.Ext(name) != ".md" { |
|
|
|
name += ".md" |
|
|
|
name += ".md" |
|
|
|
} |
|
|
|
} |
|
|
@ -101,7 +101,6 @@ func (ch CaddyHugo) NewContent(name, ctype string) (string, error) { |
|
|
|
out, err := cmd.CombinedOutput() |
|
|
|
out, err := cmd.CombinedOutput() |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return filename, fmt.Errorf("error running 'hugo new': %v; %v", err, string(out)) |
|
|
|
return filename, fmt.Errorf("error running 'hugo new': %v; %v", err, string(out)) |
|
|
|
return filename, err |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|