about summary refs log tree commit diff stats
path: root/internal/builder/builder.go
diff options
context:
space:
mode:
authorAlan Pearce2024-06-29 23:02:51 +0200
committerAlan Pearce2024-06-29 23:02:51 +0200
commitc4d5654e6360e90be2106439463f49acb55dffc8 (patch)
tree9056a81b9733022f17ce7dc2eff070bedf7822ea /internal/builder/builder.go
parente1a16b18ee0271bbad754d889a1455fc2e8b1d6d (diff)
downloadwebsite-c4d5654e6360e90be2106439463f49acb55dffc8.tar.lz
website-c4d5654e6360e90be2106439463f49acb55dffc8.tar.zst
website-c4d5654e6360e90be2106439463f49acb55dffc8.zip
use encoding/xml for atom feeds
Diffstat (limited to 'internal/builder/builder.go')
-rw-r--r--internal/builder/builder.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/internal/builder/builder.go b/internal/builder/builder.go
index b6da17d..63a9999 100644
--- a/internal/builder/builder.go
+++ b/internal/builder/builder.go
@@ -175,7 +175,6 @@ func build(ioConfig *IOConfig, config *config.Config, log *log.Logger) (*Result,
 
 		log.Debug("rendering tags feed", "tag", tag)
 		feed, err := renderFeed(
-			ioConfig.Source,
 			fmt.Sprintf("%s - %s", config.Title, tag),
 			config,
 			matchingPosts,
@@ -184,7 +183,7 @@ func build(ioConfig *IOConfig, config *config.Config, log *log.Logger) (*Result,
 		if err != nil {
 			return nil, errors.WithMessage(err, "could not render tag feed page")
 		}
-		if err := outputToFile(feed, outDir, "tags", tag, "atom.xml"); err != nil {
+		if err := writerToFile(feed, outDir, "tags", tag, "atom.xml"); err != nil {
 			return nil, err
 		}
 	}
@@ -196,11 +195,11 @@ func build(ioConfig *IOConfig, config *config.Config, log *log.Logger) (*Result,
 	sitemap.AddPath("/post/", lastMod)
 
 	log.Debug("rendering feed")
-	feed, err := renderFeed(ioConfig.Source, config.Title, config, posts, "feed")
+	feed, err := renderFeed(config.Title, config, posts, "feed")
 	if err != nil {
 		return nil, errors.WithMessage(err, "could not render feed")
 	}
-	if err := outputToFile(feed, outDir, "atom.xml"); err != nil {
+	if err := writerToFile(feed, outDir, "atom.xml"); err != nil {
 		return nil, err
 	}