mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
Add BaseFs to RenderingContext
The org mode renderer supports including other files [1]. We don't want to allow reading of arbitrary files (go-org defaults to ioutil.ReadFile [2]) but want to make use of the FileSystem abstractions hugo provides. For starters we will allow reading from the content directory only [1]: e.g. `#+INCLUDE: ./foo.py src python` includes `foo.py` as a python source block.
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
b152216d5c
commit
020a6fbd7f
@@ -143,6 +143,7 @@ func newPageContentOutput(p *pageState) func(f output.Format) (*pageContentOutpu
|
||||
html := cp.p.s.ContentSpec.RenderBytes(&helpers.RenderingContext{
|
||||
Content: []byte(cp.p.m.summary), RenderTOC: false, PageFmt: cp.p.m.markup,
|
||||
Cfg: p.Language(),
|
||||
BaseFs: p.s.BaseFs,
|
||||
DocumentID: p.File().UniqueID(), DocumentName: p.File().Path(),
|
||||
Config: cp.p.getRenderingConfig()})
|
||||
html = cp.p.s.ContentSpec.TrimShortHTML(html)
|
||||
@@ -314,6 +315,7 @@ func (cp *pageContentOutput) renderContent(p page.Page, content []byte) []byte {
|
||||
return cp.p.s.ContentSpec.RenderBytes(&helpers.RenderingContext{
|
||||
Content: content, RenderTOC: true, PageFmt: cp.p.m.markup,
|
||||
Cfg: p.Language(),
|
||||
BaseFs: cp.p.s.BaseFs,
|
||||
DocumentID: p.File().UniqueID(), DocumentName: p.File().Path(),
|
||||
Config: cp.p.getRenderingConfig()})
|
||||
}
|
||||
|
Reference in New Issue
Block a user