mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-24 07:18:54 +00:00
Fix server static file detection for deleted files/directories in the static syncer
Related to #15174
This commit is contained in:
+1
-1
@@ -1108,7 +1108,7 @@ func (s *staticSyncer) syncsStaticEvents(staticEvents []fsnotify.Event) error {
|
||||
|
||||
fromPath := ev.Name
|
||||
|
||||
relPath, found := sourceFs.MakePathRelative(fromPath, true)
|
||||
relPath, found := sourceFs.MakePathRelative(fromPath, false)
|
||||
|
||||
if !found {
|
||||
// Not member of this virtual host.
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
# A deleted static file should be removed from the publish dir.
|
||||
|
||||
hugo server &
|
||||
|
||||
waitServer
|
||||
|
||||
exists public/static.txt
|
||||
|
||||
rm static/static.txt
|
||||
|
||||
sleep 2
|
||||
|
||||
! exists public/static.txt
|
||||
|
||||
stopServer
|
||||
! stderr .
|
||||
|
||||
-- hugo.toml --
|
||||
title = "Hugo Server Test"
|
||||
baseURL = "https://example.org/"
|
||||
disableKinds = ["taxonomy", "term", "sitemap"]
|
||||
-- layouts/all.html --
|
||||
All.
|
||||
-- content/p1.md --
|
||||
-- static/static.txt --
|
||||
static
|
||||
Reference in New Issue
Block a user