style: use ES6 syntax and standard style

This commit is contained in:
curben 2018-11-01 12:05:09 +10:30
parent 316aa03bd8
commit 624d449a3e
12 changed files with 53 additions and 50 deletions

View File

@ -15,8 +15,8 @@
<%/* Initialize cloudinary responsive function */%>
<script type="text/javascript">
var cl = cloudinary.Cloudinary.new({cloud_name: "curben"});
cl.responsive();
const cl = cloudinary.Cloudinary.new({cloud_name: "curben"})
cl.responsive()
</script>
<%/* javascript of Typing theme */%>

View File

@ -1,20 +1,20 @@
<% if (pagination == 2){ %>
<% if (pagination === 2) { %>
<% page.posts.each(function(post) { %>
<%- partial('article', {post: post, index: true}) %>
<% }) %>
<% } else { %>
<% var last; %>
<% let last %>
<% page.posts.each(function(post, i) { %>
<% var year = post.date.year(); %>
<% if (last != year){ %>
<% if (last != null){ %>
<% const year = post.date.year() %>
<% if (last !== year) { %>
<% if (last !== null) { %>
</div></section>
<% } %>
<% last = year; %>
<% last = year %>
<section class="archives-wrap">
<div class="archives">
<% } %>
<%- partial('archive-post', {post: post, even: i % 2 == 0}) %>
<%- partial('archive-post', {post: post, even: i % 2 === 0}) %>
<% }) %>
<% if (page.posts.length) { %>
</div></section>
@ -22,7 +22,10 @@
<% } %>
<% if (page.total > 1) { %>
<nav id="page-nav" class="page-nav">
<% var prev_text = "&laquo; " + __('prev');var next_text = __('next') + " &raquo;"%>
<%
let prev_text = "&laquo; " + __('prev')
let next_text = __('next') + " &raquo;"
%>
<%- paginator({
prev_text: prev_text,
next_text: next_text

View File

@ -3,20 +3,20 @@
<head>
<meta charset="utf-8">
<%
var title = page.title;
let title = page.title
if (is_archive()) {
title = __('archive_a');
title = __('archive_a')
if (is_month()) {
title += ': ' + page.year + '/' + page.month;
title += ': ' + page.year + '/' + page.month
} else if (is_year()) {
title += ': ' + page.year;
title += ': ' + page.year
}
} else if (is_category()) {
title = __('category') + ': ' + page.category;
title = __('category') + ': ' + page.category
} else if (is_tag()) {
title = __('tag') + ': ' + page.tag;
title = __('tag') + ': ' + page.tag
}
%>
<title><% if (title) { %><%= title %> | <% } %><%= config.title %></title>

View File

@ -10,7 +10,7 @@
<% } else { %>
<nav id="main-nav" class="main-nav">
<% } %>
<% for (var i in theme.menu){ %>
<% for (let i in theme.menu) { %>
<a class="main-nav-link" href="<%- url_for(theme.menu[i]) %>"><%= i %></a>
<% } %>
</nav>

View File

@ -10,7 +10,7 @@
</div>
</div>
<ul class="footer-links">
<% for (var key in theme.links.solid) { %>
<% for (let key in theme.links.solid) { %>
<li>
<% if (theme.icons) { %>
<a href="<%= theme.links.solid[key] %>"><span class="fas fa-<%= key.toLowerCase() %>"></span></a>
@ -19,7 +19,7 @@
<% } %>
</li>
<% } %>
<% for (var key in theme.links.brands) { %>
<% for (let key in theme.links.brands) { %>
<li>
<% if (theme.icons) { %>
<a href="<%= theme.links.brands[key] %>"><span class="fab fa-<%= key.toLowerCase() %>"></span></a>