Index of gists used on blog post: https://antoniomuniz.com/blogging/2023/07/21/creando-tus-propias-colleciones-en-jekyll/
Last active
August 2, 2023 10:53
-
-
Save amc1981/68b9722b4b084148e92d6f07fa6136ab to your computer and use it in GitHub Desktop.
Gist utilizados en el post: https://antoniomuniz.com/blogging/2023/07/10/Crea-tu-primer-post-en-Jekyll/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
layout: default | |
--- | |
<div class="container"> | |
{% if site.tags[page.slug] %} | |
<!-- bucle principal --> | |
{% for post in site.tags[page.slug] %} | |
{% capture post_year %}{{ post.date | date: '%Y' }}{% endcapture %} | |
{% if forloop.first %} | |
<h3 class="year">{{ post_year }}</h3> | |
<div class="list-group"> | |
{% endif %} | |
{% unless forloop.first %} | |
{% assign previous_index = forloop.index0 | minus: 1 %} | |
{% capture previous_post_year %}{{ site.tags[page.slug][previous_index].date | date: '%Y' }}{% endcapture %} | |
{% if post_year != previous_post_year %} | |
</div> | |
<h3 class="year">{{ post_year }}</h3> | |
<div class="list-group"> | |
{% endif %} | |
{% endunless %} | |
<a href="{{ site.baseurl }}{{ post.url }}" class="list-group-item"> | |
<h4 class="list-group-item-heading">{{ post.title }}</h4> | |
<p class="list-group-item-date">{{ post.date | date: "%-d/%-m/%Y" }}</p> | |
</a> | |
{% if forloop.last %} | |
</div> | |
{% endif %} | |
{% endfor %} | |
<!-- fin bucle principal --> | |
{% else %} | |
<p>No existen posts para este TAG.</p> | |
{% endif %} | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment