asciidoctor / jekyll-asciidoc-quickstart

A template project for creating AsciiDoc-based websites using Jekyll.
https://asciidoctor.github.io/jekyll-asciidoc-quickstart/
MIT License
119 stars 159 forks source link

Sites that don't have '/' as a baseurl don't have working post links in the sidebar. #32

Closed bitskri3g closed 1 year ago

bitskri3g commented 3 years ago

If your baseurl is anything except '/' (the default) the current code in default.html won't work:

        <h4>Posts</h4>
        <ul id="posts" class="posts nav">
            {% for post in site.posts limit: 5 %}
            <li><a href="{{ post.url }}">{{ post.navtitle }}</a></li>
            {% endfor %}
        </ul>

This used to be dealt with by using .{{ post.url }}, but that was removed because it double-prepended when you were browsing on a post. I think the correct fix is this:

<li><a href="{{ post.url | prepend:site.baseurl }}">{{ post.navtitle }}</a></li>

It appears to resolve both the old issue and the current one.