liquid - Loop trough files in _posts subfolder - Jekyll -


i using prose.io cms github. in have set root directory /_posts. in /_posts have made folder "staticpages", contains markdown files text. can loop trough these files? can't seem figur out how.

so file tree looks like:

root | _posts/ | staticpages/ | myfile.md

and want to:

{% pages in posts.staticpages %} {{ page.title }} {% endfor %} 

here go:
in _config.yml specify

defaults:   - scope:       path: "_posts/staticpages"     values:       static: "true" 

and in layout file (or page) filter posts , loop with:

{% assign posts = site.posts | where:"static", "true" %} {% post in posts %}... 

this works me...


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -