Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Expand + clarify --embed docs, esp. for usage without alias #206

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

camhux
Copy link
Contributor

@camhux camhux commented Sep 23, 2024

Another small docs PR for --embed flag usage 🎏

My main goal here was to add documentation for the way --embed behaves without an alias for the source directory, which writes the contents of the source directory into the root* of the embedded FS without any containing subdirectory. This behavior, while perfectly ergonomic for making a file server, had confused me briefly as a new user (see #202).

Since the --embed examples in the README have been expanded + annotated, I removed the inline example from the command usage text in the source code. I think using this space for text that documents the unaliased behavior is worth it, but I'm happy to re-add the inline example if preferred.

*yes, technically into the /files intermediate dir, but this is the root from the user's perspective

* Add documentation of unaliased embed behavior
* Add example for unaliased/merged embedded directories
Copy link
Member

@mohammed90 mohammed90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the edits! Thank you for working on this 👍🏼

Ignore the linter. It's tripping.

@mohammed90 mohammed90 merged commit fe02490 into caddyserver:master Sep 23, 2024
7 of 8 checks passed
Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! I got review-sniped I guess :) I wish GitHub had a way of actually collaborating easier. But anyway, my only main feedback is not a showstopper in this case. Just a random thought.


```
$ xcaddy build --embed foo:./sites/foo --embed bar:./sites/bar
```sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is actually what we want, given that most of the content is not shell commands, but rather some output (that happens to be a Caddyfile). Unless the highlighter is smart enough to parse the difference? (Same below)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I totally agree and had actually meant to remove this before submitting, but just noticed that my push to my fork timed out and I didn't notice before I hit the button 😭 I'll send a followup in a second

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants