Skip to content
This repository has been archived by the owner on Jun 4, 2022. It is now read-only.

add sub-menu support #288

Merged
merged 3 commits into from
Aug 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 20 additions & 9 deletions layout/common/header.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,25 @@
<div class="nav-container-inner">
<ul id="main-nav">
<% for (var i in theme.menu) {
if (i == 'Categories') { %>
<%- list_categories({
depth: 2,
style: 'list',
class: 'main-nav',
show_count: false,
}) %>
<% } else { %>
if (i == 'Categories') { %>
<%- list_categories({
depth: 2,
style: 'list',
class: 'main-nav',
show_count: false,
}) %>
<% } else if (typeof theme.menu[i] == 'object') { %>
<li class="main-nav-list-item" >
<a class="main-nav-list-link" href="<%- url_for(theme.menu[i]) %>"><%= __('index.' + i.toLowerCase()) %></a>
<ul class="main-nav-list-child">
<li class="main-nav-list-item">
<% for (var j in theme.menu[i]) { %>
<a class="main-nav-list-link" href="<%- url_for(theme.menu[i][j]) %>"><%= __('index.' + j.toLowerCase()) %></a>
<% } %>
</li>
</ul>
</li>
<% } else { %>
<li class="main-nav-list-item" >
<a class="main-nav-list-link" href="<%- url_for(theme.menu[i]) %>"><%= __('index.' + i.toLowerCase()) %></a>
</li>
Expand All @@ -38,4 +49,4 @@
</div>
</div>
</div>
</header>
</header>
20 changes: 14 additions & 6 deletions layout/common/post/date.ejs
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
<% if (post.date) { %>
<div class="<%= class_name %>">
<i class="fa fa-calendar"></i>
<a href="<%- url_for(post.path) %>" class="<%= class_name %>">
<time datetime="<%= date_xml(post.date) %>" itemprop="datePublished"><%= date(post.date, date_format) %></time>
</a>
</div>
<div class="<%= class_name %>">
<i class="fa fa-calendar"></i>
<a href="<%- url_for(post.path) %>" class="<%= class_name %>">
<time datetime="<%= date_xml(post.date) %>" itemprop="datePublished"><%= date(post.date, date_format) %></time>
</a>
</div>
<% } %>
<% if (post.updated) { %>
<div class="<%= class_name %>">
<i class="fa fa-calendar-plus-o"></i>
<a href="<%- url_for(post.path) %>" class="<%= class_name %>">
<time datetime="<%= date_xml(post.updated) %>" itemprop="dateModified"><%= date(post.updated, date_format) %></time>
</a>
</div>
<% } %>