docs: Import arguments (#162)

* Added documentation for snippet arguments

Added documentation, the only resource available for this feature, a post on the forum and the PR : https://github.com/caddyserver/caddy/pull/3423

* Update src/docs/markdown/caddyfile/concepts.md

Co-authored-by: Matt Holt <mholt@users.noreply.github.com>

* Update src/docs/markdown/caddyfile/concepts.md

Co-authored-by: Matt Holt <mholt@users.noreply.github.com>

* Change for more generic example

Co-authored-by: Matt Holt <mholt@users.noreply.github.com>

Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
This commit is contained in:
Arthur T 2021-05-11 23:58:38 +02:00 committed by GitHub
parent a1bc26c553
commit 25742214dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -276,6 +276,21 @@ import redirect
The [`import`](/docs/caddyfile/directives/import) directive can also be used to include other files in its place. As a special case, it can appear almost anywhere within the Caddyfile. The [`import`](/docs/caddyfile/directives/import) directive can also be used to include other files in its place. As a special case, it can appear almost anywhere within the Caddyfile.
You can pass arguments to imported configuration and use them like so:
```caddy
(snippet) {
respond "Yahaha! You found {args.0}!"
}
a.example.com {
import snippet "Example A"
}
b.example.com {
import snippet "Example B"
}
```
## Comments ## Comments