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

zola serve with --output-dir stopped serving assets in v0.18.0 #2423

Closed
radekmie opened this issue Jan 25, 2024 · 7 comments
Closed

zola serve with --output-dir stopped serving assets in v0.18.0 #2423

radekmie opened this issue Jan 25, 2024 · 7 comments
Labels
bug done in pr Already done in a PR

Comments

@radekmie
Copy link

Bug Report

Environment

Zola version: v0.18.0

Expected Behavior

zola serve --output-dir docs should render the page normally, just like zola serve (i.e., with no custom --output-dir). That's how it worked in 0.17.2.

Current Behavior

The HTML is served correctly, but all assets - including CSS and image files - result in 404.

Step to reproduce

  1. Run zola serve. The website looks normal.
  2. Run zola serve --output-dir docs. The website looks broken, as the CSS is not there.
@Keats Keats added the bug label Jan 25, 2024
@wold5
Copy link
Contributor

wold5 commented Feb 17, 2024

Can confirm this, with 0.18 for Windows. The files are actually present in the output directory, but not loaded.

Ignore the latter re Linux: I accidentally used 0.17 (system installed). This might be another issue, TBC.

@pietroalbini
Copy link

This is fixed by #2398, it would be nice to have a patch release with the fix.

@Keats
Copy link
Collaborator

Keats commented Feb 18, 2024

There's probably going to be a new release anyway since pulldown_cmark was updated

@Keats Keats added the done in pr Already done in a PR label Feb 18, 2024
@maghoff
Copy link
Contributor

maghoff commented Feb 19, 2024

A workaround for this problem is to give the absolute path of the output directory on the command line, ie instead of --output-dir docs, --output-dir /full/path/to/docs.

@wold5
Copy link
Contributor

wold5 commented Feb 21, 2024

A workaround for this problem is to give the absolute path of the output directory on the command line, ie instead of --output-dir docs, --output-dir /full/path/to/docs.

This didn't solve it on Windows - and I always use the full path to a ramdisk.

Current next with #2398 fails to run for me on Windows, further comments will follow in that thread.

My earlier comment re Linux can be ignored BTW. I usually write on Windows and compile on Linux. I forget --drafts... after a long day, when converting shortcodes to macros turned up all kinds of issues to do with scope overlap, etc, etc. (since solved) ;)

@maghoff
Copy link
Contributor

maghoff commented Feb 22, 2024

@wold5 You'd need to format the path exactly like fs::canonicalize does. I think you'd get paths that start with \\?\ in that syntax. But I'm no Windows guru. If you need the workaround, the simplest way is probably to write a test program just to canonicalize the path correctly :)

@Keats
Copy link
Collaborator

Keats commented Feb 22, 2024

Would https://crates.io/crates/normpath solve the issue?

@Keats Keats closed this as completed Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug done in pr Already done in a PR
Projects
None yet
Development

No branches or pull requests

5 participants