Commit abe3ce1 1 parent f3c28b1 commit abe3ce1 Copy full SHA for abe3ce1
File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -42,9 +42,13 @@ func (p *BookRendor) renderTalkPages(path string) error {
42
42
t := template .Must (present .Template ().Parse (tmplPresent ))
43
43
t = template .Must (t .Parse (tmplAction ))
44
44
45
- var buf bytes.Buffer
46
- if err = doc .Render (& buf , t ); err != nil {
47
- return err
45
+ var htmlContent []byte
46
+ {
47
+ var buf bytes.Buffer
48
+ if err = doc .Render (& buf , t ); err != nil {
49
+ return err
50
+ }
51
+ htmlContent = bytes .TrimSpace (buf .Bytes ())
48
52
}
49
53
50
54
dstAbsPath := filepath .Join (p .Book .Root , "book" , path )
@@ -54,7 +58,7 @@ func (p *BookRendor) renderTalkPages(path string) error {
54
58
dstAbsPath += ".html"
55
59
56
60
os .MkdirAll (filepath .Dir (dstAbsPath ), 0777 )
57
- if err := os .WriteFile (dstAbsPath , buf . Bytes () , 0666 ); err != nil {
61
+ if err := os .WriteFile (dstAbsPath , htmlContent , 0666 ); err != nil {
58
62
return err
59
63
}
60
64
You can’t perform that action at this time.
0 commit comments