Sundry Codes
  • Categories
      {% assign lists_categories = site.posts | map: "categories" %} {% assign categories = lists_categories | uniq | sort %} {% if categories != empty %} {% for category in categories %}
    • {{ category }} {% assign post_count = 0 %} {% for i in lists_categories %} {% if i contains category %} {% assign post_count = post_count | plus: 1 %} {% endif %} {% endfor %} {% case post_count %} {% when 0 %}No post {% when 1 %}{{ post_count }} post {% else %}{{ post_count }} posts {% endcase %}
    • {% endfor %} {% else %}
    • No categories yet.
    • {% endif %}
  • Recent posts
      {% if site.posts != empty %} {% for post in site.posts %} {% if forloop.index > 10 %} {% break %} {% endif %}
    • {{ post.title }}
    • {% endfor %} {% else %}
    • No posts yet.
    • {% endif %}
  • Tags {% assign lists_tags = site.posts | map: "tags" %} {% assign tags = lists_tags | uniq | sort %} {% assign avg = tags.size | times: 1.0 | divided_by: lists_tags.size %}
      {% if tags != empty %} {% for tag in tags %} {% assign post_count = 0 %} {% for i in lists_tags %} {% if i contains tag %} {% assign post_count = post_count | plus: 1 %} {% endif %} {% endfor %}
    • {{ tag }}
    • {% endfor %} {% else %}
    • No tags yet.
    • {% endif %}
  • Recent comments