Skip to content

Commit

Permalink
hugolib: fix livereload problem with files including NFC characters i…
Browse files Browse the repository at this point in the history
…n Macos

Fixes gohugoio#8429
  • Loading branch information
roointan committed Jan 7, 2022
1 parent d632dd7 commit ae411f4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions hugolib/site.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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)
}

Expand Down

0 comments on commit ae411f4

Please sign in to comment.