caddyfile: snippet block input documentation (#400)

* initial

* Update Caddyfile

* tabs

* add note to other page
This commit is contained in:
a 2024-06-19 16:07:03 -05:00 committed by Francis Lavoie
parent 6e893573fe
commit 5845a0fad1
No known key found for this signature in database
GPG key ID: 52BC55A211F19186
2 changed files with 74 additions and 1 deletions

View file

@ -414,6 +414,29 @@ b.example.com {
}
```
⚠️ <i>Experimental</i> <span style='white-space: pre;'> | </span> <span>v2.9.x+</span>
You can also pass an optional block to an imported snippet, and use them as follows.
```caddy
(snippet) {
{block}
respond "OK"
}
a.example.com {
import snippet {
header +foo bar
}
}
b.example.com {
import snippet {
header +bar foo
}
}
```
**[Read the `import` directive page](/docs/caddyfile/directives/import) to learn more.**