add some git stuff and put ajax in plain js

This commit is contained in:
Henrique Dias
2016-03-06 12:39:36 +00:00
parent 7c1a1c4f23
commit 8043610590
5 changed files with 146 additions and 46 deletions

View File

@@ -1,6 +1,8 @@
package config
import (
"os"
"path/filepath"
"strings"
"github.com/hacdias/caddy-hugo/hugo"
@@ -14,6 +16,7 @@ type Config struct {
Styles string // Admin styles path
Args []string // Hugo arguments
Hugo string // Hugo executable path
Git bool // Is this site a git repository
}
// ParseHugo parses the configuration file
@@ -21,6 +24,7 @@ func ParseHugo(c *setup.Controller) (*Config, error) {
conf := &Config{
Public: strings.Replace(c.Root, "./", "", -1),
Path: "./",
Git: false,
}
conf.Hugo = hugo.GetPath()
@@ -59,5 +63,9 @@ func ParseHugo(c *setup.Controller) (*Config, error) {
}
}
if _, err := os.Stat(filepath.Join(conf.Path, ".git")); err == nil {
conf.Git = true
}
return conf, nil
}