File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -265,21 +265,22 @@ layout: layouts/base.njk
265265</div >
266266
267267{% if hasExamples %}
268+ {% for example in integration .examples %}
269+ {% if example .flow %}
270+ <script type =" application/json" id =" flow-data-{{ loop.index0 }}" >{{ example .flow | safe }} </script >
271+ {% endif %}
272+ {% endfor %}
273+
268274<!-- Flow Renderer Script -->
269275<script type =" module" >
270276 import FlowRenderer from ' /js/flowrenderer.min.js' ;
271277
272278 // Store flow data
273- const flowData = [
274- {% for example in integration .examples % }
275- {% if example .flow % }
276- {
277- index: {{ loop .index0 }},
278- flow: {{ example .flow | safe }}
279- }{% if not loop .last % },{% endif % }
280- {% endif % }
281- {% endfor % }
282- ];
279+ const flowData = [];
280+ document .querySelectorAll (' script[id^="flow-data-"]' ).forEach (el => {
281+ const index = parseInt (el .id .replace (' flow-data-' , ' ' ), 10 );
282+ flowData .push ({ index, flow: JSON .parse (el .textContent ) });
283+ });
283284
284285 // Add event listeners to tab buttons
285286 document .querySelectorAll (' .tab-button' ).forEach (button => {
You can’t perform that action at this time.
0 commit comments