Skip to content

Commit 6ff3faa

Browse files
Fix null object sort error in section.html template
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 593dc21 commit 6ff3faa

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

docs/_includes/section.html

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,20 @@
99
{% assign activeSection = urlArray[3] | remove: ".html" %}
1010
{% assign section = hub.sections | where: "href", activeSection | first %}
1111

12-
<h1 class="title">
13-
{{ section.title }}
14-
</h1>
12+
{% if section %}
13+
<h1 class="title">
14+
{{ section.title }}
15+
</h1>
1516

16-
<section>
17-
<div class="cards-group">
17+
{% if section.articles %}
18+
<section>
19+
<div class="cards-group">
1820
{% assign sortedArticles = section.articles | sort: 'order', 'last' | default: 999 %}
1921
{% for article in sortedArticles %}
20-
{% assign article_href = section.href | append: '/' | append: article.href %}
21-
{% include article-card.html hub=hub.href href=article_href title=article.title platform=activePlatform %}
22+
{% assign article_href = section.href | append: '/' | append: article.href %}
23+
{% include article-card.html hub=hub.href href=article_href title=article.title platform=activePlatform %}
2224
{% endfor %}
23-
</div>
24-
</section>
25+
</div>
26+
</section>
27+
{% endif %}
28+
{% endif %}

0 commit comments

Comments
 (0)