-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcategories.html
More file actions
39 lines (38 loc) · 1.31 KB
/
categories.html
File metadata and controls
39 lines (38 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
---
layout: page
title: "Categories"
permalink: /categories/
---
{% for category in site.categories %}
{% capture cat %}{{ category | first }}{% endcapture %}
{% assign cat_temp = cat | replace: "-", " " | replace: "_", " " %}
{% assign words = cat_temp | split: " " %}
{% assign cat_display = "" %}
{% for word in words %}
{% capture capitalized_word %}{{ word | capitalize }}{% endcapture %}
{% if forloop.first %}
{% assign cat_display = capitalized_word %}
{% else %}
{% assign cat_display = cat_display | append: " " | append: capitalized_word %}
{% endif %}
{% endfor %}
{% assign cat_display = cat_display | replace: "language", "Language" | replace: "models", "Models" | replace: "machine", "Machine" | replace: "learning", "Learning" %}
<h2 id="{{cat}}">{{ cat_display }}</h2>
{% for desc in site.descriptions %}
{% if desc.cat == cat %}
<p class="desc"><em>{{ desc.desc }}</em></p>
{% endif %}
{% endfor %}
<ul class="posts-list">
{% for post in site.categories[cat] %}
<li>
<strong>
<a href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a>
</strong>
<span class="post-date">- {{ post.date | date_to_long_string }}</span>
</li>
{% endfor %}
</ul>
{% if forloop.last == false %}<hr>{% endif %}
{% endfor %}
<br>