Skip to content

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

@hbina

Description

@hbina

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions