mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-15 06:16:06 +00:00
1 parent
34c87421b8
commit
8b0c3b9b27
2 files changed
+11
-4
No files matched your search
+3
-1
@@ -472,7 +472,9 @@ func getStaticSourceFs() afero.Fs {
|
|||||||
useStatic := true
|
useStatic := true
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
jww.WARN.Println(err)
|
if err != helpers.ErrThemeUndefined {
|
||||||
|
jww.WARN.Println(err)
|
||||||
|
}
|
||||||
useTheme = false
|
useTheme = false
|
||||||
} else {
|
} else {
|
||||||
if _, err := source.Stat(themeDir); os.IsNotExist(err) {
|
if _, err := source.Stat(themeDir); os.IsNotExist(err) {
|
||||||
|
|||||||
+8
-3
@@ -31,6 +31,13 @@ import (
|
|||||||
"golang.org/x/text/unicode/norm"
|
"golang.org/x/text/unicode/norm"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
// ErrThemeUndefined is returned when a theme has not be defined by the user.
|
||||||
|
ErrThemeUndefined = errors.New("no theme set")
|
||||||
|
|
||||||
|
ErrWalkRootTooShort = errors.New("Path too short. Stop walking.")
|
||||||
|
)
|
||||||
|
|
||||||
// filepathPathBridge is a bridge for common functionality in filepath vs path
|
// filepathPathBridge is a bridge for common functionality in filepath vs path
|
||||||
type filepathPathBridge interface {
|
type filepathPathBridge interface {
|
||||||
Base(in string) string
|
Base(in string) string
|
||||||
@@ -207,7 +214,7 @@ func GetThemeI18nDirPath() (string, error) {
|
|||||||
|
|
||||||
func getThemeDirPath(path string) (string, error) {
|
func getThemeDirPath(path string) (string, error) {
|
||||||
if !ThemeSet() {
|
if !ThemeSet() {
|
||||||
return "", errors.New("No theme set")
|
return "", ErrThemeUndefined
|
||||||
}
|
}
|
||||||
|
|
||||||
themeDir := filepath.Join(GetThemeDir(), path)
|
themeDir := filepath.Join(GetThemeDir(), path)
|
||||||
@@ -485,8 +492,6 @@ func FindCWD() (string, error) {
|
|||||||
return path, nil
|
return path, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var ErrWalkRootTooShort = errors.New("Path too short. Stop walking.")
|
|
||||||
|
|
||||||
// SymbolicWalk is like filepath.Walk, but it supports the root being a
|
// SymbolicWalk is like filepath.Walk, but it supports the root being a
|
||||||
// symbolic link. It will still not follow symbolic links deeper down in
|
// symbolic link. It will still not follow symbolic links deeper down in
|
||||||
// the file structure
|
// the file structure
|
||||||
|
|||||||
Reference in new issue
Block a user