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

page.permalink doubles the base_url because the generated href is relative link #1524

Closed
hbina opened this issue Jun 10, 2021 · 2 comments
Closed

Comments

@hbina
Copy link

hbina commented Jun 10, 2021

Bug Report

AFAIK, I am just following the structure provided in the tutorial.
I have something like this:

{% extends "base.html" %} {% block content %}
<h1 class="title">{{ section.title }}</h1>
<p>Click <a href="althttpd.c">here</a> to see the source code</p>
<h2>Chapters</h2>
<ul>
  {% for page in section.pages | reverse %}
  <li><a href="{{ page.permalink }}">{{ page.title }}</a></li>
  {% endfor %}
</ul>
{% endblock content %}

But the generated HTML looks like this:

<ul>
  <li><a href="hbina.github.io/althttpd/2/">Escape</a></li>
  <li><a href="hbina.github.io/althttpd/3/">tvms</a></li>
  <li><a href="hbina.github.io/althttpd/1/">Introduction</a></li>
</ul>

Which causes it to point to hbina.github.io/hbina.github.io/<link>

Environment

Github Pages but locally it works fine.

Zola version:

hbina.github.io on  master [$] 
❯ zola --version
zola 0.13.0

Expected Behavior

Tell us what should have happened.

It should generate absolute paths.

Current Behavior

Tell us what happens instead of the expected behavior. If you are seeing an
error, please include the full error message and stack trace. You can get the
stacktrace of a panic by adding RUST_BACKTRACE=1 when running a zola command.

Step to reproduce

Please provide the steps to reproduce the issue.
If the issue is hard to reproduce, please provide a sample repository or sample
that triggers the bug.

Try to publish this repo at this commit https://github.com/hbina/hbina.github.io/tree/bdef05f33316a5edcbdfcf4652b6745cae724909

@Keats
Copy link
Collaborator

Keats commented Jun 10, 2021

The links are based on whatever is set in https://github.com/hbina/hbina.github.io/blob/bdef05f33316a5edcbdfcf4652b6745cae724909/config.toml#L2
It should be prefixed with http/https and we should probably have a warning/error about that.

hbina added a commit to hbina/hbina.github.io that referenced this issue Jun 10, 2021
See: getzola/zola#1524 (comment)

Signed-off-by: Hanif Bin Ariffin <[email protected]>
@hbina
Copy link
Author

hbina commented Jun 10, 2021

It works now. Thanks!

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