summaryrefslogtreecommitdiff
path: root/src/render/methods.go
diff options
context:
space:
mode:
authorBrian Picciano <mediocregopher@gmail.com>2024-05-26 21:43:49 +0200
committerBrian Picciano <mediocregopher@gmail.com>2024-05-26 21:43:49 +0200
commit006c0028106425abb3f718b2e86349dee5b7a2ea (patch)
tree47381f28793d97010fe60938eb7684a886dc885b /src/render/methods.go
parent43d8951296ce2f232ca94f0577e2e726291bf783 (diff)
Refactor how preprocess functions work a bit
Diffstat (limited to 'src/render/methods.go')
-rw-r--r--src/render/methods.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/render/methods.go b/src/render/methods.go
index a671f7e..a28f6b5 100644
--- a/src/render/methods.go
+++ b/src/render/methods.go
@@ -194,11 +194,7 @@ func (m *Methods) GetPostSeriesNextPrevious(
type preprocessPostPayload struct {
RootURL URLBuilder
- image func(args ...string) (string, error)
-}
-
-func (p preprocessPostPayload) Image(args ...string) (string, error) {
- return p.image(args...)
+ post.PreprocessFunctions
}
// preprocessPostBody interprets the Post's Body as a text template which may
@@ -213,8 +209,7 @@ func (m *Methods) preprocessPostBody(into io.Writer, p post.Post) error {
}
err = tpl.Execute(into, preprocessPostPayload{
- RootURL: m.RootURL(),
- image: m.preprocessFuncs.Image,
+ m.RootURL(), m.preprocessFuncs,
})
if err != nil {
return fmt.Errorf("executing post body as template: %w", err)