fix(recipes): single-URL polling root scope + {% template %} double-render - #74
Merged
rbouteiller merged 5 commits intoJun 30, 2026
Conversation
rbouteiller
force-pushed
the
fix/single-url-polling-root-scope
branch
from
June 30, 2026 15:49
7491e54 to
9f8ec04
Compare
…bar for legibility
A Liquid recipe with one polling_url must expose the response JSON's
keys at the root scope (e.g. {{ img }}), matching TRMNL. fetchPollingData
namespaced even a single URL under IDX_0, so single-URL recipes (e.g.
"XKCD Comic with Hover text") got empty variables and rendered their
fallback. Root-merge IDX_0 when there is exactly one URL; multi-URL
recipes keep IDX_0/IDX_1.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
{% template name %} only DEFINES a reusable block; it must emit nothing
at definition time. TemplateTag.render emitted the block body inline, so
a recipe whose layout also called {% render "name" %} rendered the block
twice (e.g. the XKCD comic appeared duplicated and half-size). Make the
definition emit nothing.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
rbouteiller
force-pushed
the
fix/single-url-polling-root-scope
branch
from
June 30, 2026 15:52
9f8ec04 to
590a060
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two fixes for Liquid recipe rendering (surfaced by the "XKCD Comic with Hover text" recipe).
1. Single-URL polling data not at root scope
A recipe with one
polling_urlmust expose the response JSON's keys at the root scope ({{ img }}), matching TRMNL.fetchPollingDatanamespaced even a single URL underIDX_0, so vars were empty and the recipe rendered its fallback. Root-mergeIDX_0when there's exactly one URL; multi-URL keepsIDX_0/IDX_1.2.
{% template %}blocks rendered twice{% template name %}only defines a reusable block, butTemplateTag.renderemitted its body inline at definition time — so a layout calling{% render "name" %}rendered it twice (comic appeared duplicated and half-size). Definition now emits nothing.🤖 Generated with Claude Code