From ae411f42893feb93e54d4bd659189c94611066fe Mon Sep 17 00:00:00 2001 From: Paiman Roointan Date: Fri, 7 Jan 2022 23:18:53 +0330 Subject: [PATCH] hugolib: fix livereload problem with files including NFC characters in Macos Fixes #8429 --- hugolib/site.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hugolib/site.go b/hugolib/site.go index dce4b8d2548..91fc1fe801a 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -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" @@ -956,6 +958,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) }