{%- if site.category_archive.type and post.categories[0] -%} {%- case site.category_archive.type -%} {%- when "liquid" -%} {%- assign path_type = "#" -%} {%- when "jekyll-archives" -%} {%- assign path_type = nil -%} {%- endcase -%} {% case site.tag_archive.type %} {% when "liquid" %} {% assign path_type = "#" %} {% when "jekyll-archives" %} {% assign path_type = nil %} {% endcase %} {%- if site.category_archive.path and site.tag_archive.path -%} {%- capture post_categories -%}{%- for category in post.categories -%}{{ category | downcase }}|{{ category }}{%- unless forloop.last -%},{%- endunless -%}{%- endfor -%}{%- endcapture -%} {%- assign category_hashes = post_categories | split: ',' | sort -%} {% capture post_tags %}{% for tag in post.tags %}{{ tag | downcase }}|{{ tag }}{% unless forloop.last %},{% endunless %}{% endfor %}{% endcapture %} {% assign tag_hashes = post_tags | split: ',' | sort %} {%- for hash in category_hashes -%} {%- assign keyValue = hash | split: '|' -%} {%- capture category_word -%}{{ keyValue[1] | strip_newlines }}{%- endcapture -%} {%- unless forloop.last -%} {%- endunless -%} {%- endfor -%} {% for hash in tag_hashes %} {% assign keyValue = hash | split: '|' %} {% capture tag_word %}{{ keyValue[1] | strip_newlines }}{% endcapture %} {% unless forloop.last %} {% endunless %} {% endfor %} {%- endif -%} {%- endif -%}