Skip to content

Commit 4e45fab

Browse files
committed
リストの記述簡略化
1 parent 7f38b14 commit 4e45fab

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

app/sidebar.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,8 @@ export function Sidebar() {
4848
<ul className="ml-4 mt-2 text-sm">
4949
{splitmdcontent
5050
.slice(1)
51-
.map((section, idx) => ( section.level===2 ?
52-
<li key={idx}>
53-
<Link href={`#${idx+1}`}>{section.title}</Link>
54-
</li>
55-
:
56-
<li key={idx} style={{ marginLeft: '1em' }}>
51+
.map((section, idx) => (
52+
<li key={idx} style={{ marginLeft: section.level===2 ? undefined : "1em" }}>
5753
<Link href={`#${idx+1}`}>{section.title}</Link>
5854
</li>
5955
))}

0 commit comments

Comments
 (0)