From 45c20d03663878f3508eaa9b961cb0cb12cc5574 Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Wed, 24 Jul 2024 21:48:38 +0200 Subject: Got post exporting working --- src/render/methods.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/render') diff --git a/src/render/methods.go b/src/render/methods.go index a28f6b5..2988d8f 100644 --- a/src/render/methods.go +++ b/src/render/methods.go @@ -200,7 +200,7 @@ type preprocessPostPayload struct { // preprocessPostBody interprets the Post's Body as a text template which may // use any of the functions found in PreprocessFunctions (all must be set). It // executes the template and writes the result to the given writer. -func (m *Methods) preprocessPostBody(into io.Writer, p post.Post) error { +func (m *Methods) PreprocessPostBody(into io.Writer, p post.Post) error { tpl := txttpl.New("") tpl, err := tpl.Parse(p.Body) @@ -221,7 +221,7 @@ func (m *Methods) preprocessPostBody(into io.Writer, p post.Post) error { func (m *Methods) PostGemtextBody(p post.StoredPost) (string, error) { buf := new(bytes.Buffer) - if err := m.preprocessPostBody(buf, p.Post); err != nil { + if err := m.PreprocessPostBody(buf, p.Post); err != nil { return "", fmt.Errorf("preprocessing post body: %w", err) } @@ -243,7 +243,7 @@ func (m *Methods) PostGemtextBody(p post.StoredPost) (string, error) { func (m *Methods) PostHTMLBody(p post.StoredPost) (template.HTML, error) { bodyBuf := new(bytes.Buffer) - if err := m.preprocessPostBody(bodyBuf, p.Post); err != nil { + if err := m.PreprocessPostBody(bodyBuf, p.Post); err != nil { return "", fmt.Errorf("preprocessing post body: %w", err) } -- cgit v1.2.3