From 006c0028106425abb3f718b2e86349dee5b7a2ea Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Sun, 26 May 2024 21:43:49 +0200 Subject: Refactor how preprocess functions work a bit --- src/render/methods.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/render') 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) -- cgit v1.2.3