Skip to content
This repository was archived by the owner on Jul 27, 2025. It is now read-only.
This repository was archived by the owner on Jul 27, 2025. It is now read-only.

Hyperlinks not rendering correctly with liquid markup #7

@ghost

Description

The liquid markup inside the anchor tag's href is generating a weird output. I am using jekyll-pagination plugin.

Here's the code:

li
    a href="{{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}" {{ page }}

This should throw output as /page2, /page3 for my links. However what I am getting is, /2/2p2a2g2e2:2n2u2m2, 3/3p3a3g3e3:3n3u3m3, etc. But if I write the markup {{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }} outside the href attribute, it renders correctly as page2 and so on.

I searched a lot but don't seem to understand why the output is changing with href attribute with slim. This works absolutely fine with html file (before I converted to slim).

I am using olery/jekyll-slim fork of the gem.

I just started working on jekyll so please let me know if there's anything I am missing?

Currently, my workaround is to use capture and save the link in the variable to render it inside the href attribute - that works perfectly fine.

| {% capture link %} 
  {{ site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page }}
| {% endcapture %}
a href="{{ link }}" {{ page }}

Thanks

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