mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 06:17:45 +00:00
Update 404 to be compiled to .html instead of directory
This commit is contained in:
1 parent
50a8c50726
commit
348e123c9f
1 file changed
+9
@@ -748,6 +748,15 @@ func (s *Site) RenderHomePage() error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Force `UglyUrls` option to force `404.html` file name
|
||||||
|
switch s.Target.(type) {
|
||||||
|
case *target.Filesystem:
|
||||||
|
if !s.Target.(*target.Filesystem).UglyUrls {
|
||||||
|
s.Target.(*target.Filesystem).UglyUrls = true
|
||||||
|
defer func() { s.Target.(*target.Filesystem).UglyUrls = false }()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
n.Url = helpers.Urlize("404.html")
|
n.Url = helpers.Urlize("404.html")
|
||||||
n.Title = "404 Page not found"
|
n.Title = "404 Page not found"
|
||||||
n.Permalink = s.permalink("404.html")
|
n.Permalink = s.permalink("404.html")
|
||||||
|
|||||||
Reference in new issue
Block a user