Skip to content

Commit 0e48eaf

Browse files
committed
fix: improve docs
1 parent 54cf28d commit 0e48eaf

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

docs/tutorialkit.dev/src/content/docs/guides/creating-content.mdx

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,37 @@ template: my-advanced-template
110110

111111
This declaration will make TutorialKit use the `src/templates/my-advanced-template` directory as the base for the lesson.
112112

113-
If you start having a lot of templates and they all share some code, you can create a shared template that they all extend. This way, you can keep the shared code in one place and avoid duplication. To do that, you need to specify the `extends` property in the template's `.tk-config.json` file:
113+
If you start having a lot of templates and they all share some files, you can create a shared template that they all extend. This way, you can keep the shared files in one place and avoid duplication. To do that, you need to specify the `extends` property in the template's `.tk-config.json` file:
114114

115115
```json
116116
{
117117
"extends": "../shared-template"
118118
}
119119
```
120+
121+
This will make the template inherit all files from the `shared-template` directory. You can then override any file in the template by placing a file with the same name in the template's directory.
122+
Here's an example of how you can structure your templates:
123+
124+
```
125+
src/templates
126+
├── shared-template
127+
│ ├── index.js
128+
│ ├── index.html
129+
│ └── package.json
130+
131+
└── first-template
132+
│ │ # Contains { "extends": "../shared-template" }
133+
│ │ # Inherits all files from "shared-template"
134+
│ ├── .tk-config.json
135+
│ │
136+
│ │ # Only available in first-template
137+
│ └── main.js
138+
139+
└── second-template
140+
│ # Contains { "extends": "../shared-template" }
141+
│ # Inherits all files from "shared-template"
142+
├── .tk-config.json
143+
144+
│ # Overrides "index.js" from "shared-template"
145+
└── index.js
146+
```

0 commit comments

Comments
 (0)