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 server -i a.b.c.d creates broken links #2233

Open
fadedbee opened this issue Jun 22, 2023 · 2 comments
Open

zola server -i a.b.c.d creates broken links #2233

fadedbee opened this issue Jun 22, 2023 · 2 comments

Comments

@fadedbee
Copy link

Bug Report

Environment

Zola version: 0.17.2

Expected Behavior

When using zola serve -i a.b.c.d (where a.b.c.d is the server's public IP) pages should have links which do not include the server IP, like href="/blog", or at worst, href="http://a.b.c.d/blog.

Current Behavior

instead, I see: href="http://127.0.0.1/blog which is a broken link when I access the URL from a different computer. (Which is the point of using the -i switch.)

fadedbee@box ~ $ curl http://a.b.c.d:1111/
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <title>MyBlog</title>
</head>

<body>
  <section class="section">
    <div class="container">
      
<h1 class="title">
  This is my blog made with Zola.
</h1>
<p>Click <a href="http://127.0.0.1:1111/blog/">here</a> to see my posts.</p>

    </div>
  </section>
<script src="/livereload.js?port=1024&amp;mindelay=10"></script></body>

</html>

Step to reproduce

Run zola serve -i a.b.c.d and look at the broken link(s) which are generated, pointing at 127.0.0.1, despite -i.

@Keats
Copy link
Collaborator

Keats commented Jun 23, 2023

The whole -o/-i needs some rethinking, #2170 is related.

@blueglyph
Copy link

@lorenzleutgeb was fixing it, I think, maybe ask him.

I had quickly looked at the code, and saw that the path — here, '/blog' — wasn't removed, but the port was added after, which was strange (cfr. my last post in the other issue). Maybe it's stripped later, but I haven't investigated that far.

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

3 participants