mirror of
https://github.com/danog/gojekyll.git
synced 2024-11-30 10:49:00 +01:00
Honor site includes
This commit is contained in:
parent
2c24bb5ab3
commit
c954878abe
4
site.go
4
site.go
@ -137,14 +137,16 @@ func (s *Site) GetFileURL(path string) (string, bool) {
|
||||
// Exclude returns true iff a site excludes a file.
|
||||
func (s *Site) Exclude(path string) bool {
|
||||
// TODO exclude based on glob, not exact match
|
||||
inclusionMap := stringArrayToMap(s.config.Include)
|
||||
exclusionMap := stringArrayToMap(s.config.Exclude)
|
||||
base := filepath.Base(path)
|
||||
switch {
|
||||
case inclusionMap[path]:
|
||||
return false
|
||||
case path == ".":
|
||||
return false
|
||||
case exclusionMap[path]:
|
||||
return true
|
||||
// TODO check Include
|
||||
case strings.HasPrefix(base, "."), strings.HasPrefix(base, "_"):
|
||||
return true
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user