Updated Writing a Plugin: Directives (markdown)

Matt Holt 2017-05-04 11:26:38 -06:00
parent 749b2e27cd
commit aad4a813bf

@ -83,13 +83,13 @@ Each server type has a list of strings where each item is the name of a directiv
## 4. Plug in your Plugin
Finally, don't forget to import your plugin's package! Caddy must import your plugin to register and execute it. This is usually done within [run.go](https://github.com/mholt/caddy/blob/master/caddy/caddymain/run.go):
Finally, don't forget to import your plugin's package! Caddy must import your plugin to register and execute it. This is usually done within [run.go](https://github.com/mholt/caddy/blob/master/caddy/caddymain/run.go) at the end of the `import` section:
```go
import _ "your/plugin/package/here"
_ "your/plugin/package/here"
```
*Please Note:* The `_` after import is required.
*Please Note:* The `_` before the package name is required.
That's it! Build caddy with your plugin, then write a Caddyfile with your new directive to see it in action.