Skip to content

docs: add docs for file imports #368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Oct 14, 2024
22 changes: 22 additions & 0 deletions docs/tutorialkit.dev/src/content/docs/guides/creating-content.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,25 @@ src/templates
│ # Overrides "index.js" from "shared-template"
└── index.js
```

## Importing files

You can import files from your code template, `_files` and `_solution` folder using the `file` or `solution` shortcode. This shortcode inserts the content of the specified file directly into your lesson content.

- `file` shortcode is used to reference files from the lesson `_files` or code template folder.
- `solution` shortcode is used to reference files from the lesson `_solution` folder.

For example, the following code will insert the content of the `box.css` file from the `_files` folder:

````md "file"
```file:/box.css
```
````

```css
.box {
width: 100px;
height: 100px;
background-color: red;
}
```