1
0
mirror of https://github.com/danog/gojekyll.git synced 2025-01-22 12:31:18 +01:00

_sass, _data are optional

This commit is contained in:
Oliver Steele 2017-06-21 19:17:44 -04:00
parent 2ff73da9c3
commit 94ed67717f
2 changed files with 9 additions and 1 deletions

View File

@ -34,7 +34,7 @@ func (s *Site) CopySassFileIncludes() error {
src := filepath.Join(s.Source, "_sass")
dst := s.sassTempDir
return filepath.Walk(src, func(from string, info os.FileInfo, err error) error {
err := filepath.Walk(src, func(from string, info os.FileInfo, err error) error {
if err != nil || info.IsDir() {
return err
}
@ -45,6 +45,10 @@ func (s *Site) CopySassFileIncludes() error {
to := filepath.Join(dst, strings.TrimPrefix(rel, "_"))
return helpers.CopyFileContents(to, from, 0644)
})
if os.IsNotExist(err) {
return nil
}
return err
}
// SassIncludePaths returns an array of sass include directories.

View File

@ -2,6 +2,7 @@ package gojekyll
import (
"io/ioutil"
"os"
"path/filepath"
"time"
@ -34,6 +35,9 @@ func (site *Site) readDataFiles() (VariableMap, error) {
dataDir := filepath.Join(site.Source, site.config.DataDir)
files, err := ioutil.ReadDir(dataDir)
if err != nil {
if os.IsNotExist(err) {
return VariableMap{}, nil
}
return nil, err
}
for _, f := range files {