Skip to main content

Import File

Rise4fun automatically add support for importing patial markdown files.

Some content.

{@import ./hello.mdp}

More content.

The file path is relative to the current file location.

http://localhost:3000

Some content.

This is an imported markdown file​

note

Hello, this text is located in hello.mdp.

This heading was imported​

More content.

Optional imports​

By default, the importer throws if the file is not found. You can make the file import optinal by using optional

This file below should be imported if present.

{@import optional ./missing.mdp}

More content.
http://localhost:3000

This file below should be imported if present.

More content.

Hiding partial files​

By default, all markdown files will end up in the sidebar and generated as pages. To avoid this, you can use a different file extension, like .mdp. To get tooling support in VS code, add a file association entry in the settings and install the MDX extension.

.vscode/settings.json
{
"files.associations": {
"*.mdp": "mdx"
}
}