aboutsummaryrefslogtreecommitdiff
path: root/_includes/breadcrumbs.html
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@gmail.com>2019-10-27 09:57:37 -0400
committerAndrew Lee <alee14498@gmail.com>2019-10-27 09:57:37 -0400
commite62e7bb6b14555c9bbe5d40d217103984f4f80e6 (patch)
tree21887d847dccacb47644eb6f74ce31326172303c /_includes/breadcrumbs.html
parent716ea6ed2b64c921a799d872a07bfbd53b2a3e58 (diff)
downloadpokeworld-website-e62e7bb6b14555c9bbe5d40d217103984f4f80e6.tar.gz
pokeworld-website-e62e7bb6b14555c9bbe5d40d217103984f4f80e6.tar.bz2
pokeworld-website-e62e7bb6b14555c9bbe5d40d217103984f4f80e6.zip
Rewrite progress
Diffstat (limited to '_includes/breadcrumbs.html')
-rw-r--r--_includes/breadcrumbs.html39
1 files changed, 39 insertions, 0 deletions
diff --git a/_includes/breadcrumbs.html b/_includes/breadcrumbs.html
new file mode 100644
index 0000000..cba3d41
--- /dev/null
+++ b/_includes/breadcrumbs.html
@@ -0,0 +1,39 @@
+{% case site.category_archive.type %}
+ {% when "liquid" %}
+ {% assign path_type = "#" %}
+ {% when "jekyll-archives" %}
+ {% assign path_type = nil %}
+{% endcase %}
+
+{% if page.collection != 'posts' %}
+ {% assign path_type = nil %}
+ {% assign crumb_path = '/' %}
+{% else %}
+ {% assign crumb_path = site.category_archive.path %}
+{% endif %}
+
+<nav class="breadcrumbs">
+ <ol itemscope itemtype="https://schema.org/BreadcrumbList">
+ {% assign crumbs = page.url | split: '/' %}
+ {% assign i = 1 %}
+ {% for crumb in crumbs offset: 1 %}
+ {% if forloop.first %}
+ <li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
+ <a href="{{ site.url }}{{ site.baseurl }}/" itemprop="item"><span itemprop="name">{{ site.data.ui-text[site.locale].breadcrumb_home_label | default: "Home" }}</span></a>
+ <meta itemprop="position" content="{{ i }}" />
+ </li>
+ <span class="sep">{{ site.data.ui-text[site.locale].breadcrumb_separator | default: "/" }}</span>
+ {% endif %}
+ {% if forloop.last %}
+ <li class="current">{{ page.title }}</li>
+ {% else %}
+ {% assign i = i | plus: 1 %}
+ <li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
+ <a href="{{ crumb | downcase | replace: '%20', '-' | prepend: path_type | prepend: crumb_path | relative_url }}" itemprop="item"><span itemprop="name">{{ crumb | replace: '-', ' ' | replace: '%20', ' ' | capitalize }}</span></a>
+ <meta itemprop="position" content="{{ i }}" />
+ </li>
+ <span class="sep">{{ site.data.ui-text[site.locale].breadcrumb_separator | default: "/" }}</span>
+ {% endif %}
+ {% endfor %}
+ </ol>
+</nav>