I'm using Jekyll and have a custom folder called docs
with this structure:
The folder is organized as nested categories, but from what I understand from this pull request I can only have one extra level if I use collections_dir
like this:
collections:
js:
output: true
ruby:
output: true
collections_dir: docs
What I want is to be able to iterate through all the files under the docs
folder in order to create a search index for simple-jekyll-search.
I need to change site.pages
here for something that iterates on the docs
folder but I don't know how I can do that and if I can do it in a way in which I don't need to define a .yml
file listing all the files on the folder myself.
---
layout: null
---
[
{% for page in site.pages %}
{
{% if page.title != nil %}
"title" : "{{ page.title | escape }}",
"url" : "{{ site.baseurl }}{{ page.url }}",
"date" : "{{ page.date }}"
{% endif %}
} {% unless forloop.last %},{% endunless %}
{% endfor %}
]