File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 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 {
4242 t := template .Must (present .Template ().Parse (tmplPresent ))
4343 t = template .Must (t .Parse (tmplAction ))
4444
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 ())
4852 }
4953
5054 dstAbsPath := filepath .Join (p .Book .Root , "book" , path )
@@ -54,7 +58,7 @@ func (p *BookRendor) renderTalkPages(path string) error {
5458 dstAbsPath += ".html"
5559
5660 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 {
5862 return err
5963 }
6064
You can’t perform that action at this time.
0 commit comments