-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Hiding a post results in the incorrect post being hidden #504
Comments
👋 Hi @robgoyal, This issue is being automatically closed because it does not follow the issue template. Please DO NOT open another similar issue, try to edit the current issue according to the template, then it will be reopened automatically. |
Hi @robgoyal, Until I saw this issue, I didn't know that the Thanks for the bug report, very detailed and specific. If you plan to submit the above changes to a PR, I will merge it without hesitation. |
(cherry picked from commit 08a993b)
Checklist
master
branch.Describe the bug
Note: I read through the tutorials and all of the issues but there's no indication that this is the intended functionality.
By default, Jekyll's pagination filters out any posts that have the
hidden:true
in the YAML front matter.However, the logic in _layouts/home.html uses custom sorting to place pinned posts at the top and assign the remaining posts as default. Jekyll's paginate will filter out those posts resulting in an incorrect number of posts that the custom sorting functionality will have to go through. Refer to the screenshots below.
To Reproduce
Steps to reproduce the behavior:
hidden:true
to a post that is NOT at the end.Expected behavior
The post that was assigned with the
hidden:true
should be hidden.Screenshots
No Hidden Posts
Hiding One Post
Hiding the "Customize the Favicon" post hides the LAST post which is "Text and Typography".
Software
Ruby version: ruby 2.7.0p0
Gem version: 3.1.2
Bundler version: 2.3.5
Jekyll version: 4.2.1
Theme version: 5.0.2
Desktop
Smartphone
Additional context
Unsure if this is just an oversight or intentional, I have not created a PR. To solve this issue, the following line in _layouts/home.html needs to be changed from
{% assign default = site.posts | where_exp: "item", "item.pin != true" %}
to
{% assign default = site.posts | where_exp: "item", "item.pin != true and item.hidden != true" %}
The text was updated successfully, but these errors were encountered: