mirror of
https://github.com/gohugoio/hugo.git
synced 2024-05-11 05:54:58 +00:00
commands: Add .gitignore "hugo new site"
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
0a3340e952
commit
92979d9288
@ -97,6 +97,7 @@ func (n *newSiteCmd) doNewSite(fs *hugofs.Fs, basepath string, force bool) error
|
||||
}
|
||||
|
||||
createConfig(fs, basepath, n.configFormat)
|
||||
createGitignore(fs, basepath)
|
||||
|
||||
// Create a default archetype file.
|
||||
helpers.SafeWriteToDisk(filepath.Join(archeTypePath, "default.md"),
|
||||
@ -141,6 +142,14 @@ func createConfig(fs *hugofs.Fs, inpath string, kind string) (err error) {
|
||||
return helpers.WriteToDisk(filepath.Join(inpath, "config."+kind), &buf, fs.Source)
|
||||
}
|
||||
|
||||
func createGitignore(fs *hugofs.Fs, inpath string) (err error) {
|
||||
var gitignore bytes.Buffer
|
||||
|
||||
gitignore.WriteString("public/")
|
||||
|
||||
return helpers.WriteToDisk(filepath.Join(inpath, ".gitignore"), &gitignore, fs.Source)
|
||||
}
|
||||
|
||||
func nextStepsText() string {
|
||||
var nextStepsText bytes.Buffer
|
||||
|
||||
|
Reference in New Issue
Block a user