mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-14 20:33:59 +02:00
@@ -1230,6 +1230,10 @@ func isDotFile(path string) bool {
|
|||||||
return filepath.Base(path)[0] == '.'
|
return filepath.Base(path)[0] == '.'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func isBackupFile(path string) bool {
|
||||||
|
return path[len(path)-1] == '~'
|
||||||
|
}
|
||||||
|
|
||||||
func (t *GoHtmlTemplate) loadTemplates(absPath string, prefix string) {
|
func (t *GoHtmlTemplate) loadTemplates(absPath string, prefix string) {
|
||||||
walker := func(path string, fi os.FileInfo, err error) error {
|
walker := func(path string, fi os.FileInfo, err error) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -1254,7 +1258,7 @@ func (t *GoHtmlTemplate) loadTemplates(absPath string, prefix string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !fi.IsDir() {
|
if !fi.IsDir() {
|
||||||
if isDotFile(path) {
|
if isDotFile(path) || isBackupFile(path) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user