Skip to content

Commit

Permalink
commands: Support Fast Render mode with sub-path in baseURL
Browse files Browse the repository at this point in the history
Fixes #3981
  • Loading branch information
bep committed Oct 19, 2017
1 parent 6a51701 commit 3164103
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion commands/hugo.go
Original file line number Diff line number Diff line change
Expand Up @@ -771,8 +771,9 @@ func (c *commandeer) rebuildSites(events []fsnotify.Event) error {
visited := c.visitedURLs.PeekAllSet()
doLiveReload := !buildWatch && !c.Cfg.GetBool("disableLiveReload")
if doLiveReload && !c.Cfg.GetBool("disableFastRender") {
home := c.pathSpec.PrependBasePath("/")
// Make sure we always render the home page
visited["/"] = true
visited[home] = true
}
return Hugo.Build(hugolib.BuildCfg{PrintStats: !quiet, Watching: true, RecentlyVisited: visited}, events...)
}
Expand Down
2 changes: 1 addition & 1 deletion commands/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ func (c *commandeer) serve(port int) {
}

if fastRenderMode {
p := r.URL.Path
p := r.RequestURI
if strings.HasSuffix(p, "/") || strings.HasSuffix(p, "html") || strings.HasSuffix(p, "htm") {
c.visitedURLs.Add(p)
}
Expand Down

0 comments on commit 3164103

Please sign in to comment.