Skip to content
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

Set page dir so link tag works with pagination pages #226

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

viv-li
Copy link

@viv-li viv-li commented Oct 15, 2021

Hi there, I've not opened a new issue for this because it's essentially the same as the closed issue #104 - let me know if you'd like me to create a new issue for this PR.

To recap #104, currently the link tag doesn't work for paginated pages that aren't in the root directory. This is because when the paginated page is copied, page.dir isn't set. Then page.relative_path (which is what the link tag looks for) is in turn set by joining dir and name.

In this PR, I'm setting @dir in the set_url method after @url is set because I'm using the inherited dir method from the Jekyll Page class which uses the url to get dir.

I'm aware that this change means the set_url method doesn't just set the url. There are a few options:

  1. rename the method to something like set_url_dir
  2. create a new PaginationPage method called set_dir to be called after set_url is called in paginationModel.rb, or
  3. leave it as is if you think this is reasonable.

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

Successfully merging this pull request may close these issues.

1 participant