File tree 2 files changed +4
-18
lines changed
2 files changed +4
-18
lines changed Original file line number Diff line number Diff line change 6
6
{% endcase %}
7
7
8
8
{% if site.category_archive.path %}
9
- {% comment %}
10
- <!-- Sort alphabetically regardless of case e.g. a B c d E -->
11
- <!-- modified from http://www.codeofclimber.ru/2015/sorting-site-tags-in-jekyll/ -->
12
- {% endcomment %}
13
- {% capture page_categories %}{% for category in page.categories %}{{ category | downcase }}|{{ category }}{% unless forloop.last %},{% endunless %}{% endfor %}{% endcapture %}
14
- {% assign category_hashes = page_categories | split: ',' | sort %}
9
+ {% assign categories_sorted = page.categories | sort_natural %}
15
10
16
11
< p class ="page__taxonomy ">
17
12
< strong > < i class ="fas fa-fw fa-folder-open " aria-hidden ="true "> </ i > {{ site.data.ui-text[site.locale].categories_label | default: "Categories:" }} </ strong >
18
13
< span itemprop ="keywords ">
19
- {% for hash in category_hashes %}
20
- {% assign keyValue = hash | split: '|' %}
21
- {% capture category_word %}{{ keyValue[1] | strip_newlines }}{% endcapture %}
14
+ {% for category_word in categories_sorted %}
22
15
< a href ="{{ category_word | slugify | prepend: path_type | prepend: site.category_archive.path | relative_url }} " class ="page__taxonomy-item " rel ="tag "> {{ category_word }}</ a > {% unless forloop.last %}< span class ="sep "> , </ span > {% endunless %}
23
16
{% endfor %}
24
17
</ span >
Original file line number Diff line number Diff line change 6
6
{% endcase %}
7
7
8
8
{% if site.tag_archive.path %}
9
- {% comment %}
10
- <!-- Sort alphabetically regardless of case e.g. a B c d E -->
11
- <!-- modified from http://www.codeofclimber.ru/2015/sorting-site-tags-in-jekyll/ -->
12
- {% endcomment %}
13
- {% capture page_tags %}{% for tag in page.tags %}{{ tag | downcase }}|{{ tag }}{% unless forloop.last %},{% endunless %}{% endfor %}{% endcapture %}
14
- {% assign tag_hashes = page_tags | split: ',' | sort %}
9
+ {% assign tags_sorted = page.tags | sort_natural %}
15
10
16
11
< p class ="page__taxonomy ">
17
12
< strong > < i class ="fas fa-fw fa-tags " aria-hidden ="true "> </ i > {{ site.data.ui-text[site.locale].tags_label | default: "Tags:" }} </ strong >
18
13
< span itemprop ="keywords ">
19
- {% for hash in tag_hashes %}
20
- {% assign keyValue = hash | split: '|' %}
21
- {% capture tag_word %}{{ keyValue[1] | strip_newlines }}{% endcapture %}
14
+ {% for tag_word in tags_sorted %}
22
15
< a href ="{{ tag_word | slugify | prepend: path_type | prepend: site.tag_archive.path | relative_url }} " class ="page__taxonomy-item " rel ="tag "> {{ tag_word }}</ a > {% unless forloop.last %}< span class ="sep "> , </ span > {% endunless %}
23
16
{% endfor %}
24
17
</ span >
You can’t perform that action at this time.
0 commit comments