Jekyll Filename Without Date

Don’t use posts; posts are things with dates. Sounds like you probably want to use collections instead; you get all the power of Posts; but without the pesky date / naming requirements. https://jekyllrb.com/docs/collections/ I use collections for almost everything that isn’t a post. This is how my own site is configured to use collections for … Read more

Jekyll for loop over all images in a folder?

This worked like a charm for me. No plugins required. My images are in a assets/images/slider directory. {% for image in site.static_files %} {% if image.path contains ‘images/slider’ %} <img src=”https://stackoverflow.com/questions/17677094/{{ site.baseurl }}{{ image.path }}” alt=”image” /> {% endif %} {% endfor %} The image.path contains ‘images/slider’ makes sure that only images in that folder … Read more

Liquid templates: even/odd items in for loop

I think you’ll want to use the cycle tag for this. For example: {% for post in site.categories.articles %} <article class=”{% cycle ‘odd’, ‘even’ %}”></article> {% endfor %} If you want different HTML markup for each cycle: {% for item in site.posts %} {% capture thecycle %}{% cycle ‘odd’, ‘even’ %}{% endcapture %} {% if … Read more

Jekyll/Liquid Templating: How to group blog posts by year?

It can be done with much, much less Liquid code than in the existing answers: {% for post in site.posts %} {% assign currentdate = post.date | date: “%Y” %} {% if currentdate != date %} <li id=”y{{currentdate}}”>{{ currentdate }}</li> {% assign date = currentdate %} {% endif %} <li><a href=”https://stackoverflow.com/questions/19086284/{{ post.url }}”>{{ post.title }}</a></li> … Read more

Jekyll display posts by category

Got it! Needed an intermediate posts loop before listing out individual posts <ul> {% for category in site.categories %} <li><a name=”{{ category | first }}”>{{ category | first }}</a> <ul> {% for post in category.last %} <li><a href=”https://stackoverflow.com/questions/20872861/{{ post.url }}”>{{ post.title }}</a></li> {% endfor %} </ul> </li> {% endfor %} </ul>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)