Hi everyone, I’m new to the Jekyll forum so please let me know if I’ve done something incorrectly with formatting/structure of my post : )
I’m getting started with my blog and have been working on setting up a top navigation bar for the site. I learnt how to use Liquid to iterate over the pages and posts on my site, and this works great for finding every page I would like to list! However, I’m finding that I also end up with links to things I don’t want to count, like the feed.xml file created for setting up the rss feed and a css file on my site.
Below is my code which is finding the pages:
I’ve been trying to find information on this elsewhere on the forum and I think this is happening because Jekyll treats these files as having empty frontmatter, so they are given the ‘post’ type. Is there a way I can prevent this from happening?
I would like a solution that doesn’t involve fiddling with my project heirarchy if possible, the .xml is created when building the site so I think having it be visible to Liquid code is expected behaviour. Rewriting my css file in sass would probably hide this particular file, but I can imagine running into this issue with future files and would like to be able to handle it then. If it’s just poor practice to iterate over pages/posts that would be an acceptable answer too.