From 624d449a3e8de2cbc7e6a802543893bf69f96056 Mon Sep 17 00:00:00 2001 From: curben Date: Thu, 1 Nov 2018 12:05:09 +1030 Subject: [PATCH] style: use ES6 syntax and standard style --- .../typing/layout/_partial/after-footer.ejs | 8 +++--- themes/typing/layout/_partial/archive.ejs | 27 ++++++++++-------- themes/typing/layout/_partial/article.ejs | 2 +- themes/typing/layout/_partial/head.ejs | 28 +++++++++---------- themes/typing/layout/_partial/header.ejs | 2 +- .../typing/layout/_partial/post/category.ejs | 2 +- .../typing/layout/_partial/post/gallery.ejs | 6 ++-- themes/typing/layout/_partial/post/nav.ejs | 8 +++--- themes/typing/layout/_partial/post/tag.ejs | 2 +- themes/typing/layout/_partial/post/title.ejs | 8 +++--- themes/typing/layout/about.ejs | 8 +++--- themes/typing/layout/archive.ejs | 2 +- 12 files changed, 53 insertions(+), 50 deletions(-) diff --git a/themes/typing/layout/_partial/after-footer.ejs b/themes/typing/layout/_partial/after-footer.ejs index 0ddb5dc..2013399 100644 --- a/themes/typing/layout/_partial/after-footer.ejs +++ b/themes/typing/layout/_partial/after-footer.ejs @@ -7,7 +7,7 @@ -<% if (theme.fancybox){ %> +<% if (theme.fancybox) { %> @@ -15,9 +15,9 @@ <%/* Initialize cloudinary responsive function */%> <%/* javascript of Typing theme */%> -<%- js('js/typing') %> \ No newline at end of file +<%- js('js/typing') %> diff --git a/themes/typing/layout/_partial/archive.ejs b/themes/typing/layout/_partial/archive.ejs index e2d866f..bb322ab 100644 --- a/themes/typing/layout/_partial/archive.ejs +++ b/themes/typing/layout/_partial/archive.ejs @@ -1,28 +1,31 @@ -<% if (pagination == 2){ %> - <% page.posts.each(function(post){ %> +<% if (pagination === 2) { %> + <% page.posts.each(function(post) { %> <%- partial('article', {post: post, index: true}) %> <% }) %> <% } else { %> - <% var last; %> - <% page.posts.each(function(post, i){ %> - <% var year = post.date.year(); %> - <% if (last != year){ %> - <% if (last != null){ %> + <% let last %> + <% page.posts.each(function(post, i) { %> + <% const year = post.date.year() %> + <% if (last !== year) { %> + <% if (last !== null) { %> <% } %> - <% last = year; %> + <% last = year %>
<% } %> - <%- partial('archive-post', {post: post, even: i % 2 == 0}) %> + <%- partial('archive-post', {post: post, even: i % 2 === 0}) %> <% }) %> - <% if (page.posts.length){ %> + <% if (page.posts.length) { %>
<% } %> <% } %> -<% if (page.total > 1){ %> +<% if (page.total > 1) { %>