Skip to content

Commit 1e15d09

Browse files
lbliiicursoragent
andcommitted
docs: replace Jinja2-style block endings with {% end %} in Kida examples
Kida uses unified {% end %} for all block endings. Updated all Kida code examples to use {% end %} instead of {% endblock %}, {% endfor %}, {% endmacro %}, and {% endcall %}. Jinja2 "before" examples in migration docs correctly retain old syntax. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent e5fe8b7 commit 1e15d09

13 files changed

Lines changed: 34 additions & 34 deletions

File tree

site/content/docs/content/authoring/linking.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ All linking methods use O(1) lookups from pre-built indexes:
457457
<nav>
458458
{% for item in site.menus.main %}
459459
<a href="{{ item.url }}">{{ item.name }}</a>
460-
{% endfor %}
460+
{% end %}
461461
</nav>
462462
```
463463

@@ -480,7 +480,7 @@ All linking methods use O(1) lookups from pre-built indexes:
480480
<ul>
481481
{% for page in related %}
482482
<li>{{ ref(page.path) }}</li>
483-
{% endfor %}
483+
{% end %}
484484
</ul>
485485
{% end %}
486486
```

site/content/docs/content/reuse/filtering.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Here are all our Python tutorials.
114114
{% end %}
115115
</div>
116116
117-
{% endblock %}
117+
{% end %}
118118
```
119119

120120
## Summary

site/content/docs/reference/kida-syntax.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,10 @@ Make a variable from an inner scope available to the outer scope:
251251
<article>
252252
{{ page.content | safe }}
253253
</article>
254-
{% endblock %}
254+
{% end %}
255255
```
256256

257-
**Note**: Kida uses `{% endblock %}` for blocks (Jinja2 compatibility), but `{% end %}` works too.
257+
**Note**: Kida uses `{% end %}` as the preferred block ending. `{% endblock %}` is also accepted for Jinja2 compatibility.
258258

259259
### Includes
260260

@@ -319,7 +319,7 @@ Kida functions can access variables from their surrounding context automatically
319319
320320
{% call card(page) %}
321321
<p>Custom content here</p>
322-
{% endcall %}
322+
{% end %}
323323
```
324324

325325
## Filters and Pipeline
@@ -936,7 +936,7 @@ Kida can parse Jinja2 syntax via compatibility mode. Most Jinja2 templates work
936936
{{ build_sidebar(site.pages) }}
937937
</aside>
938938
{% end %}
939-
{% endblock %}
939+
{% end %}
940940
```
941941

942942
## See Also

site/content/docs/theming/templating/_index.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Bengal searches: **Your project** → **Theme** → **Bengal defaults**
4646
<h1>{{ page.title }}</h1>
4747
{{ page.content | safe }}
4848
</article>
49-
{% endblock %}
49+
{% end %}
5050
```
5151
:::
5252

@@ -56,12 +56,12 @@ Bengal searches: **Your project** → **Theme** → **Bengal defaults**
5656
<!DOCTYPE html>
5757
<html>
5858
<head>
59-
<title>{% block title %}{{ page.title }}{% endblock %}</title>
59+
<title>{% block title %}{{ page.title }}{% end %}</title>
6060
</head>
6161
<body>
62-
{% block header %}{% include "partials/header.html" %}{% endblock %}
63-
{% block content %}{% endblock %}
64-
{% block footer %}{% include "partials/footer.html" %}{% endblock %}
62+
{% block header %}{% include "partials/header.html" %}{% end %}
63+
{% block content %}{% end %}
64+
{% block footer %}{% include "partials/footer.html" %}{% end %}
6565
</body>
6666
</html>
6767
```
@@ -86,7 +86,7 @@ Bengal searches: **Your project** → **Theme** → **Bengal defaults**
8686
| Concept | Syntax | Purpose |
8787
|---------|--------|---------|
8888
| **Extends** | `{% extends "base.html" %}` | Inherit from parent template |
89-
| **Block** | `{% block name %}...{% endblock %}` | Replaceable section |
89+
| **Block** | `{% block name %}...{% end %}` | Replaceable section |
9090
| **Include** | `{% include "partial.html" %}` | Insert another template |
9191
| **Variable** | `{{ page.title }}` | Output a value |
9292
| **Filter** | `{{ text \| truncate(100) }}` | Transform a value |

site/content/docs/theming/templating/image-processing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ You can create a reusable responsive image pattern in your templates:
128128
sizes="{{ sizes }}"
129129
alt="{{ alt }}"
130130
loading="{{ loading }}" />
131-
{% endmacro %}
131+
{% end %}
132132
133133
{# Usage #}
134134
{{ responsive_img('hero.jpg', alt='Hero image', sizes='(max-width: 768px) 100vw, 50vw') }}

site/content/docs/theming/templating/kida/caching/fragments.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ bengal build --verbose
321321
{% end %}
322322
{% end %}
323323
</article>
324-
{% endblock %}
324+
{% end %}
325325
326326
{% block sidebar %}
327327
{% cache "sidebar-nav-" ~ site.nav_version %}
@@ -331,5 +331,5 @@ bengal build --verbose
331331
{% cache "tag-cloud" %}
332332
{{ build_tag_cloud(site.tags) }}
333333
{% end %}
334-
{% endblock %}
334+
{% end %}
335335
```

site/content/docs/theming/templating/kida/migration/from-jinja.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ cp templates/blog/single.html templates/blog/single.html.jinja2
224224
# Replace all block endings with {% end %}
225225
sed -i 's/{% endif %}/{% end %}/g' templates/blog/single.html
226226
sed -i 's/{% endfor %}/{% end %}/g' templates/blog/single.html
227-
sed -i 's/{% endblock %}/{% endblock %}/g' templates/blog/single.html # Keep endblock for compatibility
227+
sed -i 's/{% endblock %}/{% end %}/g' templates/blog/single.html
228228
```
229229

230230
### Step 4: Replace Template Variables
@@ -622,7 +622,7 @@ In strict mode, use `??` to handle undefined variables safely:
622622
{{ page.content | safe }}
623623
</article>
624624
{% end %}
625-
{% endblock %}
625+
{% end %}
626626
```
627627

628628
## Next Steps

site/content/docs/theming/templating/kida/syntax/functions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ Use with `{% call %}` to pass content:
110110
<button class="btn btn-danger">Delete</button>
111111
<button class="btn btn-secondary">Cancel</button>
112112
</div>
113-
{% endcall %}
113+
{% end %}
114114
```
115115

116116
## Common Patterns
@@ -257,5 +257,5 @@ Use in templates:
257257
{{ post_card(post) }}
258258
{% end %}
259259
</section>
260-
{% endblock %}
260+
{% end %}
261261
```

site/content/docs/theming/templating/kida/syntax/operators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,5 +188,5 @@ The `??` operator has lower precedence than `|`, so filters bind to the fallback
188188
</aside>
189189
{% end %}
190190
</article>
191-
{% endblock %}
191+
{% end %}
192192
```

site/content/docs/theming/templating/kida/syntax/variables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ Assign array and dict literals directly:
168168
<main class="{% if show_sidebar %}with-sidebar{% end %}">
169169
{{ page.content | safe }}
170170
</main>
171-
{% endblock %}
171+
{% end %}
172172
```
173173

174174
### Computed Values

0 commit comments

Comments
 (0)