I have my Jekyll folder structure as
_includes
_layouts
_post
myFolder
subMyFolder
- readme.md
subMyFolder2
- README.md
subMyFolder/subSub
- readme.md
- something.html
index.html
I wish to list all subMyFolders (just first level) without subSub folders and without files inside
My approach
{% for my_page in site.pages %}
{% if my_page.url contains 'myFolder' %}
{% if my_page.title %}
<a class="page-link" href="{{ my_page.url | prepend: site.baseurl }}">{{ my_page.title }}</a> •
{% endif %}
{% endif %}
{% endfor %}
get the job partially don however when a subFolder has multiple items inside (page1.html, page2.html etc) its repeated on the list as well as my _config.yml has
include:
- subFolder
exclude:
- README.md
but still, I get subFolder/README.html despite the fact i've excluded it..
I need only the folders hierarchy of myFolders