hexo-theme-stellar/layout/_partial/main/navbar/breadcrumb.ejs

55 lines
2.4 KiB
Plaintext
Raw Normal View History

2021-02-19 23:33:19 +08:00
<% if (page.breadcrumb != false) { %>
<div class='breadcrumb-navigation'>
<% if (page.layout == 'post') { %>
<div class='cap'>
<a class='cap breadcrumb' href='/'><%- __('btn.home') %></a>
<span class="sep"></span>
<a class='cap breadcrumb' href='/'><%- __('btn.blog') %></a>
<% if (page.layout == 'post' && page.categories && page.categories.length > 0) { %>
<span class="sep"></span>
<%- list_categories(page.categories, {
class: 'cap breadcrumb cat',
show_count: false,
separator: ' <span class="sep"></span> ',
style: 'none'
}) %>
<% } %>
</div>
2021-02-21 17:27:48 +08:00
<div id='post-meta'>
<%- __('meta.created') %>&nbsp;<time datetime='<%- date_xml(page.date) %>'><%- date(page.date, config.date_format) %></time>
2021-02-19 23:33:19 +08:00
</div>
<% } else if (page.layout == 'wiki') { %>
<div>
<a class='cap breadcrumb' href='/'><%- __('btn.home') %></a>
<span class="sep"></span>
2021-02-22 14:31:49 +08:00
<% if (page.menu_id && theme.sidebar.menu[page.menu_id] && theme.sidebar.menu[page.menu_id].url) { %>
<a class='cap breadcrumb' href='<%- url_for(theme.sidebar.menu[page.menu_id].url) %>'><%- __(theme.sidebar.menu[page.menu_id].title) %></a>
<% } else { %>
<a class='cap breadcrumb' href='/wiki/'><%- __('btn.wiki') %></a>
<% } %>
2021-02-19 23:33:19 +08:00
<% site.pages.filter(function (p) { %>
<% return p.layout == 'index' && p.title && p.wiki && p.wiki.includes(page.wiki) %>
<% }).limit(1).each(function(p) { %>
<span class="sep"></span>
<a class='cap breadcrumb' href='<%- url_for(p.path) %>'><%- p.title %></a>
<% }); %>
<% site.pages.filter(function (p) { %>
2021-02-21 03:13:21 +08:00
<% return p.layout == 'wiki' && p.wiki == page.wiki && p.description %>
2021-02-19 23:33:19 +08:00
<% }).limit(1).each(function(p) { %>
<span class="sep"></span>
<a class='cap breadcrumb' href='<%- url_for(p.path) %>'><%- page.wiki %></a>
<% }); %>
</div>
2021-02-21 17:27:48 +08:00
<div id='post-meta'>
<%- __('meta.updated') %>&nbsp;<time datetime='<%- date_xml(page.updated) %>'><%- date(page.updated, config.date_format) %></time>
</div>
2021-02-19 23:33:19 +08:00
<% } else { %>
<div>
<a class='cap breadcrumb' href='/'><%- __('btn.home') %></a>
<span class="sep"></span>
<a class='cap breadcrumb' href='<%- url_for(page.path) %>'><%- page.title || page.seo_title %></a>
</div>
<% } %>
</div>
<% } %>