mirror of
https://github.com/gohugoio/hugo.git
synced 2025-09-01 22:42:45 +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:
@@ -31,14 +31,19 @@ import (
|
||||
"github.com/gohugoio/hugo/resources/page"
|
||||
)
|
||||
|
||||
var pageIdCounter atomic.Int64
|
||||
|
||||
func newPageBase(metaProvider *pageMeta) (*pageState, error) {
|
||||
if metaProvider.s == nil {
|
||||
panic("must provide a Site")
|
||||
}
|
||||
|
||||
id := int(pageIdCounter.Add(1))
|
||||
|
||||
s := metaProvider.s
|
||||
|
||||
ps := &pageState{
|
||||
id: id,
|
||||
pageOutput: nopPageOutput,
|
||||
pageOutputTemplateVariationsState: atomic.NewUint32(0),
|
||||
pageCommon: &pageCommon{
|
||||
|
Reference in New Issue
Block a user