Skip to content

Commit c248b49

Browse files
YuiYukihiraepage
authored andcommitted
feat: Add render tag
The main functionality missing is `as <name>` should be optional, defaulting to the partial's file name. For background, see - https://shopify.dev/docs/api/liquid/tags/render - https://github.com/Shopify/liquid/blob/master/lib/liquid/tags/render.rb - https://github.com/Shopify/liquid/blob/master/test/integration/tags/render_tag_test.rb Fixes #471
1 parent 680b5f3 commit c248b49

File tree

7 files changed

+846
-3
lines changed

7 files changed

+846
-3
lines changed

crates/core/src/runtime/stack.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,14 @@ impl<P: super::Runtime, O: ObjectView> super::Runtime for StackFrame<P, O> {
9191
}
9292
}
9393

94-
pub(crate) struct GlobalFrame<P> {
94+
/// A stack frame that only provides a sandboxed set of globals
95+
pub struct GlobalFrame<P> {
9596
parent: P,
9697
data: std::cell::RefCell<Object>,
9798
}
9899

99100
impl<P: super::Runtime> GlobalFrame<P> {
101+
/// Override globals for `parent`
100102
pub fn new(parent: P) -> Self {
101103
Self {
102104
parent,

crates/lib/src/stdlib/tags/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ mod cycle_tag;
33
mod include_tag;
44
mod increment_tags;
55
mod interrupt_tags;
6+
mod render_tag;
67

78
pub use self::assign_tag::AssignTag;
89
pub use self::cycle_tag::CycleTag;
@@ -11,3 +12,4 @@ pub use self::increment_tags::DecrementTag;
1112
pub use self::increment_tags::IncrementTag;
1213
pub use self::interrupt_tags::BreakTag;
1314
pub use self::interrupt_tags::ContinueTag;
15+
pub use self::render_tag::RenderTag;

0 commit comments

Comments
 (0)