mirror of
https://github.com/danog/gojekyll.git
synced 2025-01-22 12:31:18 +01:00
stylistic changes
This commit is contained in:
parent
5cd1554f27
commit
4f664d2998
@ -261,4 +261,3 @@ func whereFilter(array []map[string]interface{}, key string, value interface{})
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -23,7 +23,6 @@ func init() {
|
||||
redirectTemplate = tmpl
|
||||
}
|
||||
|
||||
|
||||
func (p jekyllRedirectFromPlugin) PostRead(site Site) error {
|
||||
redirections := []pages.Document{}
|
||||
for _, p := range site.Pages() {
|
||||
|
13
site/drop.go
13
site/drop.go
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user