summaryrefslogtreecommitdiff
path: root/src/render
diff options
context:
space:
mode:
authorBrian Picciano <mediocregopher@gmail.com>2024-07-24 21:48:38 +0200
committerBrian Picciano <mediocregopher@gmail.com>2024-07-24 21:48:38 +0200
commit45c20d03663878f3508eaa9b961cb0cb12cc5574 (patch)
treea965671ce18393c638b3d52b6a82b3b5cf90beb9 /src/render
parent60c6165d07b7fa633d7a8fafbe70e23c83d43c47 (diff)
Got post exporting working
Diffstat (limited to 'src/render')
-rw-r--r--src/render/methods.go6
1 files changed, 3 insertions, 3 deletions
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)
}