about summary refs log tree commit diff stats
path: root/internal/builder/builder.go
diff options
context:
space:
mode:
authorAlan Pearce2025-01-26 14:34:58 +0100
committerAlan Pearce2025-01-26 14:34:58 +0100
commit88932b8dc1d2a73195dcb1a9c4b82e15acd908c4 (patch)
treed549721a78d65fdcb104c709fb50dad7651870f7 /internal/builder/builder.go
parent33b1a776e087ddd012e35ef3a7efa3ec9fd575b8 (diff)
downloadwebsite-88932b8dc1d2a73195dcb1a9c4b82e15acd908c4.tar.lz
website-88932b8dc1d2a73195dcb1a9c4b82e15acd908c4.tar.zst
website-88932b8dc1d2a73195dcb1a9c4b82e15acd908c4.zip
move / -> /index.html convention to storage layer
Diffstat (limited to 'internal/builder/builder.go')
-rw-r--r--internal/builder/builder.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/builder/builder.go b/internal/builder/builder.go
index 68eec14..df66f87 100644
--- a/internal/builder/builder.go
+++ b/internal/builder/builder.go
@@ -77,7 +77,7 @@ func build(ioConfig *IOConfig, config *config.Config, log *log.Logger) (*Result,
 	log.Debug("rendering tags list")
 	if err := storage.RenderToFile(
 		templates.TagsPage(config, "tags", mapset.Sorted(tags), "/tags"),
-		path.Join("tags", "index.html"),
+		"tags/",
 	); err != nil {
 		return nil, err
 	}
@@ -94,7 +94,7 @@ func build(ioConfig *IOConfig, config *config.Config, log *log.Logger) (*Result,
 		url := "/tags/" + tag
 		if err := storage.RenderToFile(
 			templates.TagPage(config, tag, matchingPosts, url),
-			path.Join("tags", tag, "index.html"),
+			path.Join("tags", tag)+"/",
 		); err != nil {
 			return nil, err
 		}
@@ -118,7 +118,7 @@ func build(ioConfig *IOConfig, config *config.Config, log *log.Logger) (*Result,
 	log.Debug("rendering list page")
 	if err := storage.RenderToFile(
 		templates.ListPage(config, posts, "/post"),
-		path.Join("post", "index.html"),
+		"post/",
 	); err != nil {
 		return nil, err
 	}
@@ -160,14 +160,14 @@ func build(ioConfig *IOConfig, config *config.Config, log *log.Logger) (*Result,
 	if err != nil {
 		return nil, err
 	}
-	if err := storage.RenderToFile(templates.Homepage(config, posts, content), "index.html"); err != nil {
+	if err := storage.RenderToFile(templates.Homepage(config, posts, content), "/"); err != nil {
 		return nil, err
 	}
 	// it would be nice to set LastMod here, but using the latest post
 	// date would be wrong as the homepage has its own content file
 	// without a date, which could be newer
 	sitemap.AddPath("/", time.Time{})
-	f, err := storage.Open("index.html")
+	f, err := storage.Open("/")
 	if err != nil {
 		return nil, err
 	}