mirror of
https://github.com/miniflux/v2.git
synced 2025-08-11 17:51:01 +00:00
Use vanilla HTTP handlers (refactoring)
This commit is contained in:
parent
1eba1730d1
commit
f49b42f70f
121 changed files with 4339 additions and 3369 deletions
|
@ -7,7 +7,6 @@ package template
|
|||
import (
|
||||
"bytes"
|
||||
"html/template"
|
||||
"io"
|
||||
"time"
|
||||
|
||||
"github.com/miniflux/miniflux/config"
|
||||
|
@ -38,7 +37,7 @@ func (e *Engine) parseAll() {
|
|||
}
|
||||
|
||||
// Render process a template and write the ouput.
|
||||
func (e *Engine) Render(w io.Writer, name, language string, data interface{}) {
|
||||
func (e *Engine) Render(name, language string, data interface{}) []byte {
|
||||
tpl, ok := e.templates[name]
|
||||
if !ok {
|
||||
logger.Fatal("[Template] The template %s does not exists", name)
|
||||
|
@ -74,7 +73,7 @@ func (e *Engine) Render(w io.Writer, name, language string, data interface{}) {
|
|||
logger.Fatal("[Template] Unable to render template: %v", err)
|
||||
}
|
||||
|
||||
b.WriteTo(w)
|
||||
return b.Bytes()
|
||||
}
|
||||
|
||||
// NewEngine returns a new template engine.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue