避免设置一个不存在的meta时报错

master
xaoxuu 4 years ago
parent 388cfb791b
commit 26dbaa3d94
  1. 4
      layout/_partial/meta.ejs

@ -45,7 +45,7 @@ if (post.meta && (post.meta.footer !== undefined && post.meta.footer !== null))
<% } %> <% } %>
<div class='new-meta-box'> <div class='new-meta-box'>
<% (topMetas).forEach(function(meta){ %> <% (topMetas).forEach(function(meta){ %>
<% if(meta != 'title'){ %> <% if((meta != 'title') && (meta in theme.meta)){ %>
<%- partial('../_meta/' + meta, {post: post, isPostList: isPostList}) %> <%- partial('../_meta/' + meta, {post: post, isPostList: isPostList}) %>
<% } %> <% } %>
<% }) %> <% }) %>
@ -59,7 +59,7 @@ if (post.meta && (post.meta.footer !== undefined && post.meta.footer !== null))
<section class='meta' id="footer-meta"> <section class='meta' id="footer-meta">
<div class='new-meta-box'> <div class='new-meta-box'>
<% (bottomMetas).forEach(function(meta){ %> <% (bottomMetas).forEach(function(meta){ %>
<% if(meta != 'title'){ %> <% if((meta != 'title') && (meta in theme.meta)){ %>
<%- partial('../_meta/' + meta, {post: post, isPostList: isPostList}) %> <%- partial('../_meta/' + meta, {post: post, isPostList: isPostList}) %>
<% } %> <% } %>
<% }) %> <% }) %>

Loading…
Cancel
Save