Skip to content

Commit eed8210

Browse files
committed
docs: update
1 parent d0ca761 commit eed8210

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

docs/versions/v3/language-elements/directives.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,14 @@ Example:
104104
@use("layouts/main")
105105
```
106106

107-
:::info @use Path Alias
107+
:::tip @use Path Alias
108108
If your layouts are located in the `layouts` directory, you can use the `~` alias to reference them. For example, `@use("~main")` instead of `@use("layouts/main")`. Behind the scenes, the `~` alias will be replaced with `layouts/`.
109109
:::
110110

111111
The `@use` directive accepts a string literal as its argument. This string literal should specify the path to the layout file relative to the [`TemplateDir`](/v3/guides/configurations#setting-configurations) parameter defined in the configuration. For example, if [`TemplateDir`](/v3/guides/configurations#setting-configurations) is set to `"src/templates"` and you have `layouts` directory in there, you can use the layout directive like `@use("layouts/main")`, and it will look for the layout file at `"src/templates/layouts/main.tw"`.
112112

113-
:::info Understanding the @use Directive
114-
When you use the `@use` directive, only the content inside [`@insert`](#insert) directives will be rendered; the rest of the file's content will be ignored. This is because the `@use` directive applies a layout file instead of rendering the current file directly. During this process, all placeholders reserved in the layout file are populated with the content specified within your [`@insert`](#insert) directives.
113+
:::tip Understanding the @use Directive
114+
When you use the `@use` directive, only the content inside [`@insert`](#insert) directives will be rendered; the rest of the file's content will be ignored. This is because the `@use` takes the layout file as a base instead of rendering the current file directly. During this process, all placeholders reserved in the layout file are populated with the content specified within your inserts.
115115
:::
116116

117117
### Important Notes

0 commit comments

Comments
 (0)