Skip to content

Commit

Permalink
feat: content platform links (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
nexmoe committed Oct 2, 2022
2 parents 9969592 + 3d982fa commit 4606bf3
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 12 deletions.
29 changes: 19 additions & 10 deletions layout/_partial/_post/meta.ejs
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
<div class="nexmoe-post-meta nexmoe-rainbow">
<a><i class="nexmoefont icon-calendar-fill"></i><%- date(page.date, "YYYY年MM月DD日") %></a>
<% if (page.categories && page.categories.length){ %>
<%- list_categories(page.categories, {
show_count: false,
class: 'nexmoefont icon-appstore-fill ',
style: 'none',
separator: ''
}) %>
<div class="nexmoe-post-meta">
<div class="nexmoe-rainbow">
<a><i class="nexmoefont icon-calendar-fill"></i><%- date(page.date, "YYYY年MM月DD日") %></a>
<% if (page.categories && page.categories.length){ %>
<%- list_categories(page.categories, {
show_count: false,
class: 'nexmoefont icon-appstore-fill ',
style: 'none',
separator: ''
}) %>
<% } %>
<%- partial('_partial/_post/word-count', {post: page}) %>
</div>

<% if (page.wechat){ %>
<a class="wechat" href="<%- page.wechat %>" target="_blank"><i class="nexmoefont icon-wechat-fill"></i>微信</a>
<% } %>
<% if (page.zhihu){ %>
<a class="zhihu" href="<%- page.zhihu %>" target="_blank"><i class="nexmoefont icon-zhihu"></i>知乎</a>
<% } %>
<%- partial('_partial/_post/word-count', {post: page}) %>
</div>
4 changes: 2 additions & 2 deletions layout/post.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

<article>
<% if (page.cover){ %>
<div class="nexmoe-post-cover mdui-ripple absolute" style="padding-top: <%- page.coverHeight/page.coverWidth*100 %>%;">
<div class="nexmoe-post-cover absolute" style="padding-top: <%- page.coverHeight/page.coverWidth*100 %>%;">
<img src="<%- page.cover %>" alt="<%= page.title %>" loading="lazy">
<h1><%= page.title %></h1>
</div>
<%} else{ %>
<div class="nexmoe-post-cover mdui-ripple text">
<div class="nexmoe-post-cover">
<img src="<%- theme.background.path %>" alt="<%= page.title %>" loading="lazy">
<h1><%= page.title %></h1>
</div>
Expand Down
14 changes: 14 additions & 0 deletions source/css/style.styl
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,10 @@ body {
margin: 10px 0px;
font-size: 0;

div {
display: inline-block;
}

a {
border-radius: 20px;
padding: 10px 18px;
Expand All @@ -458,6 +462,16 @@ body {
a:before, i:before {
margin-right: 5px;
}

.wechat {
background-color: rgba(42, 174, 103, 20%);
color: #2aae67;
}

.zhihu {
background-color: rgba(5, 109, 232, 20%);
color: #056de8;
}
}

.nexmoe-post-copyright {
Expand Down

0 comments on commit 4606bf3

Please sign in to comment.