ruby - Using a Jekyll for loop in a different directory -
ruby - Using a Jekyll for loop in a different directory -
i building blog using jekyll, , planned utilize jekyll homepage. because of this, had created other non-changing html pages in respective directories, , work fine. however, i've been thinking making separate page list posts i've made far, , need reference "main" site's posts.
my project's construction looks following:
_includes/ footer.html header.html sidebar.html _layouts/ default.html posts.html _posts/ ... _site/ ... about/ index.html archive/ index.html css/ style.css resume/ index.html _config.yml index.html
i list posts i've made in archive/index.html page. attempted doing following:
... <h2>the archive.</h2> {% post in site.posts %} <h4><a href="{{ post.url }}">{{ post.title }}</a></h4> <p><small>{{ post.date | date: "%b %e, %y" }}</small></p> {% endfor %} ...
however, archive/index.html page renders above text.
i have tried creating exclusively new jekyll directory construction within archive directory, doesn't seem work either.
how can create archive/index.html page recognizes loop listing site's posts?
i've forked repo , archive/index.html
works :
--- layout: default --- <h2>the archive.</h2> {% post in site.posts %} <h4><a href="{{ post.url }}">{{ post.title }}</a></h4> <p><small>{{ post.date | date: "%b %e, %y" }}</small></p> {% endfor %}
ruby jekyll directory-structure
Comments
Post a Comment