diff options
Diffstat (limited to 'tpl')
-rw-r--r-- | tpl/template.go | 2 | ||||
-rw-r--r-- | tpl/tplimpl/embedded/templates/_default/_markup/render-image.html | 2 | ||||
-rw-r--r-- | tpl/tplimpl/embedded/templates/_default/_markup/render-link.html | 6 |
3 files changed, 6 insertions, 4 deletions
diff --git a/tpl/template.go b/tpl/template.go index e9725bd74..5ef0eecb8 100644 --- a/tpl/template.go +++ b/tpl/template.go @@ -165,10 +165,12 @@ var Context = struct { SetDependencyManagerInCurrentScope func(context.Context, identity.Manager) context.Context DependencyScope hcontext.ContextDispatcher[int] Page hcontext.ContextDispatcher[page] + IsInGoldmark hcontext.ContextDispatcher[bool] }{ DependencyManagerScopedProvider: hcontext.NewContextDispatcher[identity.DependencyManagerScopedProvider](contextKey("DependencyManagerScopedProvider")), DependencyScope: hcontext.NewContextDispatcher[int](contextKey("DependencyScope")), Page: hcontext.NewContextDispatcher[page](contextKey("Page")), + IsInGoldmark: hcontext.NewContextDispatcher[bool](contextKey("IsInGoldmark")), } func init() { diff --git a/tpl/tplimpl/embedded/templates/_default/_markup/render-image.html b/tpl/tplimpl/embedded/templates/_default/_markup/render-image.html index fa78cd00c..013e31235 100644 --- a/tpl/tplimpl/embedded/templates/_default/_markup/render-image.html +++ b/tpl/tplimpl/embedded/templates/_default/_markup/render-image.html @@ -1,7 +1,7 @@ {{- $u := urls.Parse .Destination -}} {{- $src := $u.String -}} {{- if not $u.IsAbs -}} - {{- with or (.Page.Resources.Get $u.Path) (resources.Get $u.Path) -}} + {{- with or (.PageInner.Resources.Get $u.Path) (resources.Get $u.Path) -}} {{- $src = .RelPermalink -}} {{- end -}} {{- end -}} diff --git a/tpl/tplimpl/embedded/templates/_default/_markup/render-link.html b/tpl/tplimpl/embedded/templates/_default/_markup/render-link.html index cfc95ab3a..8903d3dfb 100644 --- a/tpl/tplimpl/embedded/templates/_default/_markup/render-link.html +++ b/tpl/tplimpl/embedded/templates/_default/_markup/render-link.html @@ -1,11 +1,11 @@ {{- $u := urls.Parse .Destination -}} {{- $href := $u.String -}} {{- if strings.HasPrefix $u.String "#" }} - {{- $href = printf "%s#%s" .Page.RelPermalink $u.Fragment }} + {{- $href = printf "%s#%s" .PageInner.RelPermalink $u.Fragment }} {{- else if not $u.IsAbs -}} {{- with or - ($.Page.GetPage $u.Path) - ($.Page.Resources.Get $u.Path) + ($.PageInner.GetPage $u.Path) + ($.PageInner.Resources.Get $u.Path) (resources.Get $u.Path) -}} {{- $href = .RelPermalink -}} |