From c4cd71cd346ecf36bcb894c0175f2815c1fd8074 Mon Sep 17 00:00:00 2001 From: Chimbori Date: Sun, 29 Oct 2023 17:15:31 -0700 Subject: [PATCH] Serve extensionless URL `/some-url` from file `/some-url.html` --- site/site.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/site/site.go b/site/site.go index 0ad32af..d311a04 100644 --- a/site/site.go +++ b/site/site.go @@ -211,5 +211,9 @@ func (s *Site) URLPage(urlpath string) (p Document, found bool) { if !found { p, found = s.Routes[filepath.Join(urlpath, "index.htm")] } + if !found { + // Serve extensionless URL `/some-url` from file `/some-url.html` + p, found = s.Routes[filepath.Join(urlpath + ".html")] + } return }