Skip to content

Conversation

tomsterBG
Copy link

A tiny tweak to make it more obvious what the if site.posts[0] is doing.

tomsterBG added 2 commits May 6, 2025 18:57
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.
@tomsterBG
Copy link
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.

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