Workaround for Jekyllr frontmatter

pull/6510/head
Qiming Teng 2017-11-30 17:18:18 +08:00
parent edcb39d46c
commit b84ac59624
13 changed files with 11 additions and 15 deletions

View File

@ -1,4 +1,3 @@
---
apiVersion: v1
kind: Service
metadata:

View File

@ -1,4 +1,3 @@
---
apiVersion: v1
kind: Service
metadata:
@ -42,4 +41,4 @@ spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 1Gi
storage: 1Gi

View File

@ -1,4 +1,3 @@
---
apiVersion: v1
kind: Pod
metadata:

View File

@ -1,5 +1,5 @@
kind: Service
apiVersion: v1
kind: Service
metadata:
name: frontend
spec:

View File

@ -1,4 +1,3 @@
---
apiVersion: v1
kind: Service
metadata:

View File

@ -1,4 +1,3 @@
---
apiVersion: v1
kind: Service
metadata:
@ -45,4 +44,4 @@ spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 1Gi
storage: 1Gi

View File

@ -1,4 +1,3 @@
---
apiVersion: v1
kind: Service
metadata:

View File

@ -1,4 +1,3 @@
---
apiVersion: v1
kind: ReplicationController
metadata:

View File

@ -1,4 +1,3 @@
---
apiVersion: v1
kind: Service
metadata:

View File

@ -1,4 +1,3 @@
---
apiVersion: v1
kind: ReplicationController
metadata:

View File

@ -1,4 +1,3 @@
---
apiVersion: v1
kind: Service
metadata:

View File

@ -1,4 +1,3 @@
---
apiVersion: v1
kind: Pod
metadata:

View File

@ -199,6 +199,10 @@ func walkConfigFiles(inDir string, fn func(name, path string, data [][]byte)) er
if err != nil {
return err
}
// workaround for Jekyllr limit
if bytes.HasPrefix(data, []byte("---\n")) {
return fmt.Errorf("YAML file cannot start with \"---\", please remove the first line")
}
name := strings.TrimSuffix(file, ext)
var docs [][]byte
@ -217,7 +221,10 @@ func walkConfigFiles(inDir string, fn func(name, path string, data [][]byte)) er
if err != nil {
return fmt.Errorf("%s: %v", path, err)
}
docs = append(docs, out)
// deal with "empty" document (e.g. pure comments)
if string(out) != "null" {
docs = append(docs, out)
}
}
} else {
docs = append(docs, data)