diff options
| author | Leonardo Bishop <me@leonardobishop.net> | 2025-07-16 20:14:18 +0100 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.net> | 2025-07-16 20:14:18 +0100 |
| commit | fbcde64820bcef47acdb13dfa2cbf77348820246 (patch) | |
| tree | 64b3b0d6ee3a276b69884f780f4e441229e31dcd | |
| parent | dbb0d382deaafd3519c9b4ab7583cf58884897e8 (diff) | |
Try .html as well
| -rw-r--r-- | pkg/site/fs.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/pkg/site/fs.go b/pkg/site/fs.go index a77da63..e8ee7fc 100644 --- a/pkg/site/fs.go +++ b/pkg/site/fs.go @@ -3,6 +3,7 @@ package site import ( "net/http" "path/filepath" + "strings" ) type siteFS struct { @@ -12,7 +13,15 @@ type siteFS struct { func (sfs siteFS) Open(path string) (http.File, error) { f, err := sfs.fs.Open(path) if err != nil { - return nil, err + if strings.HasSuffix(path, ".html") { + return nil, err + } + + htmlPath := path + ".html" + f, err = sfs.fs.Open(htmlPath) + if err != nil { + return nil, err + } } s, err := f.Stat() |
