mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-18 18:33:42 +00:00
26 lines
815 B
Plaintext
26 lines
815 B
Plaintext
{%- set paths = page.path.split('/') %}
|
|
{%- set count = paths.length %}
|
|
{%- if count > 2 %}
|
|
{%- set link = '' %}
|
|
<ul class="breadcrumb">
|
|
{%- for path in paths %}
|
|
{%- if path != 'index.html' %}
|
|
{%- if loop.index == count - 1 and paths[loop.index] == 'index.html' %}
|
|
<li>{{ path | upper }}</li>
|
|
{% else %}
|
|
{%- if link == '' %}
|
|
{%- set link = '/' + path %}
|
|
{% else %}
|
|
{%- set link = link + '/' + path %}
|
|
{%- endif %}
|
|
{%- if path.endsWith('.html') %}
|
|
<li>{{ path | replace(r/\.html$/, '') | upper }}</li>
|
|
{% else %}
|
|
<li><a href="{{ url_for(link) }}/">{{ path | upper }}</a></li>
|
|
{%- endif %}
|
|
{%- endif %}
|
|
{%- endif %}
|
|
{%- endfor %}
|
|
</ul>
|
|
{%- endif %}
|