Skip to content
This repository has been archived by the owner on Jul 10, 2019. It is now read-only.

Hyperlinks not rendering correctly with liquid markup #7

Open
ghost opened this issue Jun 30, 2018 · 0 comments
Open

Hyperlinks not rendering correctly with liquid markup #7

ghost opened this issue Jun 30, 2018 · 0 comments

Comments

@ghost
Copy link

ghost commented Jun 30, 2018

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants