mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-27 22:09:53 +02:00
Adding support for destination dir, split out static
This commit is contained in:
@@ -27,13 +27,13 @@ import (
|
||||
|
||||
// config file items
|
||||
type Config struct {
|
||||
SourceDir, PublishDir, BaseUrl, StaticDir string
|
||||
Path, CacheDir, LayoutDir, DefaultLayout string
|
||||
ConfigFile string
|
||||
Title string
|
||||
Indexes map[string]string // singular, plural
|
||||
ProcessFilters map[string][]string
|
||||
BuildDrafts, UglyUrls, Verbose bool
|
||||
ContentDir, PublishDir, BaseUrl, StaticDir string
|
||||
Path, CacheDir, LayoutDir, DefaultLayout string
|
||||
ConfigFile string
|
||||
Title string
|
||||
Indexes map[string]string // singular, plural
|
||||
ProcessFilters map[string][]string
|
||||
BuildDrafts, UglyUrls, Verbose bool
|
||||
}
|
||||
|
||||
var c Config
|
||||
@@ -51,7 +51,7 @@ func SetupConfig(cfgfile *string, path *string) *Config {
|
||||
}
|
||||
|
||||
// set defaults
|
||||
c.SourceDir = "content"
|
||||
c.ContentDir = "content"
|
||||
c.LayoutDir = "layouts"
|
||||
c.PublishDir = "public"
|
||||
c.StaticDir = "static"
|
||||
|
@@ -165,7 +165,7 @@ func (s *Site) initialize() {
|
||||
return nil
|
||||
}
|
||||
|
||||
filepath.Walk(s.c.GetAbsPath(s.c.SourceDir), walker)
|
||||
filepath.Walk(s.c.GetAbsPath(s.c.ContentDir), walker)
|
||||
|
||||
s.Info = SiteInfo{BaseUrl: template.URL(s.c.BaseUrl), Title: s.c.Title, Config: &s.c}
|
||||
|
||||
@@ -176,8 +176,8 @@ func (s *Site) checkDirectories() {
|
||||
if b, _ := dirExists(s.c.GetAbsPath(s.c.LayoutDir)); !b {
|
||||
FatalErr("No layout directory found, expecting to find it at " + s.c.GetAbsPath(s.c.LayoutDir))
|
||||
}
|
||||
if b, _ := dirExists(s.c.GetAbsPath(s.c.SourceDir)); !b {
|
||||
FatalErr("No source directory found, expecting to find it at " + s.c.GetAbsPath(s.c.SourceDir))
|
||||
if b, _ := dirExists(s.c.GetAbsPath(s.c.ContentDir)); !b {
|
||||
FatalErr("No source directory found, expecting to find it at " + s.c.GetAbsPath(s.c.ContentDir))
|
||||
}
|
||||
mkdirIf(s.c.GetAbsPath(s.c.PublishDir))
|
||||
}
|
||||
|
Reference in New Issue
Block a user