Skip to content

Commit 8cf26d5

Browse files
committed
修复 blockquote 溢出,修改 archive-post 展示图片,添加 tooltips 组件
1 parent 1838c30 commit 8cf26d5

23 files changed

Lines changed: 209 additions & 135 deletions

.DS_Store

-6 KB
Binary file not shown.

layout/_partial/archive-post.ejs

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,28 @@
11
<article class="archive-article archive-type-<%= post.layout %>">
2+
3+
<% if(post.photos.length){ %>
4+
<div class="archive-article-gallery">
5+
<% post.photos.forEach(function(photo, i){ %>
6+
<a class="article-gallery-img" href="<%- url_for(post.path) %>" rel="gallery_<%= post._id %>">
7+
<img src="<%- url_for(photo) %>" itemprop="image">
8+
</a>
9+
<% }) %>
10+
</div>
11+
<% } %>
212
<div class="archive-article-inner">
313
<header class="archive-article-header">
4-
<%- partial('post/date', {class_name: 'archive-article-date', date_format: 'MM/DD'}) %>
514
<%- partial('post/title', {class_name: 'archive-article-title'}) %>
15+
<%- partial('post/date', {class_name: 'archive-article-date', date_format: 'MM/DD'}) %>
616
</header>
17+
<% if(post.photos.length === 0){ %>
18+
<%- post.excerpt %>
19+
<% } %>
720
<% if(page.category){ %>
8-
<%- partial('post/category') %>
21+
<%- partial('post/category') %>
922
<% } %>
1023
<% if(page.tag){ %>
11-
<%- partial('post/tag') %>
24+
<%- partial('post/tag') %>
1225
<% } %>
13-
<!-- <%- partial('post/gallery') %> -->
1426
</div>
27+
1528
</article>

layout/_partial/article.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
</p>
3535
<% } %>
3636
<% } else { %>
37-
<%- post.content %>
37+
<%- post.content %>
3838
<% } %>
3939
</div>
4040
<footer class="article-footer">

layout/_partial/footer.ejs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
<footer class="footer">
22
<div class="outer">
3-
<div class="float-right">
4-
<%- partial('post/busuanzi') %>
5-
</div>
63
<ul class="list-inline">
74
<li><%= config.title %> &copy; <%= date(new Date(), 'YYYY') %></li>
85
<% if (theme.beian){ %>
9-
<li><%- theme.beian.number %></li>
6+
<li>
7+
<%if (theme.beian.url){ %>
8+
<a href="<%- url_for(theme.beian.url) %>" target="_blank"><%- theme.beian.number %></a>
9+
<% } else { %>
10+
<%- theme.beian.number %>
11+
<% } %>
12+
</li>
1013
<% } %>
1114
<li><%= __('powered_by') %> <a href="http://hexo.io/" target="_blank">Hexo</a></li>
1215
<li><%= __('theme ') %> <a href="https://github.com/zhwangart/hexo-theme-ocean">Ocean</a></li>
1316
</ul>
17+
<p><%- partial('post/busuanzi') %></p>
1418
</div>
1519
</footer>

layout/_partial/post/busuanzi.ejs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<ul class="list-inline">
22
<% if (is_home()) { %>
3-
<li><i class="fe fe-bar-chart"></i> <span id="busuanzi_value_site_pv"></span></li>
3+
<li><i class="fe fe-bar-chart tooltip" data-tooltip="PV"></i> <span id="busuanzi_value_site_pv"></span></li>
44
<%} %>
5-
<li><i class="fe fe-smile-alt"></i> <span id="busuanzi_value_site_uv"></span></li>
5+
<li><i class="fe fe-smile-alt tooltip" data-tooltip="UV"></i> <span id="busuanzi_value_site_uv"></span></li>
66
<% if (is_post()) { %>
7-
<li><i class="fe fe-bookmark"></i> <span id="busuanzi_value_page_pv"></span></li>
7+
<li><i class="fe fe-bookmark tooltip" data-tooltip="PV"></i> <span id="busuanzi_value_page_pv"></span></li>
88
<%} %>
99
</ul>

layout/_partial/post/gallery.ejs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
<div class="article-gallery">
33
<div class="article-gallery-photos">
44
<% post.photos.forEach(function(photo, i){ %>
5-
<% if (index){ %>
6-
<a class="article-gallery-img" href="<%- url_for(post.path) %>" rel="gallery_<%= post._id %>">
7-
<img src="<%- url_for(photo) %>" itemprop="image">
8-
</a>
9-
<% } else { %>
10-
<img src="<%- url_for(photo) %>" itemprop="image">
11-
<% } %>
5+
<% if (index){ %>
6+
<a class="article-gallery-img" href="<%- url_for(post.path) %>" rel="gallery_<%= post._id %>">
7+
<img src="<%- url_for(photo) %>" itemprop="image">
8+
</a>
9+
<% } else { %>
10+
<img src="<%- url_for(photo) %>" itemprop="image">
11+
<% } %>
1212
<% }) %>
1313
</div>
1414
</div>

layout/_partial/post/title.ejs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<% if (post.link){ %>
2-
<h2 itemprop="name">
3-
<a class="<%= class_name %>" href="<%- url_for(post.link) %>" itemprop="url"><%= post.title %></a>
4-
</h2>
5-
<% } else if (post.title){ %>
6-
<% if (index){ %>
7-
<h2 itemprop="name">
8-
<a class="<%= class_name %>" href="<%- url_for(post.path) %>"><%= post.title %></a>
9-
</h2>
10-
<% } else { %>
11-
<h1 class="<%= class_name %>" itemprop="name">
12-
<%= post.title %>
13-
</h1>
14-
<% } %>
15-
<%- partial('topping') %>
2+
<h2 class="<%= class_name %>" itemprop="name">
3+
<a href="<%- url_for(post.link) %>" itemprop="url"><%= post.title %></a>
4+
</h2>
5+
<% } else if (post.title){ %>
6+
<% if (index){ %>
7+
<h2 class="<%= class_name %>" itemprop="name">
8+
<a href="<%- url_for(post.path) %>"><%= post.title %></a>
9+
</h2>
10+
<% } else { %>
11+
<h1 class="<%= class_name %>" itemprop="name">
12+
<%= post.title %>
13+
</h1>
14+
<% } %>
15+
<%- partial('topping') %>
1616
<% } %>

layout/tags.ejs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<section class="outer">
22
<% if (site.tags.length){ %>
3-
<h1 class="page-type-title"><%= __('tags') %></h1>
4-
<%- list_tags({show_count: theme.show_count}) %>
3+
<h1 class="page-type-title"><%= __('tags') %></h1>
4+
<%- list_tags({show_count: theme.show_count}) %>
55
<% } %>
66
</section>

source/.DS_Store

-6 KB
Binary file not shown.

source/css/_extend.styl

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,21 @@ $base-style
7272
blockquote
7373
position relative
7474
display block
75-
padding 0 1.5rem 0 4.5rem
75+
padding 0 1.5rem 0 3.5rem
7676
width 100%
7777
overflow auto
7878
color sea-lighter
79-
&:before
80-
content url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMjQgMjQiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0xMCAySDQuMWMtLjQgMC0uNy4zLS43LjdMMiAyMS4yYzAgLjQuMy44LjguOGgxLjZjLjMgMCAuNi0uMi43LS41TDEwLjcgM2MuMS0uNS0uMi0xLS43LTF6TTIxLjIgMmgtNS44Yy0uNCAwLS43LjMtLjguN2wtMS40IDE4LjVjMCAuNC4zLjguOC44aDEuNmMuMyAwIC42LS4yLjctLjVMMjIgM2MuMS0uNS0uMi0xLS44LTF6IiBmaWxsPSIjQURCNUJEIi8+PC9zdmc+")
81-
display block
82-
width 3rem
83-
position absolute
84-
left 0
85-
top 0
79+
background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMjQgMjQiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0xMCAySDQuMWMtLjQgMC0uNy4zLS43LjdMMiAyMS4yYzAgLjQuMy44LjguOGgxLjZjLjMgMCAuNi0uMi43LS41TDEwLjcgM2MuMS0uNS0uMi0xLS43LTF6TTIxLjIgMmgtNS44Yy0uNCAwLS43LjMtLjguN2wtMS40IDE4LjVjMCAuNC4zLjguOC44aDEuNmMuMyAwIC42LS4yLjctLjVMMjIgM2MuMS0uNS0uMi0xLS44LTF6IiBmaWxsPSIjQURCNUJEIi8+PC9zdmc+")
80+
background-size: 3rem
81+
background-repeat: no-repeat
82+
background-position: 0 0
83+
// &:before
84+
// content url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMjQgMjQiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0xMCAySDQuMWMtLjQgMC0uNy4zLS43LjdMMiAyMS4yYzAgLjQuMy44LjguOGgxLjZjLjMgMCAuNi0uMi43LS41TDEwLjcgM2MuMS0uNS0uMi0xLS43LTF6TTIxLjIgMmgtNS44Yy0uNCAwLS43LjMtLjguN2wtMS40IDE4LjVjMCAuNC4zLjguOC44aDEuNmMuMyAwIC42LS4yLjctLjVMMjIgM2MuMS0uNS0uMi0xLS44LTF6IiBmaWxsPSIjQURCNUJEIi8+PC9zdmc+")
85+
// display block
86+
// width 3rem
87+
// position absolute
88+
// left 0
89+
// top 0
8690
> :first-child
8791
margin-top 0;
8892
> :last-child

0 commit comments

Comments
 (0)