From 272ed8d53c268f3a14226e09f4c53aefc85b3d79 Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Tue, 4 Sep 2018 10:36:45 +0800 Subject: [PATCH] title --- layout/_partial/article.ejs | 18 +++++++++++++----- layout/_partial/categories.ejs | 2 +- layout/_partial/post.ejs | 4 ++-- layout/archive.ejs | 8 +++++++- 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/layout/_partial/article.ejs b/layout/_partial/article.ejs index a01288d..e512a50 100755 --- a/layout/_partial/article.ejs +++ b/layout/_partial/article.ejs @@ -4,11 +4,11 @@ <% if(post.title){ %> <%= post.title %> <% } else if (post.date) { %> - <%= date(post.date, 'YYYY-MM-DD dddd') %> + <%= date(post.date, config.date_format) %> <% } %> <%- partial('categories',{post:post}) %> @@ -20,7 +20,7 @@ <%- post.content %> - <% if (post.tags && post.tags.length) { %> + <% if (post.tags && post.tags && post.tags.each) { %>
<% post.tags.each(function(item){ %>  <%=item.name %> @@ -36,7 +36,11 @@
 上一篇

<% if (post.prev.tags && post.prev.tags.length) { %> @@ -55,7 +59,11 @@
下一篇 

<% if (post.next.tags && post.next.tags.length) { %> diff --git a/layout/_partial/categories.ejs b/layout/_partial/categories.ejs index 741bbfe..e8c31fa 100755 --- a/layout/_partial/categories.ejs +++ b/layout/_partial/categories.ejs @@ -1,4 +1,4 @@ -<% if (post.categories && post.categories.length){ %> +<% if (post.categories && post.categories && post.categories.forEach){ %> <% var cats = []; post.categories.forEach(function(cat){ diff --git a/layout/_partial/post.ejs b/layout/_partial/post.ejs index f411add..e3d65a0 100755 --- a/layout/_partial/post.ejs +++ b/layout/_partial/post.ejs @@ -5,12 +5,12 @@ <% if(post.title){ %> <%= post.title %> <% } else if (post.date) { %> - <%= date(post.date, 'YYYY-MM-DD dddd') %> + <%= date(post.date, config.date_format) %> <% } %> <%- partial('categories',{post:post}) %> diff --git a/layout/archive.ejs b/layout/archive.ejs index e7ef7de..e108569 100755 --- a/layout/archive.ejs +++ b/layout/archive.ejs @@ -20,7 +20,13 @@
- <%= post.title %> + + <% if(post.title){ %> + <%= post.title %> + <% } else if (post.date) { %> + <%= date(post.date, config.date_format) %> + <% } %> +
<% }); %>