Skip to content

Commit

Permalink
tag listing
Browse files Browse the repository at this point in the history
  • Loading branch information
Xmaster6y committed Jun 5, 2024
1 parent 0612691 commit 4b271be
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion _layouts/listing-tags.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h1>{{ title }} </h1>
<span>No item yet...</span>
<p>Be patient!</p>
{% else %}
{% assign sorted_collection = collection | sort: "publishedOn" | reverse %}
{% assign sorted_collection = collection | sort: "title" %}
{% for item in sorted_collection %}
{% if item.title != title %}
<h3><a href="{{ item.url }}">{{ item.title }}</a></h3>
Expand Down
32 changes: 32 additions & 0 deletions _layouts/tag-listing.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,37 @@ <h3><a href="{{ item.url }}">{{ item.title }}</a></h3>
{% endif %}
{% endif %}
{% endfor %}

{% assign collection = site.publications | sort: "publishedOn" | reverse %}
{% assign article_count = 0 %}
{% for item in collection %}
{% if item.name != "index.md"%}
{% if item.tags contains page.tag %}
{% if article_count == 0 %}
<h2># <a href={{ "/publications/" | absolute_url }}>Publications</a></h2>
{% endif %}
<small class="date">{{ item.publishedOn | date: "%-d %B %Y" }}</small>
<small>| {{ item.readingTime }} min read </small>
<small>
| tags:
{% for tag in item.tags %}
<em><a href="/tags/{{ tag | downcase }}" class="tag"> {{ tag }} <i class="fa-solid fa-tag"></i></a></em>
{% endfor %}
</small>
<h3><a href="{{ item.url }}">{{ item.title }}</a></h3>
<div class="thumbnail">
{% if item.image %}
<a href="{{ item.url }}"><img src="{{ item.image }}" alt="{{ item.title }}" class="thumbnail" /></a>
{% endif %}
{% if item.tldr %}
<p class="tldr">
<small>{{ item.tldr}}</small>
</p>
{% endif %}
</div>
{% assign article_count = article_count | plus: 1 %}
{% endif %}
{% endif %}
{% endfor %}
<h3> <a href="/tags">> All tags</a></h2>
</section>

0 comments on commit 4b271be

Please sign in to comment.