feat(astro): support lessons without parts or chapters
- Closes https://github.com/stackblitz/tutorialkit/issues/304
🚧 WIP
Adds support for defining lessons without chapters or parts.
src/content/tutorial
│
├── meta.md # Tutorial metadata
│
└── lesson-1 # Lesson in root! No part or chapter.
├── content.md
├── _files
└── _solution
src/content/tutorial
│
├── meta.md # Tutorial metadata
│
└── part-1
└── lesson-1 # Lesson in part! No chapter.
├── content.md
├── _files
└── _solution
Custom order can be defined using lessons in metadata:
---
type: 'tutorial'
lessons: ['lesson-one', 'lesson-two']
---
---
type: 'part'
lessons: ['lesson-one', 'lesson-two']
---
Mixing structures is not supported and an error is thrown when these are not followed:
- A tutorial can have one-or-many
part's or one-or-manylesson's - A part can have one-or-many
chapter's or one-or-manylesson's
However you can have multiple part's, where some contain just chapter's and some contain just lesson's.
Run & review this pull request in StackBlitz Codeflow.
/pkg-pr-new
/pkg-pr-new
/pkg-pr-new
⚡️ Your npm packages are published. @tutorialkit/astro: npm i https://pkg.pr.new/@tutorialkit/astro@b57a764 @tutorialkit/runtime: npm i https://pkg.pr.new/@tutorialkit/runtime@b57a764 @tutorialkit/react: npm i https://pkg.pr.new/@tutorialkit/react@b57a764 @tutorialkit/theme: npm i https://pkg.pr.new/@tutorialkit/theme@b57a764 @tutorialkit/types: npm i https://pkg.pr.new/@tutorialkit/types@b57a764
/pkg-pr-new
⚡️ Your npm packages are published. @tutorialkit/astro: npm i https://pkg.pr.new/@tutorialkit/astro@431145a @tutorialkit/react: npm i https://pkg.pr.new/@tutorialkit/react@431145a @tutorialkit/runtime: npm i https://pkg.pr.new/@tutorialkit/runtime@431145a @tutorialkit/theme: npm i https://pkg.pr.new/@tutorialkit/theme@431145a @tutorialkit/types: npm i https://pkg.pr.new/@tutorialkit/types@431145a
Thanks for review @Nemikolh, let's get this merged! 💯