zola
zola copied to clipboard
Context is lost when rendernig shortcode insede shortcode
Bug Report
Environment
Zola version: 0.16.1
Expected Behavior
When a shortcode is passed to a body of another shortcode, it should render in the parent's context.
Current Behavior
The only variable present in the child's context is nth
Step to reproduce
Build the attached website and check out the /post/
page:
Parent context: { "body": "{{ context() }}", "config": { "base_url": "http://127.0.0.1:1111/", "mode": "serve", "title": null, "description": null, "languages": {}, "default_language": "en", "generate_feed": false, "feed_filename": "atom.xml", "taxonomies": [], "build_search_index": false, "extra": {} }, "lang": "en", "nth": 1, "page": { "relative_path": "post.md", "content": "", "permalink": "http://127.0.0.1:1111/post/", "slug": "post", "ancestors": [ "_index.md" ], "title": "Post", "description": null, "updated": null, "date": null, "year": null, "month": null, "day": null, "taxonomies": {}, "extra": {}, "path": "/post/", "components": [ "post" ], "summary": null, "toc": [], "word_count": 3, "reading_time": 1, "assets": [], "draft": false, "lang": "en", "lower": null, "higher": null, "translations": [], "backlinks": [] } }
Child context: { "nth": 1 }
Nested shortcodes are not really supported so that's more a feature request than a bug report
Duplicate of https://github.com/getzola/zola/issues/515