mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-16 20:53:59 +02:00
hugolib: Fix livereload problem with files including NFC characters in MacOs
Fixes #8429
This commit is contained in:
@@ -24,12 +24,14 @@ import (
|
||||
"path"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"runtime"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/gohugoio/hugo/common/types"
|
||||
"golang.org/x/text/unicode/norm"
|
||||
|
||||
"github.com/gohugoio/hugo/common/paths"
|
||||
|
||||
@@ -950,6 +952,10 @@ func (s *Site) filterFileEvents(events []fsnotify.Event) []fsnotify.Event {
|
||||
continue
|
||||
}
|
||||
|
||||
if runtime.GOOS == "darwin" { // When a file system is HFS+, its filepath is in NFD form.
|
||||
ev.Name = norm.NFC.String(ev.Name)
|
||||
}
|
||||
|
||||
filtered = append(filtered, ev)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user