mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
commands: Only watch relevant themes dir
The same behavior as for the root project. Fixes #2602
This commit is contained in:
@@ -571,6 +571,12 @@ func getDirList() []string {
|
|||||||
i18nDir := helpers.AbsPathify(viper.GetString("I18nDir"))
|
i18nDir := helpers.AbsPathify(viper.GetString("I18nDir"))
|
||||||
layoutDir := helpers.AbsPathify(viper.GetString("LayoutDir"))
|
layoutDir := helpers.AbsPathify(viper.GetString("LayoutDir"))
|
||||||
staticDir := helpers.AbsPathify(viper.GetString("StaticDir"))
|
staticDir := helpers.AbsPathify(viper.GetString("StaticDir"))
|
||||||
|
var themesDir string
|
||||||
|
|
||||||
|
if helpers.ThemeSet() {
|
||||||
|
themesDir = helpers.AbsPathify(viper.GetString("themesDir") + "/" + viper.GetString("theme"))
|
||||||
|
}
|
||||||
|
|
||||||
walker := func(path string, fi os.FileInfo, err error) error {
|
walker := func(path string, fi os.FileInfo, err error) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if path == dataDir && os.IsNotExist(err) {
|
if path == dataDir && os.IsNotExist(err) {
|
||||||
@@ -628,9 +634,14 @@ func getDirList() []string {
|
|||||||
helpers.SymbolicWalk(hugofs.Source(), helpers.AbsPathify(viper.GetString("ContentDir")), walker)
|
helpers.SymbolicWalk(hugofs.Source(), helpers.AbsPathify(viper.GetString("ContentDir")), walker)
|
||||||
helpers.SymbolicWalk(hugofs.Source(), i18nDir, walker)
|
helpers.SymbolicWalk(hugofs.Source(), i18nDir, walker)
|
||||||
helpers.SymbolicWalk(hugofs.Source(), helpers.AbsPathify(viper.GetString("LayoutDir")), walker)
|
helpers.SymbolicWalk(hugofs.Source(), helpers.AbsPathify(viper.GetString("LayoutDir")), walker)
|
||||||
|
|
||||||
helpers.SymbolicWalk(hugofs.Source(), staticDir, walker)
|
helpers.SymbolicWalk(hugofs.Source(), staticDir, walker)
|
||||||
if helpers.ThemeSet() {
|
if helpers.ThemeSet() {
|
||||||
helpers.SymbolicWalk(hugofs.Source(), helpers.AbsPathify(viper.GetString("themesDir")+"/"+viper.GetString("theme")), walker)
|
helpers.SymbolicWalk(hugofs.Source(), filepath.Join(themesDir, "layouts"), walker)
|
||||||
|
helpers.SymbolicWalk(hugofs.Source(), filepath.Join(themesDir, "static"), walker)
|
||||||
|
helpers.SymbolicWalk(hugofs.Source(), filepath.Join(themesDir, "i18n"), walker)
|
||||||
|
helpers.SymbolicWalk(hugofs.Source(), filepath.Join(themesDir, "data"), walker)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return a
|
return a
|
||||||
|
Reference in New Issue
Block a user