-
Notifications
You must be signed in to change notification settings - Fork 996
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
--base-url ignored by serve #2170
Comments
While Besides, it opens the browser at |
zola serve strips anything other than the ip/url |
I suppose you mean it strips everything after the IP. |
I got an issue when cloning the repo (see below), but I can build and reproduce the problems. If that helps, I can try to fix them, but what should be the expected behaviour? -O flagAs a user, I'd expect:
Complete URLThe URL given with
PS: Submodule issue when cloning the repo. I've tried 3 times at different times and always get the same error. This is strange since this revision exists in that repo... |
I am trying to use Zola within Gitpod. The Gitpod instance is associated a domain name, and is exposed to the internet (if I chose to configure it this way). To get Zola is particularly stubborn about the base URL. The parameter that you call "base URL" is not really treated as an URL, but only a hostname which is then prefixed with a fixed protocol scheme ( I consider the parameter "base URL" to be confusing. It does not take a URL, and it will be modified in ways that are not intuitive, i.e. |
Honestly I would need to re-read the code to see how @blueglyph you don't need to pull the submodules to work on Zola, we keep the theme/syntaxes binary outputs in the repo. You only need to pull them if you are adding a syntax or a theme. |
@Keats I may give it a try, I don't think users use the test server and expect it to open at I prefer to ask first because I would hate to do that for nothing. I've had that problem before, and it's not fun. 😅 |
Have a look at how other SSG handle that, if they all do the same thing we can match it. |
@Keats, I have thought a bit about a backward compatible solution that would allow users to fully customize the base URL. Check https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=f19b3126a567464a7e5903214a341cdb and tell me if you would like me to PR. |
@lorenzleutgeb I'm a little surprised to see that you decided to take over the fix without even warning me, only posting about it 4 days later. That's not how we do things, and I specifically said how it could be frustrating to work on a patch in vain. Seeing you're so keen, I'll stop there; fortunately I haven't spent too much time on it yet. But next time please don't ignore the OP's posts and communicate to avoid that sort of situation. |
@blueglyph Sorry to have attempted to hijack the issue you posted here. The code I posted only addresses what I mentioned in #2170 (comment) . I'll file a new one, so that it can be discussed (or ignored) independently. |
It's not at all what I wrote. I don't think you're hijacking the issue since it seems to be the same one. |
@blueglyph I would be interested to see what you had in mind |
@Keats What I described a few posts above. The code isn't very clear to navigate through, but I saw something strange. Apparently the path isn't stripped from the URL, but the port is added after, based on a test performed on the configuration URL, which seems like a bug to me. So perhaps it's just the matter of fixing the test and formatting the URL properly, when the Then I suppose the correct URL should be used when launching the browser instead of using the |
@blueglyph @Keats As there hasn't been any activity on this issue in some time and I don't see any related PRs, would it be alright if I worked on a patch for this? |
I'm not working on it anymore, since someone else apparently decided to do it. There was no news though, so maybe he stopped too. So I think it's fine, and even welcome! :) |
I have taken a stab at it in #2311. Marked as a draft PR for now as I'm going to test on a few different setups, just wanted to get the code out in the open early. |
I have tested this with @lorenzleutgeb's issue (remote development server with https) and it works wonderfully (also solving my particular use case), but it doesn't yet address @blueglyph's arbitrary path issue. I am correctly parsing the base url I believe, but I still get 404s at |
@blueglyph I think I have this working on arbitrary paths now! Give #2311 a try. |
#2311 is fixing the path suffix it seems. ( However, I have a similar case as @lorenzleutgeb (using tailscale funnel to preview a site collaboratively), and the patch is not helping with |
@dijit Are you certain? This works for me over tailscale funnel: |
@dijit Actually, I may have introduced a regression when I did the path bit. Looking into this. |
Bug Report
The option
-u
or--base-url
is not taken into account with theserve
command.Environment
Zola version: 0.17.2
Expected Behavior
With the command
zola serve -u 127.0.0.1/test/ -O
, I was expecting the server to open this URL and to make the site available at this URL.Current Behavior
http://127.0.0.1:1111/
http://127.0.0.1:1111/test/
leads to a 404 answer from the server.Step to reproduce
Type the following command:
zola serve -u 127.0.0.1/test/ -O
The output is:
The browser opens this page:
http://127.0.0.1:1111/
Other information
My config.toml file specifies a base URL on github.io. When I publish the website, it mostly works there except a few dangling URLs that I need to debug.
Used with the default options, e.g.
zola serve -O
, it works fine too. It just makes it difficult to check those dangling links with a more realistic URL that includes a path after the IP.The text was updated successfully, but these errors were encountered: