From 316aa03bd810e0f978473217de67ae3b8a1587ce Mon Sep 17 00:00:00 2001 From: curben Date: Thu, 1 Nov 2018 11:35:02 +1030 Subject: [PATCH] feat: add updated date post.updated variable is not used because it's the time 'hexo generate' is executed, post.updated includes non-content update. --- themes/typing/languages/default.yml | 1 + themes/typing/languages/en.yml | 1 + themes/typing/layout/_partial/article.ejs | 14 ++++++++++---- .../typing/layout/_partial/post/updated-date.ejs | 5 +++++ 4 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 themes/typing/layout/_partial/post/updated-date.ejs diff --git a/themes/typing/languages/default.yml b/themes/typing/languages/default.yml index ecc8ca4..fcb94bd 100644 --- a/themes/typing/languages/default.yml +++ b/themes/typing/languages/default.yml @@ -18,3 +18,4 @@ rss_feed: RSS Feed category: Category tag: Tag date_published: Published Date +date_updated: Last Updated diff --git a/themes/typing/languages/en.yml b/themes/typing/languages/en.yml index ecc8ca4..fcb94bd 100644 --- a/themes/typing/languages/en.yml +++ b/themes/typing/languages/en.yml @@ -18,3 +18,4 @@ rss_feed: RSS Feed category: Category tag: Tag date_published: Published Date +date_updated: Last Updated diff --git a/themes/typing/layout/_partial/article.ejs b/themes/typing/layout/_partial/article.ejs index b4d06cb..8bcc60c 100644 --- a/themes/typing/layout/_partial/article.ejs +++ b/themes/typing/layout/_partial/article.ejs @@ -3,7 +3,7 @@
<%- partial('post/gallery') %> - <% if (post.link || post.title){ %> + <% if (post.link || post.title) { %>
<%- partial('post/title', {class_name: 'article-title'}) %>
@@ -11,7 +11,7 @@
<% if (post.excerpt && index){ %> <%- post.excerpt %> - <% if (theme.excerpt_link){ %> + <% if (theme.excerpt_link) { %>

<%- link_to(url_for(post.path)+'#more', theme.excerpt_link) %>

@@ -23,6 +23,12 @@
- <% if (!index){ %> + <% if (!index) { %> <%- partial('post/nav') %> <% } %> diff --git a/themes/typing/layout/_partial/post/updated-date.ejs b/themes/typing/layout/_partial/post/updated-date.ejs new file mode 100644 index 0000000..9548579 --- /dev/null +++ b/themes/typing/layout/_partial/post/updated-date.ejs @@ -0,0 +1,5 @@ +<%/* User-specified updated date */%> +<%/* default post.updated is (almost) always is the time 'hexo generate' is executed */%> + + +