Skip to content

Commit 3164103

Browse files
committed
commands: Support Fast Render mode with sub-path in baseURL
Fixes #3981
1 parent 6a51701 commit 3164103

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

‎commands/hugo.go‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,8 +771,9 @@ func (c *commandeer) rebuildSites(events []fsnotify.Event) error {
771771
visited := c.visitedURLs.PeekAllSet()
772772
doLiveReload := !buildWatch && !c.Cfg.GetBool("disableLiveReload")
773773
if doLiveReload && !c.Cfg.GetBool("disableFastRender") {
774+
home := c.pathSpec.PrependBasePath("/")
774775
// Make sure we always render the home page
775-
visited["/"] = true
776+
visited[home] = true
776777
}
777778
return Hugo.Build(hugolib.BuildCfg{PrintStats: !quiet, Watching: true, RecentlyVisited: visited}, events...)
778779
}

‎commands/server.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ func (c *commandeer) serve(port int) {
238238
}
239239

240240
if fastRenderMode {
241-
p := r.URL.Path
241+
p := r.RequestURI
242242
if strings.HasSuffix(p, "/") || strings.HasSuffix(p, "html") || strings.HasSuffix(p, "htm") {
243243
c.visitedURLs.Add(p)
244244
}

0 commit comments

Comments
 (0)