diff --git a/commands/hugo.go b/commands/hugo.go index ae9a3f6dd..a805d05db 100644 --- a/commands/hugo.go +++ b/commands/hugo.go @@ -352,6 +352,11 @@ func build(watches ...bool) { func copyStatic() error { publishDir := helpers.AbsPathify(viper.GetString("PublishDir")) + "/" + // If root, remove the second '/' + if publishDir == "//" { + publishDir = "/" + } + syncer := fsync.NewSyncer() syncer.NoTimes = viper.GetBool("notimes") syncer.SrcFs = hugofs.SourceFs