mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
Add Page.RenderShortcodes
A layouts/shortcodes/include.html shortcode may look like this: ```html {{ $p := site.GetPage (.Get 0) }} {{ $p.RenderShortcodes }} ``` Fixes #7297
This commit is contained in:
@@ -277,6 +277,7 @@ type PageRenderProvider interface {
|
||||
// PageWithoutContent is the Page without any of the content methods.
|
||||
type PageWithoutContent interface {
|
||||
RawContentProvider
|
||||
RenderShortcodesProvider
|
||||
resource.Resource
|
||||
PageMetaProvider
|
||||
resource.LanguageProvider
|
||||
@@ -362,6 +363,11 @@ type RawContentProvider interface {
|
||||
RawContent() string
|
||||
}
|
||||
|
||||
type RenderShortcodesProvider interface {
|
||||
// RenderShortcodes returns RawContent with any shortcodes rendered.
|
||||
RenderShortcodes(context.Context) (template.HTML, error)
|
||||
}
|
||||
|
||||
// RefProvider provides the methods needed to create reflinks to pages.
|
||||
type RefProvider interface {
|
||||
// Ref returns an absolute URl to a page.
|
||||
|
Reference in New Issue
Block a user