Skip to content

Commit fbf1cdc

Browse files
committed
feat(astro): support lessons without parts or chapters
1 parent da95026 commit fbf1cdc

File tree

10 files changed

+533
-292
lines changed

10 files changed

+533
-292
lines changed

packages/astro/src/default/utils/__snapshots__/multiple-parts.json

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,6 @@
8181
"id": "1-first",
8282
"filepath": "1-part/1-chapter/1-first/content.md",
8383
"order": 0,
84-
"part": {
85-
"id": "1-part",
86-
"title": "Basics"
87-
},
88-
"chapter": {
89-
"id": "1-chapter",
90-
"title": "The first chapter in part 1"
91-
},
9284
"Markdown": "Markdown for tutorial",
9385
"slug": "lesson-slug",
9486
"files": [
@@ -99,6 +91,14 @@
9991
"1-part-1-chapter-1-first-solution.json",
10092
[]
10193
],
94+
"part": {
95+
"id": "1-part",
96+
"title": "Basics"
97+
},
98+
"chapter": {
99+
"id": "1-chapter",
100+
"title": "The first chapter in part 1"
101+
},
102102
"next": {
103103
"title": "Welcome to TutorialKit",
104104
"href": "/part-slug/chapter-slug/lesson-slug"
@@ -117,14 +117,6 @@
117117
"id": "1-second",
118118
"filepath": "2-part/2-chapter/1-second/content.md",
119119
"order": 0,
120-
"part": {
121-
"id": "2-part",
122-
"title": "Basics"
123-
},
124-
"chapter": {
125-
"id": "2-chapter",
126-
"title": "The first chapter in part 1"
127-
},
128120
"Markdown": "Markdown for tutorial",
129121
"slug": "lesson-slug",
130122
"files": [
@@ -135,6 +127,14 @@
135127
"2-part-2-chapter-1-second-solution.json",
136128
[]
137129
],
130+
"part": {
131+
"id": "2-part",
132+
"title": "Basics"
133+
},
134+
"chapter": {
135+
"id": "2-chapter",
136+
"title": "The first chapter in part 1"
137+
},
138138
"prev": {
139139
"title": "Welcome to TutorialKit",
140140
"href": "/part-slug/chapter-slug/lesson-slug"
@@ -157,14 +157,6 @@
157157
"id": "1-third",
158158
"filepath": "3-part/3-chapter/1-third/content.md",
159159
"order": 0,
160-
"part": {
161-
"id": "3-part",
162-
"title": "Basics"
163-
},
164-
"chapter": {
165-
"id": "3-chapter",
166-
"title": "The first chapter in part 1"
167-
},
168160
"Markdown": "Markdown for tutorial",
169161
"slug": "lesson-slug",
170162
"files": [
@@ -175,6 +167,14 @@
175167
"3-part-3-chapter-1-third-solution.json",
176168
[]
177169
],
170+
"part": {
171+
"id": "3-part",
172+
"title": "Basics"
173+
},
174+
"chapter": {
175+
"id": "3-chapter",
176+
"title": "The first chapter in part 1"
177+
},
178178
"prev": {
179179
"title": "Welcome to TutorialKit",
180180
"href": "/part-slug/chapter-slug/lesson-slug"

packages/astro/src/default/utils/__snapshots__/single-part-chapter-and-lesson.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,6 @@
3737
"id": "1-lesson",
3838
"filepath": "1-part/1-chapter/1-lesson/content.md",
3939
"order": 0,
40-
"part": {
41-
"id": "1-part",
42-
"title": "Basics"
43-
},
44-
"chapter": {
45-
"id": "1-chapter",
46-
"title": "The first chapter in part 1"
47-
},
4840
"Markdown": "Markdown for tutorial",
4941
"slug": "lesson-slug",
5042
"files": [
@@ -54,7 +46,15 @@
5446
"solution": [
5547
"1-part-1-chapter-1-lesson-solution.json",
5648
[]
57-
]
49+
],
50+
"part": {
51+
"id": "1-part",
52+
"title": "Basics"
53+
},
54+
"chapter": {
55+
"id": "1-chapter",
56+
"title": "The first chapter in part 1"
57+
}
5858
}
5959
],
6060
"firstPartId": "1-part"

packages/astro/src/default/utils/__snapshots__/single-part-chapter-and-multiple-lessons.json

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,6 @@
3737
"id": "1-first",
3838
"filepath": "1-part/1-chapter/1-first/content.md",
3939
"order": 0,
40-
"part": {
41-
"id": "1-part",
42-
"title": "Basics"
43-
},
44-
"chapter": {
45-
"id": "1-chapter",
46-
"title": "The first chapter in part 1"
47-
},
4840
"Markdown": "Markdown for tutorial",
4941
"slug": "lesson-slug",
5042
"files": [
@@ -55,6 +47,14 @@
5547
"1-part-1-chapter-1-first-solution.json",
5648
[]
5749
],
50+
"part": {
51+
"id": "1-part",
52+
"title": "Basics"
53+
},
54+
"chapter": {
55+
"id": "1-chapter",
56+
"title": "The first chapter in part 1"
57+
},
5858
"next": {
5959
"title": "Welcome to TutorialKit",
6060
"href": "/part-slug/chapter-slug/lesson-slug"
@@ -73,14 +73,6 @@
7373
"id": "2-second",
7474
"filepath": "1-part/1-chapter/2-second/content.md",
7575
"order": 1,
76-
"part": {
77-
"id": "1-part",
78-
"title": "Basics"
79-
},
80-
"chapter": {
81-
"id": "1-chapter",
82-
"title": "The first chapter in part 1"
83-
},
8476
"Markdown": "Markdown for tutorial",
8577
"slug": "lesson-slug",
8678
"files": [
@@ -91,6 +83,14 @@
9183
"1-part-1-chapter-2-second-solution.json",
9284
[]
9385
],
86+
"part": {
87+
"id": "1-part",
88+
"title": "Basics"
89+
},
90+
"chapter": {
91+
"id": "1-chapter",
92+
"title": "The first chapter in part 1"
93+
},
9494
"prev": {
9595
"title": "Welcome to TutorialKit",
9696
"href": "/part-slug/chapter-slug/lesson-slug"
@@ -113,14 +113,6 @@
113113
"id": "3-third",
114114
"filepath": "1-part/1-chapter/3-third/content.md",
115115
"order": 2,
116-
"part": {
117-
"id": "1-part",
118-
"title": "Basics"
119-
},
120-
"chapter": {
121-
"id": "1-chapter",
122-
"title": "The first chapter in part 1"
123-
},
124116
"Markdown": "Markdown for tutorial",
125117
"slug": "lesson-slug",
126118
"files": [
@@ -131,6 +123,14 @@
131123
"1-part-1-chapter-3-third-solution.json",
132124
[]
133125
],
126+
"part": {
127+
"id": "1-part",
128+
"title": "Basics"
129+
},
130+
"chapter": {
131+
"id": "1-chapter",
132+
"title": "The first chapter in part 1"
133+
},
134134
"prev": {
135135
"title": "Welcome to TutorialKit",
136136
"href": "/part-slug/chapter-slug/lesson-slug"

packages/astro/src/default/utils/__snapshots__/single-part-multiple-chapters.json

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,6 @@
5757
"id": "1-first",
5858
"filepath": "1-part/1-chapter/1-first/content.md",
5959
"order": 0,
60-
"part": {
61-
"id": "1-part",
62-
"title": "Basics"
63-
},
64-
"chapter": {
65-
"id": "1-chapter",
66-
"title": "The first chapter in part 1"
67-
},
6860
"Markdown": "Markdown for tutorial",
6961
"slug": "lesson-slug",
7062
"files": [
@@ -75,6 +67,14 @@
7567
"1-part-1-chapter-1-first-solution.json",
7668
[]
7769
],
70+
"part": {
71+
"id": "1-part",
72+
"title": "Basics"
73+
},
74+
"chapter": {
75+
"id": "1-chapter",
76+
"title": "The first chapter in part 1"
77+
},
7878
"next": {
7979
"title": "Welcome to TutorialKit",
8080
"href": "/part-slug/chapter-slug/lesson-slug"
@@ -93,14 +93,6 @@
9393
"id": "1-second",
9494
"filepath": "1-part/2-chapter/1-second/content.md",
9595
"order": 0,
96-
"part": {
97-
"id": "1-part",
98-
"title": "Basics"
99-
},
100-
"chapter": {
101-
"id": "2-chapter",
102-
"title": "The first chapter in part 1"
103-
},
10496
"Markdown": "Markdown for tutorial",
10597
"slug": "lesson-slug",
10698
"files": [
@@ -111,6 +103,14 @@
111103
"1-part-2-chapter-1-second-solution.json",
112104
[]
113105
],
106+
"part": {
107+
"id": "1-part",
108+
"title": "Basics"
109+
},
110+
"chapter": {
111+
"id": "2-chapter",
112+
"title": "The first chapter in part 1"
113+
},
114114
"prev": {
115115
"title": "Welcome to TutorialKit",
116116
"href": "/part-slug/chapter-slug/lesson-slug"
@@ -133,14 +133,6 @@
133133
"id": "1-third",
134134
"filepath": "1-part/3-chapter/1-third/content.md",
135135
"order": 0,
136-
"part": {
137-
"id": "1-part",
138-
"title": "Basics"
139-
},
140-
"chapter": {
141-
"id": "3-chapter",
142-
"title": "The first chapter in part 1"
143-
},
144136
"Markdown": "Markdown for tutorial",
145137
"slug": "lesson-slug",
146138
"files": [
@@ -151,6 +143,14 @@
151143
"1-part-3-chapter-1-third-solution.json",
152144
[]
153145
],
146+
"part": {
147+
"id": "1-part",
148+
"title": "Basics"
149+
},
150+
"chapter": {
151+
"id": "3-chapter",
152+
"title": "The first chapter in part 1"
153+
},
154154
"prev": {
155155
"title": "Welcome to TutorialKit",
156156
"href": "/part-slug/chapter-slug/lesson-slug"

0 commit comments

Comments
 (0)