Jekyll Kids Page Navigation

I am finishing the website redesign and just want to fill out the page of my portfolio. Instead of using messages for portfolio entries, I want to use subdirectories / child pages:

...
work
  project
     index.html
  project-2
    index.html
  index.html
...

I want to scroll through these subpages in the list to show on work/index.html. Something like:

<ul>
  {% for page in site.work.pages %}
    <li>
      <figure>
        <img src="/img/foo.jpg" alt="foo">
      </figure>
    </li>
  {% endfor %}
</ul>

How can I do that?

+4
source share
1 answer

Jekyll does not support it as easy as in your example, it goes to 2.0, however .

/ YAML , , . , , .

project/index.html ..

---
group: work
---

/index.html

<ul>
{% for node in site.pages %}
    {% if 'work' == node.group %}
    <li><a href="{{node.url}}">{{node.title}}</a></li>
    {% endif %}
{% endfor %}
</ul>

, group, if, URL-, .

+2

All Articles