formatting

This commit is contained in:
a 2024-07-25 15:54:47 -05:00
parent 32f48b51ec
commit c6297a2c23
No known key found for this signature in database
GPG key ID: 374BC539FE795AF0

View file

@ -4,17 +4,15 @@ title: "Placeholder Support"
# Placeholders # Placeholders
In Caddy, placeholders are a feature of the individual plugins, that is, they are not parsed at config time, but instead preserved, and replaced at runtime. In Caddy, placeholders are a feature of the individual plugins. They are not parsed at config time, but instead preserved, and replaced at runtime.
This means that if you wish for your plugin to support placeholders, you must explicitly add support for it. This means that if you wish for your plugin to support placeholders, you must explicitly add support for it.
## Placeholder Parsing Rules & Gotchas ## Placeholder Parsing Rules & Gotchas
Support for any placeholders which do not start with a dollar sign (e.g. `{env.HOST}`) must be handled by the individual plugin, and will not be handled by the Caddyfile parser. If you wish to use placeholders in your Caddy plugin, you must accept placeholders strings, informat `{foo}` as valid configuration values, and parse them at runtime
If you wish to use placeholders in your Caddy plugin, you must accept such placeholders as valid configuration values, and parse them at runtime However, Placeholders-like strings which do start with a dollar sign (`{$foo}`), are evaulated at Caddyfile parse time, and do not need to be dealt with by your plugin. These are technically not placeholders, but config-time env-var substitution, they just happen to share the `{}` syntax.
Placeholders which do start with a dollar sign (`{$HOST}`), are evaulated at Caddyfile parse time, and do not need to be dealt with by your plugin. These are technically not placeholders, but config-time env var substitution, they just happen to share the `{}` syntax. our
It is therefore important to understand that `{env.HOST}` is inherently different from something like `{$HOST}` It is therefore important to understand that `{env.HOST}` is inherently different from something like `{$HOST}`