🚀 fix: pin top

This commit is contained in:
shenyu 2020-03-21 17:20:59 +08:00
parent a9473d4d22
commit 66a6390998
8 changed files with 17 additions and 20 deletions

View File

@ -7,11 +7,10 @@
<% } else if (post.title){ %> <% if (index){ %>
<h2 itemprop="name">
<a class="<%= class_name %>" href="<%- url_for(post.path) %>"
><%= post.title %></a
>
><%= post.title %><%- partial('topping') %></a>
</h2>
<% } else { %>
<h1 class="<%= class_name %> sea-center" style="border-left:0" itemprop="name">
<%= post.title %>
</h1>
<% } %> <%- partial('topping') %> <% } %>
<% } %> <% } %>

View File

@ -1,5 +1,3 @@
<% if (is_home() && post.top) { %>
<div class="article-topping">
<i class="ri-umbrella-line"></i>
</div>
<i class="article-topping">置顶</i>
<% } %>

View File

@ -4,7 +4,7 @@
"description": "a clean and elegant theme for hexo.",
"scripts": {
"dev": "parcel serve source-src/main.js -d source/css",
"build": "parcel build source-src/main.js -d source/css"
"build": "parcel build source-src/main.js -d source/css --no-source-maps"
},
"source": "source-src/main.js",
"repository": {

View File

@ -16,13 +16,17 @@
// overflow hidden
.article-topping
position absolute
top 0
left -3rem
color: #ea434a
&>i
font-size 2rem
line-height 1.7
display inline-block
margin-left 10px
padding 0 10px
border-radius 4px
font-style normal
font-size 10px
background-color #ea434a
color #fff
height 20px
line-height 22px
transform translateY(-8px)
.article-meta

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2,5 +2,4 @@ parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcel
},{}],"epB2":[function(require,module,exports) {
"use strict";require("./css/style.styl");
},{"./css/style.styl":"MiQR"}]},{},["epB2"], null)
//# sourceMappingURL=/main.js.map
},{"./css/style.styl":"MiQR"}]},{},["epB2"], null)

View File

@ -1 +0,0 @@
{"version":3,"sources":["main.js"],"names":[],"mappings":";;;AAAA,aAAA,QAAA","file":"main.js","sourceRoot":"..\\..\\source-src","sourcesContent":["import './css/style.styl'"]}