Add data files support in themes

If duplicate keys, the main data dir wins.

Fixes #892
This commit is contained in:
bep
2015-02-11 20:24:56 +01:00
parent 664fd99135
commit ebcc1e6699
5 changed files with 100 additions and 46 deletions

View File

@@ -19,13 +19,13 @@ import (
"encoding/hex"
"errors"
"fmt"
bp "github.com/spf13/hugo/bufferpool"
"github.com/spf13/viper"
"io"
"net"
"path/filepath"
"reflect"
"strings"
bp "github.com/spf13/hugo/bufferpool"
)
// Filepath separator defined by os.Separator.
@@ -100,6 +100,10 @@ func BytesToReader(in []byte) io.Reader {
return bytes.NewReader(in)
}
func ThemeSet() bool {
return viper.GetString("theme") != ""
}
// SliceToLower goes through the source slice and lowers all values.
func SliceToLower(s []string) []string {
if s == nil {