Open
Conversation
A tiny tweak to make it more obvious what the if site.posts[0] is doing.
Refactored the code so it's easier to filter posts. It was necessary to eliminate post.next because apparently it doesn't work when you filter a table. In lua we have deepcopy, in liquidjs... idk, but this is my solution. Also when there are no posts it prints "No posts to display" which is very useful if you have a hidden system like the one i decided to add. The filtered_posts variable comes preconfigured for every post that doesn't have the hidden = true variable in its frontmatter, for more info on this you can check out the main branch of my fork to see how the whole hidden thing works. I just want to make future forks more easily capable of adding this modification.
Author
|
I added a hidden posts feature on my blog and decided to help everyone in the future to have it easier by refactoring the code. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A tiny tweak to make it more obvious what the if site.posts[0] is doing.