refactor(es6): arrow function

This commit is contained in:
curben 2019-06-07 09:42:16 +09:30
parent 7fd712bba0
commit 105de8515c
2 changed files with 3 additions and 3 deletions

View File

@ -1,10 +1,10 @@
<% if (pagination === 2) { %>
<% page.posts.each(function(post) { %>
<% page.posts.each((post) => { %>
<%- partial('article', {post: post, index: true}) %>
<% }) %>
<% } else { %>
<% let last %>
<% page.posts.each(function(post, i) { %>
<% page.posts.each((post, i) => { %>
<% const year = post.date.year() %>
<% if (last !== year) { %>
<% if (last !== null) { %>

View File

@ -1,7 +1,7 @@
<% if (post.photos && post.photos.length) { %>
<div class="article-gallery">
<div class="article-gallery-photos">
<% post.photos.forEach(function(photo, i) { %>
<% post.photos.forEach((photo, i) => { %>
<a class="article-gallery-img" href="<%- url_for(photo) %>" rel="gallery_<%= post._id %>">
<img src="<%- url_for(photo) %>" itemprop="image">
</a>