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:
parent
2ff73da9c3
commit
94ed67717f
6
sass.go
6
sass.go
@ -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.
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user