Skip to content

Commit

Permalink
feat: 更多封面选项
Browse files Browse the repository at this point in the history
  • Loading branch information
D-Sketon committed Sep 9, 2023
1 parent b851094 commit 328044a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion layout/_partial/header.ejs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<header id="header">
<% if(post.cover){ %>
<% if(post.cover && post.cover.startsWith("rgb")){ %>
<div style="position: absolute;top: 0;left: 0;width: 100%;height: 150%;z-index: -2;display: block;background: <%- post.cover %>"></div>
<% }else if(post.cover){ %>
<img data-src="<%= post.cover %>" data-sizes="auto" alt="<%= post.title %>" class="lazyload">
<% }else if(post.cover == false){ %>
<% }else{ %>
<img data-src="<%= theme.banner %>" data-sizes="auto" alt="<%= post.title %>" class="lazyload">
<% } %>
Expand Down
2 changes: 1 addition & 1 deletion layout/_partial/post.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="post-sticky"><%= __('sticky')%></div>
<% } %>
<div class="post-cover-left">
<% if(post.cover){ %>
<% if(post.cover && !post.cover.startsWith("rgb")){ %>
<img data-src="<%= post.cover %>" data-sizes="auto" alt="<%= post.title %>" class="lazyload">
<% }else{ %>
<% var cover = randomCover(); %>
Expand Down

0 comments on commit 328044a

Please sign in to comment.