1
0
mirror of https://github.com/danog/gojekyll.git synced 2025-01-22 12:31:18 +01:00

stylistic changes

This commit is contained in:
Oliver Steele 2017-07-09 16:09:03 -04:00
parent 5cd1554f27
commit 4f664d2998
4 changed files with 16 additions and 18 deletions

View File

@ -261,4 +261,3 @@ func whereFilter(array []map[string]interface{}, key string, value interface{})
}
return out
}

View File

@ -106,16 +106,17 @@ func (p *page) Write(w io.Writer, rc RenderingContext) error {
// Content computes the page content.
func (p *page) Content(rc RenderingContext) ([]byte, error) {
if p.content == nil {
rp := rc.RenderingPipeline()
buf := new(bytes.Buffer)
b, err := rp.Render(buf, p.raw, p.filename, p.firstLine, p.TemplateContext(rc))
if err != nil {
return nil, err
}
p.content = &b
if p.content != nil {
return *p.content, nil
}
return *p.content, nil
rp := rc.RenderingPipeline()
buf := new(bytes.Buffer)
b, err := rp.Render(buf, p.raw, p.filename, p.firstLine, p.TemplateContext(rc))
if err != nil {
return nil, err
}
p.content = &b
return b, nil
}
// retains content

View File

@ -23,7 +23,6 @@ func init() {
redirectTemplate = tmpl
}
func (p jekyllRedirectFromPlugin) PostRead(site Site) error {
redirections := []pages.Document{}
for _, p := range site.Pages() {

View File

@ -10,14 +10,13 @@ import (
// ToLiquid returns the site variable for template evaluation.
func (s *Site) ToLiquid() interface{} {
// double-checked lock is okay here, since it's okay if this is
// computed and set twice
if len(s.drop) > 0 {
return s.drop
}
s.Lock()
defer s.Unlock()
if len(s.drop) == 0 {
s.Lock()
defer s.Unlock()
if len(s.drop) == 0 {
s.initializeDrop()
}
s.initializeDrop()
}
return s.drop
}