Skip to content

Commit

Permalink
✨ Change blog html page
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarsotovalero committed Mar 9, 2024
1 parent 09f8adc commit 5f5cc61
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
Binary file modified .jekyll-metadata
Binary file not shown.
34 changes: 31 additions & 3 deletions blog/index.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,40 @@
---
layout: page
title: Blog
subtitle: The complete list
title: My Blog
---

{% include archive.html %}
{% include subscribe.html %}

<br>

<!-- count all post published thi month -->
{% assign current_date = 'now' | date: '%Y-%m' %}
{% assign current_month_post_count = 0 %}
{% for post in site.posts %}
{% assign post_date = post.date | date: '%Y-%m' %}
{% if post_date == current_date %}
{% assign current_month_post_count = current_month_post_count | plus: 1 %}
{% endif %}
{% endfor %}

<!-- count all the blog posts -->
{% assign published_posts = site.posts | where:"published", true %}

<!-- count the number of tags -->
{% assign all_tags = "" | split: "" %}
{% for post in site.posts %}
{% assign all_tags = all_tags | concat: post.tags %}
{% endfor %}
{% assign unique_tags = all_tags | uniq %}

<div class="list-filters">
<a href="/this-month" class="list-filter"> This Month ({{ current_month_post_count }})</a>
<a href="/all-posts" class="list-filter">All ({{ published_posts.size }})</a>
<a href="/tags" class="list-filter">Tags ({{ unique_tags.size }})</a>
</div>



<div class="posts-list">
{% for post in site.posts %}
<article class="post-preview">
Expand Down

0 comments on commit 5f5cc61

Please sign in to comment.