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

Render/preview a single file? #61

Open
erossi opened this issue Mar 21, 2023 · 1 comment
Open

Render/preview a single file? #61

erossi opened this issue Mar 21, 2023 · 1 comment

Comments

@erossi
Copy link

erossi commented Mar 21, 2023

Does it make sense for ssite to be able to preview a single file?

Currently:

ssite show ~/doc/file.md
[...]
NotADirectoryError: [Errno 20] Not a directory: 9

Thanks
E.

@spanezz
Copy link
Owner

spanezz commented Sep 4, 2023

It's tricky to determine the document root for the file: in the case of ssite show ~/doc/file.md, should it display file.html in the site contained in doc/, or doc/file.html in the site contained in /home/erossi, or similar for each combination of parents?

In theory if a user points to file.md I could go up until I see a .git and use that as the root, and if I don't find any I could use the directory that directly contains file.md. Would that be reasonable?

The only risk that I see is that staticsite might end up serving more than needed if file.md is not in a git repo, and there's a git repo in a parent directory. However show/serve by default serve only from localhost, so this is something that may unexpectedly disclose files to local users only.

Would that sound like a reasonable tradeoff?

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

No branches or pull requests

2 participants