Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Fasching <niklas.fasching@gmail.com>2019-10-04 00:27:51 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-10-07 18:30:15 +0300
commit020a6fbd7f6996ed84d80ba6c37fe0d8c2536806 (patch)
treeffe1aa927b6c89830fc5d5782867db2830c11878 /hugolib
parentb152216d5c8adbf1bfa4c6fb7b2a50b6866c685e (diff)
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.
Diffstat (limited to 'hugolib')
-rw-r--r--hugolib/page__per_output.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/hugolib/page__per_output.go b/hugolib/page__per_output.go
index 3638f9669..6a1262703 100644
--- a/hugolib/page__per_output.go
+++ b/hugolib/page__per_output.go
@@ -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()})
}