Skip to content

Commit c55c541

Browse files
authored
[Docs Site] Only show child units in LP when present (#18291)
1 parent 299ee8c commit c55c541

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

src/components/LearningPath.astro

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,19 @@ if (!firstModule)
6464
<LinkButton href={"/" + module.slug + "/"} variant="secondary">
6565
Start module
6666
</LinkButton>
67-
<Details header={`Contains ${units.length} units`} open>
68-
<Steps>
69-
<ol>
70-
{units.map((unit) => (
71-
<li>
72-
<a href={"/" + unit.slug + "/"}>{unit.data.title}</a>
73-
</li>
74-
))}
75-
</ol>
76-
</Steps>
77-
</Details>
67+
{units.length > 0 && (
68+
<Details header={`Contains ${units.length} units`} open>
69+
<Steps>
70+
<ol>
71+
{units.map((unit) => (
72+
<li>
73+
<a href={"/" + unit.slug + "/"}>{unit.data.title}</a>
74+
</li>
75+
))}
76+
</ol>
77+
</Steps>
78+
</Details>
79+
)}
7880
</li>
7981
);
8082
})

0 commit comments

Comments
 (0)