<h2>Categories</h2> | |
<ul> | |
{% assign categories_list = site.categories %} | |
{% if categories_list.first[0] == null %} | |
{% for category in categories_list %} | |
<li><a href="#{{ category | downcase | downcase | url_escape | strip | replace: ' ', '-' }}">{{ category | camelcase }} ({{ site.tags[category].size }})</a></li> | |
{% endfor %} | |
{% else %} | |
{% for category in categories_list %} | |
<li><a href="#{{ category[0] | downcase | url_escape | strip | replace: ' ', '-' }}">{{ category[0] | camelcase }} ({{ category[1].size }})</a></li> | |
{% endfor %} | |
{% endif %} | |
{% assign categories_list = nil %} | |
</ul> | |
{% for category in site.categories %} | |
<h3 id="{{ category[0] | downcase | url_escape | strip | replace: ' ', '-' }}">{{ category[0] | camelcase }}</h3> | |
<ul> | |
{% assign pages_list = category[1] %} | |
{% for post in pages_list %} | |
{% if post.title != null %} | |
{% if group == null or group == post.group %} | |
<li><a href="{{ site.url }}{{ post.url }}">{{ post.title }} <time datetime="{{ post.date | date_to_xmlschema }}" itemprop="datePublished">{{ post.date | date: "%B %d, %Y" }}</time></a></li> | |
{% endif %} | |
{% endif %} | |
{% endfor %} | |
{% assign pages_list = nil %} | |
{% assign group = nil %} | |
</ul> | |
{% endfor %} |
This comment has been minimized.
This comment has been minimized.
Thanks , but I cant slide categorie posts when I click a categorie. |
This comment has been minimized.
This comment has been minimized.
On line 10, should Anyway, I got the top snippet working for me that way. Thank you for this! |
This comment has been minimized.
This comment has been minimized.
Hey @cayirburak, I just saw your comment and you're right. I deleted the Hey @bethanyvwatson – my code is confusing, but correct. The |
This comment has been minimized.
This comment has been minimized.
@cayirburak I corrected the code. Thankyou. |
This comment has been minimized.
This comment has been minimized.
How can I create a page for each category automatically in Jekyll ?example: the url of the post : https://UsrNm.github.io/Category1/Category2/2018/02/16/Post1.html I want when I go to link like: https://UsrNm.github.io/Category1/Category2/ Get All posts in category or when I go to link like: https://UsrNm.github.io/Category2/ Get All posts in category |
This comment has been minimized.
This comment has been minimized.
when i click the category, my posts don't show up. do I have to set the permalink and create a page? |
This comment has been minimized.
This comment has been minimized.
Let's say I don't use a default front-matter variable like |
This comment has been minimized.
You've forgot about closing
</span>
in line 23.</time></span></a>
Full version here https://gist.github.com/konstantin-morenko/1c301ad5a6cca6cded99e6726cf2f71a