From 95f94994a09063f1e27bab4779e20dbb8765392e Mon Sep 17 00:00:00 2001 From: Cameron Martin Date: Mon, 16 Sep 2024 15:11:08 -0700 Subject: [PATCH 1/3] Add `embedded` filesystem declaration to `--embed` example Also mention the filesystem explicitly in the preceding sentence --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d6cf0ef..59d0835 100644 --- a/README.md +++ b/README.md @@ -116,11 +116,15 @@ This allows you to hack on Caddy core (and optionally plug in extra modules at t --- -You may embed directories into the Caddy executable: +You may embed directories into the Caddy executable and serve them from the `embedded` filesystem: ``` $ xcaddy build --embed foo:./sites/foo --embed bar:./sites/bar $ cat Caddyfile +{ + filesystem embedded embedded +} + foo.localhost { root * /foo file_server { From b4bdc6b25914d2b959f212c715c30a56a667c70d Mon Sep 17 00:00:00 2001 From: Cameron Martin Date: Fri, 20 Sep 2024 11:49:36 -0700 Subject: [PATCH 2/3] Revise to avoid stutter in fs name and module name --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 59d0835..b8271d4 100644 --- a/README.md +++ b/README.md @@ -116,26 +116,26 @@ This allows you to hack on Caddy core (and optionally plug in extra modules at t --- -You may embed directories into the Caddy executable and serve them from the `embedded` filesystem: +You may embed directories into the Caddy executable and serve them from the `embedded` filesystem module: ``` $ xcaddy build --embed foo:./sites/foo --embed bar:./sites/bar $ cat Caddyfile { - filesystem embedded embedded + filesystem my_embeds embedded } foo.localhost { root * /foo file_server { - fs embedded + fs my_embeds } } bar.localhost { root * /bar file_server { - fs embedded + fs my_embeds } } ``` From 3342e4824a5490f112e04abd1a096b4e33666620 Mon Sep 17 00:00:00 2001 From: Cameron Martin Date: Fri, 20 Sep 2024 14:22:37 -0700 Subject: [PATCH 3/3] Add an explanatory comment to example Caddyfile as well --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index b8271d4..de07a2c 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,9 @@ You may embed directories into the Caddy executable and serve them from the `emb $ xcaddy build --embed foo:./sites/foo --embed bar:./sites/bar $ cat Caddyfile { + # You must declare a custom filesystem using the `embedded` module. + # The first argument to `filesystem` is an arbitrary identifier + # that will also be passed to `fs` directives. filesystem my_embeds embedded }