-
Notifications
You must be signed in to change notification settings - Fork 292
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
Can't link to pagination pages #93
Comments
I ran into this myself and did some debugging. When I inspect the contents of the various page objects, it appears the pagination pages, including the first one that is the one the link points to, have a name value of |
Digging further, here's where things break: https://github.com/sverrirs/jekyll-paginate-v2/blob/master/lib/jekyll-paginate-v2/generator/paginationModel.rb#L266 It looks like jekyll-paginate-v2 generates new pages, and uses the value from the @sverrirs would it be possible to do something like set indexPageName differently so it doesn't clobber the object that Jekyll links to? |
Thanks for the info. I really appreciate it. From my config settings it gives the page a name of index.html by default which seems logical. It seems to me that the plugin is generating the pages at least. If I look at my files I can see a directory named "guides" which contains a file named" index.html" but I just can't get my head around why the Liquid link fails - the path is correct and the file exists. I'm not sure I understand why changing the default indexpage name would make any difference. My file is named "index.html". I could still be missing something here, though. |
The issue is that the
You can check this by removing the links (so the build will work), adding |
When I add the {{ site.pages | map: 'name' | inspect }} to my guides/index.html I see this: ["404.html", "about.md", "main.scss", "terms.md", "feed.xml", "index.html", "index.html", "index.html", "index.html", "index.html", "index.html"] and when I enabled: false, I get this (the same, but one "index.html" fewer) ["404.html", "about.md", "index.html", "main.scss", "terms.md", "feed.xml", "index.html", "index.html", "index.html", "index.html"] I don't seem to be getting any .html values in the list. Do you mean just the extension appears in the list with no name attached? |
Ah, hmm… do you have |
I just wanted to clarify that you were getting different results to me. I have |
👍 Hopefully this will be good debug data for someone closer to the problem to fix it. |
Hopefully, yes. Many thanks for your help. I think you've pointed me in the right direction. Those multiple |
To add some clarity, you can |
Brilliant. Thanks. I'll try that tomorrow. I feel like I'm getting somewhere now. |
I've come to same problem. What are your workarounds guys? @kitbeck @cameronmcefee |
I removed the |
I should have posted this earlier, but I've been a bit busy with other stuff lately. I've got several related projects on the go at the moment, but I should be staying on top of this. The way I got around it was to use regular html anchors with URLs instead of the link tag as @cameronmcefee did. This works fine. It didn't at first, but I realised that I was missing a leading slash on the href. However, when I click on any of the numbered page links I get a Can't Find Server error, even though the URL seems correct. It works fine if I click on the previous or next page links. It seemed to be working before, and I haven't had much time to look into why it isn't working anymore. I'm using the following for that:
After following Cameron's advice of using the following:
I could see that I was getting the correct URLs generated for each category like this: For my Guides category
and for my Mods category
So... it looks like it should be working... but it isn't. I think I've pretty much have decided to ditch this plugin. This seems like a bug but I cannot shake the feeling that I'm doing something wrong. The plugin seems to have been abandoned. I've looked at another plugin (I can't remember what it was called and can no longer find it), but that also seems to have its problems also. I'm wondering how feasible it is just to do the pagination manually. I'm going to try and get back on to fixing the problem next week. |
@ibrado I still have |
@mkpankov Hmmm. Could you please doublecheck the config? There might be something causing the tag to be inserted in the URL twice. I'd like to work on this as it seems related to my other patches. I would appreciate it if someone could setup a test repo (perhaps based on one of the examples) that clearly shows this problem... |
@mkpankov @ibrado I also had the problem of duplicates in the path, but this was when using html urls instead of link. This was because of a missing leading slash. Every time I clicked on the link it would add to the path like this:
and so on. The link works fine with the leading slash.
@ibrado I'll create a repo for my site later on this week if that's any use to you for testing. |
@ibrado @mkpankov @cameronmcefee I'll be creating a repo for testing soon, but I have a question. What is the correct usage of the link tag? Assuming I have links in list items:
or simply
I've been using the former, but the latter seems more correct after looking at the docs again. I thought I'd cracked it and had been using the link tag incorrectly, but this gives the same error. |
Setup
I've installed and set up the plugin but it doesn't seem to be working correctly. I have the following:
The '_layouts/category.html' then uses '_layouts/default.html' as follows
The Problem
If I browse directly to the URL localhost:4000/guides/index.html the pagination works and page is displayed.
If I add a link in my
_includes/header.html
to this page like so:{% link guides/index.html %}
I get the following error:
I've tried simply using
<a href="guides/index.html">Guides</a></li>
and this works, but every time I click on the link I get an extra guides/ added to the path, for example:
guides/guides/guides/guides/index.html
Link has been clicked three times.
I've been trying to get this working myself and I just can't understand what's happening here; everything looks ok to me, and seems analogous with the examples. Not sure if I'm doing something wrong or if this is a bug.
Any help would be greatly appreciated.
The text was updated successfully, but these errors were encountered: